Android/CMakeLists: Remove usages of LIBS and SRCS variables

Instead, operate on the target itself.
This commit is contained in:
Lioncash 2018-04-02 12:47:26 -04:00
parent 4331f80489
commit 21ee216e63
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
1 changed files with 17 additions and 13 deletions

View File

@ -1,17 +1,21 @@
list(APPEND LIBS core uicommon)
add_library(main SHARED
ButtonManager.cpp
MainAndroid.cpp
)
set(SRCS ButtonManager.cpp
MainAndroid.cpp)
target_link_libraries(main
PRIVATE
core
uicommon
)
set(SHARED_LIB main)
add_library(${SHARED_LIB} SHARED ${SRCS})
target_link_libraries(${SHARED_LIB}
log
android
"-Wl,--no-warn-mismatch"
"-Wl,--whole-archive"
${LIBS}
"-Wl,--no-whole-archive"
target_link_libraries(main
PRIVATE
android
log
"-Wl,--no-warn-mismatch"
"-Wl,--whole-archive"
"-Wl,--no-whole-archive"
)
file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/)
@ -19,4 +23,4 @@ file(REMOVE_RECURSE ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/Sys/)
file(COPY ${CMAKE_SOURCE_DIR}/Data/Sys DESTINATION ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/)
file(REMOVE_RECURSE ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/Sys/Resources/) # not used on Android
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${SHARED_LIB})
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} main)