From 111f6f84264e638afa58d50eb84d342b5e0390c4 Mon Sep 17 00:00:00 2001 From: amd-garydeng Date: Fri, 24 Jan 2025 11:01:11 -0700 Subject: [PATCH] add static cmake build option (#676) * add static cmake build option --- .jenkins/common.groovy | 5 +++-- .jenkins/static.groovy | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.jenkins/common.groovy b/.jenkins/common.groovy index d49a782dc..5e14bead7 100644 --- a/.jenkins/common.groovy +++ b/.jenkins/common.groovy @@ -1,11 +1,12 @@ // This file is for internal AMD use. // If you are interested in running your own Jenkins, please raise a github issue for assistance. -def runCompileCommand(platform, project, jobName, boolean debug=false) +def runCompileCommand(platform, project, jobName, boolean debug=false, boolean staticLibrary=false) { project.paths.construct_build_prefix() String buildTypeArg = debug ? '-DCMAKE_BUILD_TYPE=Debug' : '-DCMAKE_BUILD_TYPE=Release' + String buildStatic = staticLibrary ? '-DBUILD_SHARED_LIBS=OFF' : '-DBUILD_SHARED_LIBS=ON' String buildTypeDir = debug ? 'debug' : 'release' String cmake = platform.jenkinsLabel.contains('centos') ? 'cmake3' : 'cmake' //Set CI node's gfx arch as target if PR, otherwise use default targets of the library @@ -16,7 +17,7 @@ def runCompileCommand(platform, project, jobName, boolean debug=false) cd ${project.paths.project_build_prefix} mkdir -p build/${buildTypeDir} && cd build/${buildTypeDir} ${auxiliary.gfxTargetParser()} - ${cmake} --toolchain=toolchain-linux.cmake ${buildTypeArg} ${amdgpuTargets} -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON ../.. + ${cmake} --toolchain=toolchain-linux.cmake ${buildTypeArg} ${buildStatic} ${amdgpuTargets} -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON ../.. make -j\$(nproc) """ diff --git a/.jenkins/static.groovy b/.jenkins/static.groovy index 9466b27f1..75606419f 100644 --- a/.jenkins/static.groovy +++ b/.jenkins/static.groovy @@ -24,7 +24,7 @@ def runCI = platform, project-> commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy" - commonGroovy.runCompileCommand(platform, project, jobName) + commonGroovy.runCompileCommand(platform, project, jobName, debug=false, staticLibrary=true) } def testCommand =