solve auto link .so for android platform

This commit is contained in:
halx99 2020-02-03 21:18:23 +08:00
parent 6f4b1f4d9e
commit a350f4be88
4 changed files with 15 additions and 0 deletions

View File

@ -124,6 +124,9 @@ else()
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
target_link_libraries(${APP_NAME} -Wl,--whole-archive ext_ogg ext_vorbis ext_ssl ext_crypto -Wl,--no-whole-archive)
configure_file(${OPENAL_SO_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src/main/jniLibs/${ANDROID_ABI}/ COPYONLY)
configure_file(${MPG123_SO_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src/main/jniLibs/${ANDROID_ABI}/ COPYONLY)
endif()
target_link_libraries(${APP_NAME} cocos2d)

View File

@ -389,6 +389,9 @@ else()
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
target_link_libraries(${APP_NAME} -Wl,--whole-archive ext_ogg ext_vorbis ext_ssl ext_crypto -Wl,--no-whole-archive)
configure_file(${OPENAL_SO_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src/main/jniLibs/${ANDROID_ABI}/ COPYONLY)
configure_file(${MPG123_SO_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src/main/jniLibs/${ANDROID_ABI}/ COPYONLY)
endif()
target_link_libraries(${APP_NAME} cocos2d)

View File

@ -96,6 +96,10 @@ else()
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/scripting/lua-bindings/proj.android ${ENGINE_BINARY_PATH}/cocos/lua-android)
target_link_libraries(${APP_NAME} -Wl,--whole-archive lua_android_spec -Wl,--no-whole-archive)
target_link_libraries(${APP_NAME} -Wl,--whole-archive ext_ogg ext_vorbis ext_ssl ext_crypto -Wl,--no-whole-archive)
configure_file(${OPENAL_SO_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src/main/jniLibs/${ANDROID_ABI}/ COPYONLY)
configure_file(${MPG123_SO_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src/main/jniLibs/${ANDROID_ABI}/ COPYONLY)
endif()
target_link_libraries(${APP_NAME} luacocos2d)

View File

@ -110,6 +110,11 @@ else()
else()
target_link_libraries(${APP_NAME} -Wl,--whole-archive lua_android_spec -Wl,--no-whole-archive)
endif()
target_link_libraries(${APP_NAME} -Wl,--whole-archive ext_ogg ext_vorbis ext_ssl ext_crypto -Wl,--no-whole-archive)
configure_file(${OPENAL_SO_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src/main/jniLibs/${ANDROID_ABI}/ COPYONLY)
configure_file(${MPG123_SO_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src/main/jniLibs/${ANDROID_ABI}/ COPYONLY)
endif()
target_link_libraries(${APP_NAME} luacocos2d)
target_include_directories(${APP_NAME} PRIVATE Classes)