Fixed bug where out of source tree builds were not getting stripped

properly.
This commit is contained in:
casey langen 2020-05-24 14:13:32 -07:00
parent 6906826d52
commit 836120f029
2 changed files with 12 additions and 5 deletions

View File

@ -374,8 +374,8 @@ add_custom_command(TARGET postbuild POST_BUILD COMMAND cmake .)
# strip binaries in release mode
if (CMAKE_BUILD_TYPE MATCHES Release)
if ((NOT DEFINED DISABLE_STRIP) OR (NOT ${DISABLE_STRIP} MATCHES "true"))
message(STATUS "[build] binary stripping enabled")
add_custom_command(TARGET postbuild POST_BUILD COMMAND "${CMAKE_SOURCE_DIR}/strip-nix.sh")
message(STATUS "[build] binary stripping enabled for ${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_command(TARGET postbuild POST_BUILD COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/strip-nix.sh" ${CMAKE_CURRENT_SOURCE_DIR})
else()
message(STATUS "[build] DISABLE_STRIP=true, *NOT* stripping binaries.")
endif()

View File

@ -1,4 +1,11 @@
#!/bin/sh
strip ./bin/musikcube
strip ./bin/musikcubed
find ./bin/ -name "*.so" -exec strip "{}" \; 2> /dev/null
DIR=$1
if [ -z "$DIR" ]; then
echo "[strip] directory not specified, using current working directory"
DIR=`pwd`
fi
echo "[strip] resolved directory: ${DIR}"
strip "$DIR/bin/musikcube"
strip "$DIR/bin/musikcubed"
find "$DIR/bin/" -name "*.so" -exec strip "{}" \; 2> /dev/null
echo "[strip] finished"