How to link Photon lib with Android project use Cmake?

I just upgrade cocos2dx to version 3.17.1 and use Cmake build game.
All is ok, except Photon lib.
I'm a newbie in cmake's world.

A part of CMakeLists.txt:
project(${APP_NAME})
set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs/cocos)
set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/platform)
add_library(${APP_NAME} SHARED ${all_code_files})
target_include_directories(${APP_NAME} PRIVATE ${GAME_INC})
link_directories(LIB_LINK)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
target_link_libraries(${APP_NAME} cocos2d)
setup_cocos_app_config(${APP_NAME})

When I try "target_link_libraries" to photon, I get error: undefined reference to 'std::ios_base::Init::Init()'

Can anyone help me?
Sorry for my English. Thanks!

Comments

Sign In or Register to comment.