Improve Android cmake (#985)

* Update CMakeLists.txt

* Improve Andoid CMAKE
This commit is contained in:
CHP 2022-12-17 09:35:34 +01:00 committed by GitHub
parent 2f54ecaf6d
commit d79156d728
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 4 additions and 6 deletions

View File

@ -221,6 +221,10 @@ if(MSVC)
target_compile_options(${_AX_CORE_LIB} PUBLIC "/Zm2000")
endif()
if(ANDROID)
add_subdirectory(${_AX_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/cpp-android)
endif()
# copy all thirdparty libraries to ${CMAKE_BINARY_DIR}/lib/$<CONFIG>
# if (WINDOWS)
# copy_thirdparty_dlls(libcocos2d ${CMAKE_BINARY_DIR}/lib/$<CONFIG>)

View File

@ -155,7 +155,6 @@ if(NOT ANDROID)
else()
add_library(${APP_NAME} SHARED ${all_code_files})
# whole archive for jni
add_subdirectory(${_AX_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
config_android_shared_libs("org.axmol.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
endif()

View File

@ -161,7 +161,6 @@ else()
add_library(${APP_NAME} SHARED ${APP_SRC})
# whole archive for jni
add_subdirectory(${_AX_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
add_subdirectory(${_AX_ROOT_PATH}/extensions/scripting/lua-bindings/proj.android ${ENGINE_BINARY_PATH}/extensions/lua-android)
target_link_libraries(${APP_NAME} -Wl,--whole-archive lua_android_spec -Wl,--no-whole-archive)

View File

@ -554,7 +554,6 @@ else()
add_library(${APP_NAME} SHARED ${all_code_files})
# whole archive for jni
add_subdirectory(${_AX_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
config_android_shared_libs("org.axmol.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")

View File

@ -126,7 +126,6 @@ else()
add_library(${APP_NAME} SHARED ${all_code_files})
# whole archive for jni
add_subdirectory(${_AX_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
config_android_shared_libs("org.axmol.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")

View File

@ -134,7 +134,6 @@ if(NOT ANDROID)
else()
add_library(${APP_NAME} SHARED ${all_code_files})
# whole archive for jni
add_subdirectory(${_AX_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
config_android_shared_libs("org.axmol.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src")
endif()

View File

@ -126,7 +126,6 @@ else()
add_library(${APP_NAME} SHARED ${APP_SRC})
# whole-archive for jni
add_subdirectory(${_AX_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/cpp-android)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
add_subdirectory(${_AX_ROOT_PATH}/extensions/scripting/lua-bindings/proj.android ${ENGINE_BINARY_PATH}/extensions/lua-android)