Skip to content

Commit

Permalink
CMake: Fix Android dependencies. Depends on "log" and pixman depends …
Browse files Browse the repository at this point in the history
…on "cpufeatures"
  • Loading branch information
Ghabry committed Jan 14, 2021
1 parent a6cdb99 commit 1b43992
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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

0 comments on commit 1b43992

Please sign in to comment.