Skip to content

Commit

Permalink
fix android build
Browse files Browse the repository at this point in the history
  • Loading branch information
trittsv committed Sep 2, 2024
1 parent 2f9a214 commit ddd2ab1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 5 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit ddd2ab1

Please sign in to comment.