Skip to content

Commit

Permalink
Refactor Android related CMake configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
esnosy authored and jcfr committed Jun 28, 2023
1 parent 5706ac4 commit 6d0d7c1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ if(UNIX)

# Makefile
set(MAKEFILE_LDSHARED_FLAGS "-shared")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(APPLE OR ANDROID)
set(MAKEFILE_LDSHARED_FLAGS "-dynamiclib -headerpad_max_install_names -undefined dynamic_lookup")
endif()
configure_file(cmake/makefile-variables.in
Expand Down
7 changes: 1 addition & 6 deletions cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ check_include_files(grp.h HAVE_GRP_H)
check_include_files(ieeefp.h HAVE_IEEEFP_H)
check_include_files(inttypes.h HAVE_INTTYPES_H) # libffi and cpython
check_include_files(io.h HAVE_IO_H)
if (${CMAKE_SYSTEM_NAME} MATCHES "^Android")
if (ANDROID)
set(HAVE_LANGINFO_H 0) # Android cann't link functions from langinfo.h
else()
check_include_files(langinfo.h HAVE_LANGINFO_H)
Expand Down Expand Up @@ -446,11 +446,6 @@ if((CMAKE_SYSTEM MATCHES "VxWorks\\-7$") OR ANDROID)
set(HAVE_LIBUTIL 0)
endif()

if(CMAKE_SYSTEM MATCHES "^Android")
set(LIBUTIL_EXPECTED 0)
set(HAVE_LIBUTIL 0)
endif()

if(LIBUTIL_EXPECTED)
check_function_exists("openpty" HAVE_BUILTIN_OPENPTY)
if(HAVE_BUILTIN_OPENPTY)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function(add_python_extension name)
)
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(APPLE OR ANDROID)
set_target_properties(${target_name} PROPERTIES
LINK_FLAGS -Wl,-undefined,dynamic_lookup
SUFFIX .so
Expand Down
2 changes: 1 addition & 1 deletion cmake/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ endif()

# Generate grammar tables in install directory
# XXX Should a custom target be added to generate file at built time ?
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "^Android")
if(NOT ANDROID)
install(CODE "find_program(
PYTHON_EXECUTABLE python
HINTS \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR}
Expand Down
2 changes: 1 addition & 1 deletion cmake/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if(WIN32)
)
endif()

if(UNIX AND PY_VERSION VERSION_GREATER "2.7.4" AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "^Android")
if(UNIX AND PY_VERSION VERSION_GREATER "2.7.4" AND NOT ANDROID)
# Setup landmark allowing to run the interpreter from a build tree. See 'getpath.c' for details.
set(_sysconfigdata_py "_sysconfigdata.py")
if("${PY_VERSION}" VERSION_GREATER_EQUAL "3.6.0")
Expand Down

0 comments on commit 6d0d7c1

Please sign in to comment.