From 2cb89a9d32eeff163eeeb0e6f5b548e4dd260857 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Fri, 25 Jul 2025 15:00:56 +0200 Subject: [PATCH] wip: strip tool --- .docker/build-linux.sh | 1 + CMakeLists.txt | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.docker/build-linux.sh b/.docker/build-linux.sh index a8e8db26..12361138 100755 --- a/.docker/build-linux.sh +++ b/.docker/build-linux.sh @@ -295,6 +295,7 @@ if [[ "-$BUILD_TYPE-" == *-static-* ]]; then _TARGET="${_MARCH}-unknown-linux-musl" export CC="${_TARGET}-${CC}" export CXX="${_TARGET}-${CXX}" + export STRIP_TOOL="${_TARGET}-strip" export PATH="$_SYSROOT/usr/bin:$PATH" # if [[ "-$BUILD_TYPE-" == *-relsize-* ]]; then # _LIBSTDCXXDIR="/opt/static-libs/libstdc++-Os/lib" diff --git a/CMakeLists.txt b/CMakeLists.txt index e3bb11d9..64cf9f84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -999,7 +999,11 @@ if(STATIC_BUILD_DO_NOT_USE OR APPLE) if(APPLE) add_custom_target(strip COMMAND strip ${FILES_TO_STRIP}) else() - add_custom_target(strip COMMAND strip $,--strip-debug,--strip-all> ${FILES_TO_STRIP}) + set(STRIP_TOOL strip) + if(DEFINED ENV{STRIP_TOOL}) + set(STRIP_TOOL $ENV{STRIP_TOOL}) + endif() + add_custom_target(strip COMMAND ${STRIP_TOOL} $,--strip-debug,--strip-all> ${FILES_TO_STRIP}) endif() endif() endif()