[PATCH 2 of 3] Strip created executables

Wald Commits scm-commit at wald.intevation.org
Tue Sep 2 16:03:50 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1409666620 -7200
# Node ID 4f999c7821ce65f5482b44e12d18da44d6994dd8
# Parent  86181a99da7669ed47ec5650bed13951a3e3c8dd
Strip created executables

diff -r 86181a99da76 -r 4f999c7821ce INSTALL
--- a/INSTALL	Tue Sep 02 15:41:40 2014 +0200
+++ b/INSTALL	Tue Sep 02 16:03:40 2014 +0200
@@ -228,6 +228,10 @@
     make qtbase
 (optional) make curl
 
+Add CMAKE_STRIP to the toolchain file:
+    echo "set(CMAKE_STRIP $MXEPATH/usr/bin/i686-w64-mingw32.static-strip)" >> \
+        "$MXEPATH/usr/i686-w64-mingw32.static/share/cmake/mxe-conf.cmake"
+
 Workaround Qt CMake Bugs:
     find $MXEPATH/usr/i686-w64-mingw32.static/qt5/lib/cmake -name \*.cmake | \
         xargs sed -i 's/\/\([a-z]*\)\.lib/\/lib\1\.a/g'
diff -r 86181a99da76 -r 4f999c7821ce cinst/CMakeLists.txt
--- a/cinst/CMakeLists.txt	Tue Sep 02 15:41:40 2014 +0200
+++ b/cinst/CMakeLists.txt	Tue Sep 02 16:03:40 2014 +0200
@@ -30,6 +30,19 @@
    ${WIN_EXTRA_LIBS})
 
 install(TARGETS cinst DESTINATION bin)
+if (WIN32)
+   add_custom_command(
+      TARGET cinst
+      POST_BUILD
+      COMMAND ${CMAKE_STRIP} cinst.exe
+   )
+else()
+   add_custom_command(
+      TARGET cinst
+      POST_BUILD
+      COMMAND strip cinst
+   )
+endif()
 
 # ----------------------------------------------------------------------
 # Mozilla nss store specific certificate installer:
@@ -48,6 +61,20 @@
       ${PROFILING_LIBS})
    set_target_properties(mozilla PROPERTIES COMPILE_FLAGS "-std=c99")
    install(TARGETS mozilla DESTINATION bin)
+
+   if (WIN32)
+      add_custom_command(
+         TARGET mozilla
+         POST_BUILD
+         COMMAND ${CMAKE_STRIP} mozilla.exe
+      )
+   else()
+      add_custom_command(
+         TARGET mozilla
+         POST_BUILD
+         COMMAND strip mozilla
+      )
+   endif()
 else()
    message(STATUS "WARNING: Could not find nss. Mozilla cert installer will not be build!")
 endif()
diff -r 86181a99da76 -r 4f999c7821ce ui/CMakeLists.txt
--- a/ui/CMakeLists.txt	Tue Sep 02 15:41:40 2014 +0200
+++ b/ui/CMakeLists.txt	Tue Sep 02 16:03:40 2014 +0200
@@ -223,3 +223,28 @@
   configure_file(trustbridge-tray-starter.sh trustbridge-tray-starter.sh COPYONLY)
   install(FILES trustbridge-tray-starter.sh DESTINATION bin)
 endif()
+
+# Strip the binaries
+if (WIN32)
+   add_custom_command(
+      TARGET trustbridge
+      POST_BUILD
+      COMMAND ${CMAKE_STRIP} trustbridge.exe
+   )
+   add_custom_command(
+      TARGET trustbridge-admin
+      POST_BUILD
+      COMMAND ${CMAKE_STRIP} trustbridge-admin.exe
+   )
+else()
+   add_custom_command(
+      TARGET trustbridge
+      POST_BUILD
+      COMMAND strip trustbridge
+   )
+   add_custom_command(
+      TARGET trustbridge-admin
+      POST_BUILD
+      COMMAND ${CMAKE_STRIP} trustbridge-admin
+   )
+endif()


More information about the Trustbridge-commits mailing list