From a741422dbc6c7bac0854e2be4b6a5ddaac776956 Mon Sep 17 00:00:00 2001 From: Username404 Date: Sat, 11 Jun 2022 16:31:56 +0200 Subject: [PATCH] Jenkinsfile: Add a "build_directory" local variable Signed-off-by: Username404 --- Jenkinsfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a23a1f5..dcf395c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,13 +5,14 @@ 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 build_directory = "cmake-build-${packageArch}${suffix}" // Note: CMake 3.20 or higher is needed - cmakeBuild buildDir: "cmake-build-${packageArch}${suffix}", buildType: 'release', cleanBuild: true, installation: 'Latest', + 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 -DIGNORE_MINIMAL_COMPILER_VERSION=ON ${no_compilation_cache_flags()}", generator: cmake_generator() - cmake arguments: "--build ./cmake-build-${packageArch}${suffix} --target ybcon", installation: 'Latest' - sh "/usr/bin/${path}-strip -s ./cmake-build-${packageArch}${suffix}/ybcon*" - cpack installation: 'Latest', workingDir: "cmake-build-${packageArch}${suffix}" + cmake arguments: "--build ./$build_directory --target ybcon", installation: 'Latest' + sh "/usr/bin/${path}-strip -s ./$build_directory/ybcon*" + cpack installation: 'Latest', workingDir: build_directory } final String windowsSuffix = '-windows'