CMakeLists.txt: Always strip executables when the build type is release
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
da3af239c9
commit
44d4ffb2ee
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue