From 00d930199fbc4c42cb1767806992aa96af5d5683 Mon Sep 17 00:00:00 2001 From: Lorenzo Fontana Date: Wed, 2 Sep 2020 14:29:14 +0200 Subject: [PATCH] build: strip userspace/falco/falco in release when building with musl optimizations Co-Authored-By: Leonardo Grasso Signed-off-by: Lorenzo Fontana --- userspace/falco/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/userspace/falco/CMakeLists.txt b/userspace/falco/CMakeLists.txt index 162820b4..f60c403f 100644 --- a/userspace/falco/CMakeLists.txt +++ b/userspace/falco/CMakeLists.txt @@ -141,6 +141,15 @@ add_custom_command( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Comparing engine fields checksum in falco_engine.h to actual fields") +# strip the Falco binary when releasing using musl +if(MUSL_OPTIMIZED_BUILD AND CMAKE_BUILD_TYPE STREQUAL "release") + add_custom_command( + TARGET falco + POST_BUILD + COMMAND ${CMAKE_STRIP} --strip-unneeded falco + COMMENT "Strip the Falco binary when releasing the musl build") +endif() + # add_custom_target(verify_engine_fields DEPENDS verify_engine_fields.sh falco_engine.h) # add_dependencies(verify_engine_fields falco)