Skip to content

Commit 96ae05d

Browse files
PatriceJiangminggo
authored andcommitted
[bugfix] Android compile error on arm64 (#20128)
* add --no-warn-shared-textrel only in android/x86 * update comment position
1 parent f3b0956 commit 96ae05d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/lua-tests/project/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,12 @@ else()
9898
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/cpp-android)
9999
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
100100
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/scripting/lua-bindings/proj.android ${ENGINE_BINARY_PATH}/cocos/lua-android)
101-
#add `-Wl,--no-warn-shared-textrel` to fix warning "shared library text segment is not shareable clang"
102-
target_link_libraries(${APP_NAME} -Wl,--whole-archive lua_android_spec -Wl,--no-whole-archive -Wl,--no-warn-shared-textrel)
101+
if(${CMAKE_ANDROID_ARCH_ABI} STREQUAL "x86")
102+
#add `-Wl,--no-warn-shared-textrel` to fix warning "shared library text segment is not shareable clang"
103+
target_link_libraries(${APP_NAME} -Wl,--whole-archive lua_android_spec -Wl,--no-whole-archive -Wl,--no-warn-shared-textrel)
104+
else()
105+
target_link_libraries(${APP_NAME} -Wl,--whole-archive lua_android_spec -Wl,--no-whole-archive)
106+
endif()
103107
endif()
104108
target_link_libraries(${APP_NAME} luacocos2d)
105109
target_include_directories(${APP_NAME} PRIVATE Classes)

0 commit comments

Comments
 (0)