diff --git a/CMakeLists.txt b/CMakeLists.txt index 4817bf225..cb1dd09a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -328,3 +328,9 @@ endif() # they don't yet exist! add_custom_target(postbuild ALL DEPENDS musikcube musikcubed) add_custom_command(TARGET postbuild POST_BUILD COMMAND cmake .) + +# strip binaries in release mode +if (CMAKE_BUILD_TYPE MATCHES Release) + message(STATUS "stripping binaries...") + add_custom_command(TARGET postbuild POST_BUILD COMMAND ./strip-nix.sh) +endif() diff --git a/strip-nix.sh b/strip-nix.sh index 0f890bd8a..69abe000a 100755 --- a/strip-nix.sh +++ b/strip-nix.sh @@ -1,4 +1,4 @@ #!/bin/sh strip ./bin/musikcube strip ./bin/musikcubed -find . -name "*.so" -exec strip "{}" \; 2> /dev/null +find ./bin/ -name "*.so" -exec strip "{}" \; 2> /dev/null