Skip to content

Commit

Permalink
CMakelists.txt: add support for Android
Browse files Browse the repository at this point in the history
Android does not use discrete pthread library but it is
contained in the standard C library https://developer.android.com/ndk/guides/stable_apis#c_library

Signed-off-by: Adrian Suciu <[email protected]>
  • Loading branch information
adisuciu authored and pcercuei committed Aug 5, 2021
1 parent 02527e6 commit 5587c8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ endif()

option(NO_THREADS "Disable multi-threading support" OFF)
if (NEED_THREADS)
if (NOT NO_THREADS AND NOT WIN32)
if (NOT NO_THREADS AND NOT WIN32 AND NOT ANDROID)
find_library(PTHREAD_LIBRARIES pthread)

if (NOT PTHREAD_LIBRARIES)
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ target_link_libraries(iio_writedev iio iio_tests_helper)

set(IIO_TESTS_TARGETS iio_genxml iio_info iio_attr iio_readdev iio_reg iio_writedev)

if(PTHREAD_LIBRARIES)
if(PTHREAD_LIBRARIES OR ANDROID)
project(iio_adi_xflow_check C)
project(iio_stresstest C)
add_executable(iio_adi_xflow_check iio_adi_xflow_check.c)
Expand Down

0 comments on commit 5587c8e

Please sign in to comment.