From 44d4ffb2ee74bc23a2def8a9bb97ee3378f915e3 Mon Sep 17 00:00:00 2001 From: Username404 Date: Tue, 2 Aug 2022 19:53:14 +0200 Subject: [PATCH] CMakeLists.txt: Always strip executables when the build type is release Signed-off-by: Username404 --- CMakeLists.txt | 2 +- Jenkinsfile | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd3873e..9a647c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ if (${IS_GNU} OR ${IS_CLANG}) endif() endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstrict-enums -pipe -funwind-tables -fasynchronous-unwind-tables -frtti -fexceptions") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections -fmerge-all-constants -ftree-vectorize -fno-math-errno") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections -fmerge-all-constants -ftree-vectorize -fno-math-errno -s") include(CheckCXXCompilerFlag) set(CF_PROTECTION "-fcf-protection") check_cxx_compiler_flag("${CF_PROTECTION}" CF_PROTECTION_SUPPORTED) diff --git a/Jenkinsfile b/Jenkinsfile index c2b219f..0ef62f7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,6 @@ def buildTarget(String path, String rpmArch = 'noarch', String debArch = 'noarch final String packageArch = isPackageArchDeb ? debArch : rpmArch; final String system_name = !path.contains('mingw') ? sh(returnStdout: true, script: 'uname -s').trim() : 'Windows' final String linker = "/usr/bin/${path}-ld" - final String strip = "/usr/bin/${path}-strip" final String build_directory = "cmake-build-${packageArch}${suffix}" final boolean upx_exists = fileExists('/usr/bin/upx') final boolean is_riscv = path.contains('riscv') @@ -14,9 +13,6 @@ def buildTarget(String path, String rpmArch = 'noarch', String debArch = 'noarch cmakeArgs: "--no-warn-unused-cli -DCMAKE_SYSTEM_NAME=\"${system_name}\" -DCMAKE_C_COMPILER=/usr/bin/${path}-gcc -DCMAKE_CXX_COMPILER=/usr/bin/${path}-g++ -DCMAKE_LINKER=${fileExists("${linker}.gold") ? "${linker}.gold" : linker} -DCMAKE_AR=/usr/bin/${path}-ar -DCMAKE_RC_COMPILER=/usr/bin/${path}-windres -DCPACK_RPM_PACKAGE_ARCHITECTURE=${rpmArch} -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=${debArch} -DCXX_TARGET=${packageArch} -DCMAKE_EXE_LINKER_FLAGS=-static -DNO_SELF_PACKER=ON -DIGNORE_MINIMAL_COMPILER_VERSION=ON ${no_compilation_cache_flags()}", generator: cmake_generator() cmake arguments: "--build ./$build_directory --target ybcon", installation: 'Latest' - if (fileExists(strip)) { - sh "$strip -s ./$build_directory/ybcon*" - } cpack installation: 'Latest', workingDir: build_directory }