diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b4ced226..2a3900ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -575,12 +575,22 @@ if(NOT WIN32) message(FATAL_ERROR "PThreads is required for non-Windows builds!") endif() - check_c_compiler_flag(-pthread HAVE_PTHREAD) - if(HAVE_PTHREAD) - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -pthread") - set(C_FLAGS ${C_FLAGS} -pthread) - set(LINKER_FLAGS ${LINKER_FLAGS} -pthread) - endif() + CHECK_C_COMPILER_FLAG(-pthread HAVE_PTHREAD) + IF(NOT HAVE_ANDROID_H) + IF(HAVE_PTHREAD) + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -pthread") + SET(C_FLAGS ${C_FLAGS} -pthread) + SET(LINKER_FLAGS ${LINKER_FLAGS} -pthread) + ENDIF() + + CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_LIBPTHREAD) + IF(HAVE_LIBPTHREAD) + SET(EXTRA_LIBS pthread ${EXTRA_LIBS}) + ENDIF() + ELSE() + # FIXME: Android has pthread in it's bionic libc! + CHECK_LIBRARY_EXISTS(c pthread_create "" HAVE_LIBPTHREAD) + ENDIF() check_symbol_exists(pthread_setschedparam pthread.h HAVE_PTHREAD_SETSCHEDPARAM) @@ -1257,6 +1267,7 @@ else() "${OpenAL_BINARY_DIR}/version.h") endif() +IF(NOT CMAKE_CROSSCOMPILING) option(ALSOFT_EMBED_HRTF_DATA "Embed the HRTF data files (increases library footprint)" ON) if(ALSOFT_EMBED_HRTF_DATA) @@ -1294,6 +1305,8 @@ if(ALSOFT_UTILS OR ALSOFT_EXAMPLES) endif() endif() +ENDIF() # (NOT CMAKE_CROSSCOMPILING) + if(NOT WIN32) set(LIBNAME "openal") else() |