diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index e3ba4b8b9a..5626e7852e 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -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/$ # if (WINDOWS) # copy_thirdparty_dlls(libcocos2d ${CMAKE_BINARY_DIR}/lib/$) diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index 32fd981038..8a4a69fb27 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -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() diff --git a/templates/lua-template-default/CMakeLists.txt b/templates/lua-template-default/CMakeLists.txt index 65ebe5fe59..bf93f1fbfd 100644 --- a/templates/lua-template-default/CMakeLists.txt +++ b/templates/lua-template-default/CMakeLists.txt @@ -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) diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index 7480693d53..d9ef106c40 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -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") diff --git a/tests/fairygui-tests/CMakeLists.txt b/tests/fairygui-tests/CMakeLists.txt index 2b828c0c89..4e2469e8e3 100644 --- a/tests/fairygui-tests/CMakeLists.txt +++ b/tests/fairygui-tests/CMakeLists.txt @@ -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") diff --git a/tests/live2d-tests/CMakeLists.txt b/tests/live2d-tests/CMakeLists.txt index e4debb77a2..ea5a775363 100644 --- a/tests/live2d-tests/CMakeLists.txt +++ b/tests/live2d-tests/CMakeLists.txt @@ -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() diff --git a/tests/lua-tests/project/CMakeLists.txt b/tests/lua-tests/project/CMakeLists.txt index 6332469c3f..86cc657f52 100644 --- a/tests/lua-tests/project/CMakeLists.txt +++ b/tests/lua-tests/project/CMakeLists.txt @@ -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)