Skip to content

Commit

Permalink
CMake: Don't link to pthread on Android
Browse files Browse the repository at this point in the history
On Android pthread functionality is built into the C library and linking
to pthread is not only needed but results in link failures.
  • Loading branch information
p12tic committed Sep 20, 2022
1 parent 514a164 commit cd61761
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions cmake/platforms/Android-aarch64-clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ add_flags(CMAKE_EXE_LINKER_FLAGS ${ARCH_FLAGS} -pie)
# deactivated for now: I added bound checking in VOR::vector<>.
#add_flags(CMAKE_CXX_FLAGS_DEBUG -D_GLIBCXX_DEBUG)

# Compile and link with pthreads
add_flags(CMAKE_CXX_FLAGS -pthread)
add_flags(CMAKE_C_FLAGS -pthread)

# Profiler compilation flags
if(VORPALINE_WITH_GPROF)
message(STATUS "Building for code profiling")
Expand Down
6 changes: 5 additions & 1 deletion src/lib/geogram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ set_target_properties(geogram PROPERTIES
FOLDER "GEOGRAM")

if(UNIX AND VORPALINE_BUILD_DYNAMIC)
target_link_libraries(geogram pthread dl)
if (ANDROID)
target_link_libraries(geogram dl)
else()
target_link_libraries(geogram pthread dl)
endif()
endif()

if(WIN32)
Expand Down

0 comments on commit cd61761

Please sign in to comment.