Skip to content

Commit

Permalink
add static cmake build option (#676)
Browse files Browse the repository at this point in the history
* add static cmake build option
  • Loading branch information
amd-garydeng authored Jan 24, 2025
1 parent 99f1f60 commit 111f6f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .jenkins/common.groovy
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
"""

Expand Down
2 changes: 1 addition & 1 deletion .jenkins/static.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 111f6f8

Please sign in to comment.