Skip to content

Commit

Permalink
Merge pull request #415 from trittsv/fix-android-build
Browse files Browse the repository at this point in the history
fix android build
  • Loading branch information
fador authored Sep 6, 2024
2 parents 7e4447f + ddd2ab1 commit 6b7f065
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 @@ -241,14 +241,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 6b7f065

Please sign in to comment.