diff --git a/CMakeLists.txt b/CMakeLists.txt index 54cbb2429..5933df708 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/strip-nix.sh b/strip-nix.sh index 69abe000a..aa4ea62e5 100755 --- a/strip-nix.sh +++ b/strip-nix.sh @@ -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"