Skip to content

Commit

Permalink
Merge pull request #18 from p12tic/build-android
Browse files Browse the repository at this point in the history
CMake: Fix build on Android NDK
  • Loading branch information
BrunoLevy authored Sep 24, 2022
2 parents 5064865 + cd61761 commit 336a33c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 0 additions & 8 deletions cmake/platforms/Android-aarch64-clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

include(${GEOGRAM_SOURCE_DIR}/cmake/platforms/Linux.cmake)

# Set the Android compilers
set(CMAKE_CXX_COMPILER aarch64-linux-android-clang++)
set(CMAKE_C_COMPILER aarch64-linux-android-clang)

set(VORPALINE_ARCH_64 true)

# No graphics (yet) for Android
Expand Down Expand Up @@ -54,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 336a33c

Please sign in to comment.