From ddd2ab1fdf14f41609b1737248df83a7c48d1929 Mon Sep 17 00:00:00 2001 From: Sven Trittler Date: Mon, 2 Sep 2024 21:58:35 +0200 Subject: [PATCH] fix android build --- CMakeLists.txt | 11 ++++++----- tests/CMakeLists.txt | 7 +++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68524e45..59b8af3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,14 +235,15 @@ else() # CYGWIN, MSYS, and MINGW seem to be needing this but in some cases # it might be that the toolset is not properly set, so also use this # in cases where we are not sure that it is not needed - if((NOT MSVC AND NOT LINUX AND NOT APPLE) OR (CYGWIN OR MSYS OR MINGW)) + if((NOT MSVC AND NOT LINUX AND NOT APPLE AND NOT ANDROID) OR (CYGWIN OR MSYS OR MINGW)) set(CMAKE_C_FLAGS "-Wa,-muse-unaligned-vector-move ${CMAKE_C_FLAGS}") endif() - - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads REQUIRED) - target_link_libraries(kvazaar PUBLIC Threads::Threads) + if(NOT ANDROID) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) + target_link_libraries(kvazaar PUBLIC Threads::Threads) + endif() include(CheckLibraryExists) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4ff37557..2d386f02 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,8 +25,11 @@ else() if(${CMAKE_SYSTEM_PROCESSOR} IN_LIST ALLOW_AVX2) set_property( SOURCE ${TEST_SOURCES} APPEND PROPERTY COMPILE_FLAGS "-mavx2 -mbmi -mpopcnt -mlzcnt -mbmi2" ) endif() - find_package(Threads REQUIRED) - target_link_libraries(kvazaar_tests PUBLIC Threads::Threads) + + if(NOT ANDROID) + find_package(Threads REQUIRED) + target_link_libraries(kvazaar_tests PUBLIC Threads::Threads) + endif() include(CheckLibraryExists)