1if(TARGET msvc-posix-compat)
2  return()
3endif()
4
5if(INCLUDE_ANDROID_CMAKE)
6  # This is a posix wrapper for windows-msvc build.
7  android_nasm_compile(TARGET setjmp_asm_lib LICENSE Apache-2.0 SRC
8                       src/setjmp.asm)
9  android_add_library(TARGET msvc-posix-compat LICENSE Apache-2.0 SRC "")
10  target_link_libraries(msvc-posix-compat PRIVATE setjmp_asm_lib)
11else()
12  add_library(msvc-posix-compat)
13endif()
14
15target_sources(
16  msvc-posix-compat
17  PRIVATE src/asprintf.c
18          src/files.cpp
19          src/getopt.c
20          src/msvc-posix.c
21          src/pread.cpp
22          src/time.cpp)
23target_link_libraries(msvc-posix-compat PUBLIC aemu-base.headers)
24
25# Msvc redefines macro's to inject compatibility.
26target_compile_options(
27  msvc-posix-compat
28  PUBLIC "-Wno-macro-redefined" "-Wno-deprecated-declarations" # A lot of the
29                                                               # POSIX names are
30                                                               # deprecated..
31)
32target_include_directories(msvc-posix-compat PUBLIC includes)
33
34if (ANDROID_EMULATOR_BUILD)
35  add_subdirectory(tests)
36endif()