Skip to content

Commit 1d9240c

Browse files
authored
[Buildbot][AMD] Make builder script to take argument (#491)
Updated the annotated builder so that it takes cmake filename as the argument. With the default value, this change should not disrupt current runs. We will make incremental changes in the next few PRs.
1 parent 1fdd123 commit 1d9240c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,21 @@
99
import tempfile
1010
from contextlib import contextmanager
1111

12+
def add_argument_parser():
13+
ap = argparse.ArgumentParser()
14+
15+
# Arugment for CMake file.
16+
default_cmake_file = "AMDGPUBot.cmake"
17+
ap.add_argument('--cmake-file', type=str, default=default_cmake_file,
18+
help=f'CMake file to use (default: {default_cmake_file})')
19+
20+
return ap
1221

1322
def main(argv):
23+
ap = add_argument_parser()
24+
args, _ = ap.parse_known_args()
25+
26+
cmake_file = args.cmake_file
1427
source_dir = os.path.join("..", "llvm-project")
1528
offload_base_dir = os.path.join(source_dir, "offload")
1629
of_cmake_cache_base_dir = os.path.join(offload_base_dir, "cmake/caches")
@@ -27,8 +40,7 @@ def main(argv):
2740
util.rmtree(tdir)
2841

2942
with step("cmake", halt_on_fail=True):
30-
# TODO make the name of the cache file an argument to the script.
31-
cmake_cache_file = os.path.join(of_cmake_cache_base_dir, "AMDGPUBot.cmake")
43+
cmake_cache_file = os.path.join(of_cmake_cache_base_dir, cmake_file)
3244

3345
# Use Ninja as the generator.
3446
# The other important settings alrady come from the CMake CMake

0 commit comments

Comments
 (0)