From 1a09599b6ef250ebfca2c11c12c5e7473c7d415a Mon Sep 17 00:00:00 2001 From: johnche Date: Fri, 25 Oct 2024 16:05:45 +0800 Subject: [PATCH] =?UTF-8?q?[unity]android=E4=B8=8D=E4=BF=9D=E7=95=99?= =?UTF-8?q?=E5=89=AA=E8=A3=81=E5=92=8C=E9=9D=9E=E5=89=AA=E8=A3=81=E7=89=88?= =?UTF-8?q?=E6=9C=AC=EF=BC=8C=E8=80=8C=E4=B8=94=E4=B8=8D=E9=80=9A=E8=BF=87?= =?UTF-8?q?strip=E5=91=BD=E4=BB=A4=E5=89=AA=E8=A3=81=EF=BC=8C=E9=80=9A?= =?UTF-8?q?=E8=BF=87-s=E9=93=BE=E6=8E=A5=E5=8F=82=E6=95=B0=E6=95=88?= =?UTF-8?q?=E6=9E=9C=E6=9B=B4=E5=A5=BD=EF=BC=8820M+=20->=2015M+=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unity/cli/make.mjs | 6 +++--- unity/native_src/CMakeLists.txt | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/unity/cli/make.mjs b/unity/cli/make.mjs index 0640bfe0d5..bd27f68de6 100644 --- a/unity/cli/make.mjs +++ b/unity/cli/make.mjs @@ -25,7 +25,7 @@ const platformCompileConfig = { if (existsSync(`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.a`)) return [`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.a`]; else - return [`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.so`, `${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.stripped.so~`]; + return [`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.so`]; } }, 'arm64': { @@ -42,7 +42,7 @@ const platformCompileConfig = { if (existsSync(`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.a`)) return [`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.a`]; else - return [`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.so`, `${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.stripped.so~`]; + return [`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.so`]; } }, 'x64': { @@ -59,7 +59,7 @@ const platformCompileConfig = { if (existsSync(`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.a`)) return [`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.a`]; else - return [`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.so`, `${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.stripped.so~`]; + return [`${CMAKE_BUILD_PATH}/lib${cmakeAddedLibraryName}.so`]; } } }, diff --git a/unity/native_src/CMakeLists.txt b/unity/native_src/CMakeLists.txt index 73cf00613d..aa272b990f 100644 --- a/unity/native_src/CMakeLists.txt +++ b/unity/native_src/CMakeLists.txt @@ -373,15 +373,16 @@ elseif ( ANDROID ) list(APPEND PUERTS_COMPILE_DEFINITIONS PLATFORM_ANDROID_x64) endif () + + target_link_options(puerts PRIVATE -s) #set_target_properties( puerts PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/android_version.script) #set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/android_version.script") #set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections") - add_custom_command(TARGET puerts POST_BUILD - COMMAND "${ANDROID_TOOLCHAIN_PREFIX}strip" -g -S -d --strip-debug --verbose - "${CMAKE_BINARY_DIR}/libpuerts.so" -o - "${CMAKE_BINARY_DIR}/libpuerts.stripped.so~" - COMMENT "Strip debug symbols done on final binary.") + #add_custom_command(TARGET puerts POST_BUILD + # COMMAND "${ANDROID_TOOLCHAIN_PREFIX}strip" -g -S -d --strip-debug --verbose + # "${CMAKE_BINARY_DIR}/libpuerts.so" + # COMMENT "Strip debug symbols done on final binary.") elseif ( APPLE )