From f6dda3d5548e5642624c1980c03f2a7ac59135d9 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 27 Oct 2019 12:55:48 -0700 Subject: [PATCH] Ensure we actually strip binaries as part of the release build process. --- CMakeLists.txt | 6 ++++++ strip-nix.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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