blob: 267be9176589c00f67cdbc01d15a8114fe9df046 [file] [log] [blame]
cmake_minimum_required(VERSION 3.5)
if(NOT TARGET msvc-posix-compat)
# This is a posix wrapper for windows-msvc build.
android_nasm_compile(TARGET setjmp_asm_lib LICENSE Apache-2.0
SRC src/setjmp.asm)
android_add_library(
TARGET msvc-posix-compat LICENSE Apache-2.0
SRC src/getopt.c src/gettimeofday.c src/msvc-posix.c src/pread.cpp)
# Msvc posix needs the file-io libs from android-emu-base.
target_link_libraries(msvc-posix-compat PRIVATE setjmp_asm_lib)
target_link_libraries(msvc-posix-compat PUBLIC aemu-base.headers)
# Msvc redefines macro's to inject compatibility.
target_compile_options(
msvc-posix-compat
PUBLIC "-Wno-macro-redefined"
"-Wno-deprecated-declarations" # A lot of the POSIX names are
# deprecated..
)
target_include_directories(
msvc-posix-compat
PUBLIC include/ ${ANDROID_QEMU2_TOP_DIR}/include
${ANDROID_QEMU2_TOP_DIR}/android/android-base
${ANDROID_QEMU2_TOP_DIR}/android/android-emu-base)
endif()