Jenkinsfile: Set NO_SELF_PACKER to ON when upx does not exist in the /usr/bin directory
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
84add6cbde
commit
f391b637a9
|
@ -6,12 +6,13 @@ def buildTarget(String path, String rpmArch = 'noarch', String debArch = 'noarch
|
|||
final String system_name = !path.contains('mingw') ? sh(returnStdout: true, script: 'uname -s').trim() : 'Windows'
|
||||
final String linker = "/usr/bin/${path}-ld"
|
||||
final String build_directory = "cmake-build-${packageArch}${suffix}"
|
||||
final boolean upx_exists = fileExists('/usr/bin/upx')
|
||||
// Note: CMake 3.20 or higher is needed
|
||||
cmakeBuild buildDir: build_directory, buildType: 'release', cleanBuild: true, installation: 'Latest',
|
||||
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=${path.contains('riscv') ? 'ON' : 'OFF'} -DIGNORE_MINIMAL_COMPILER_VERSION=ON -DCPACK_STRIP_FILES=FALSE ${no_compilation_cache_flags()}",
|
||||
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=${!upx_exists || path.contains('riscv') ? 'ON' : 'OFF'} -DIGNORE_MINIMAL_COMPILER_VERSION=ON -DCPACK_STRIP_FILES=FALSE ${no_compilation_cache_flags()}",
|
||||
generator: cmake_generator()
|
||||
cmake arguments: "--build ./$build_directory --target ybcon", installation: 'Latest'
|
||||
if (!fileExists('/usr/bin/upx')) {
|
||||
if (!upx_exists) {
|
||||
sh "/usr/bin/${path}-strip -s ./$build_directory/ybcon*"
|
||||
}
|
||||
cpack installation: 'Latest', workingDir: build_directory
|
||||
|
|
Loading…
Reference in New Issue