Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More cmake fixes #2400

Merged
merged 10 commits into from
Jan 24, 2021
Prev Previous commit
Next Next commit
CMake: Fix Android dependencies. Depends on "log" and pixman depends …
…on "cpufeatures"
  • Loading branch information
Ghabry committed Jan 14, 2021
commit 1b43992363e6cbe64feba6a0b5e661311e9e621a
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ if(NOT PLAYER_BUILD_EXECUTABLE AND BUILD_SHARED_LIBS)
set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()

if(ANDROID)
target_link_libraries(${PROJECT_NAME} log)
endif()

if(WIN32)
target_sources(${PROJECT_NAME} PRIVATE
src/registry.cpp
Expand Down
12 changes: 12 additions & 0 deletions builds/cmake/Modules/FindPixman.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Pixman
REQUIRED_VARS PIXMAN_LIBRARY PIXMAN_INCLUDE_DIR)

if(ANDROID)
enable_language(C)
# armeabi-v7a requires this
add_library(cpufeatures STATIC
${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c)
endif()

if(PIXMAN_FOUND)
set(PIXMAN_INCLUDE_DIRS ${PIXMAN_INCLUDE_DIR})

Expand Down Expand Up @@ -83,6 +90,11 @@ if(PIXMAN_FOUND)
set_property(TARGET PIXMAN::PIXMAN APPEND PROPERTY
IMPORTED_LOCATION "${PIXMAN_LIBRARY}")
endif()

if(ANDROID)
set_property(TARGET PIXMAN::PIXMAN APPEND PROPERTY
INTERFACE_LINK_LIBRARIES cpufeatures)
endif()
endif()
endif()

Expand Down