|
30 | 30 | die, |
31 | 31 | github_log_group, |
32 | 32 | is_macos, |
33 | | - load_config, |
34 | 33 | subprocess_with_capture, |
35 | 34 | subprocess_with_log, |
36 | 35 | upload_file, |
@@ -67,16 +66,29 @@ def main(): |
67 | 66 |
|
68 | 67 | cleanup_previous_build() |
69 | 68 |
|
70 | | - # Load CMake options from .github/workflows/root-ci-config/buildconfig/[platform].txt |
71 | 69 | this_script_dir = os.path.dirname(os.path.abspath(__file__)) |
72 | 70 |
|
73 | | - options_dict = { |
74 | | - **load_config(f'{this_script_dir}/buildconfig/global.txt'), |
75 | | - # file below overwrites values from above |
76 | | - **load_config(f'{this_script_dir}/buildconfig/{args.platform}.txt') |
77 | | - } |
| 71 | + # Compute CMake build options: |
| 72 | + # - Get global options |
| 73 | + # - Override with options from .github/workflows/root-ci-config/buildconfig/[platform].txt |
| 74 | + # - Apply overrides from command line if necessary |
| 75 | + options_dict = build_utils.load_config(f"{this_script_dir}/buildconfig/global.txt") |
| 76 | + last_options = dict(options_dict) |
| 77 | + |
| 78 | + options_dict.update(build_utils.load_config(f"{this_script_dir}/buildconfig/{args.platform}.txt")) |
| 79 | + print(f"Build option overrides for {args.platform}:") |
| 80 | + build_utils.print_options_diff(options_dict, last_options) |
| 81 | + |
| 82 | + if args.overrides is not None: |
| 83 | + print("Build option overrides from command line:") |
| 84 | + last_options = dict(options_dict) |
| 85 | + options_dict.update((arg.split("=", maxsplit=1) for arg in args.overrides)) |
| 86 | + build_utils.print_options_diff(options_dict, last_options) |
78 | 87 |
|
79 | 88 | options = build_utils.cmake_options_from_dict(options_dict) |
| 89 | + print("Full build options") |
| 90 | + for key,val in sorted(options_dict.items()): |
| 91 | + print(f"\t{key: <30}{val}") |
80 | 92 |
|
81 | 93 | if WINDOWS: |
82 | 94 | options = "-Thost=x64 " + options |
@@ -193,6 +205,7 @@ def parse_args(): |
193 | 205 | parser.add_argument("--architecture", default=None, help="Windows only, target arch") |
194 | 206 | parser.add_argument("--repository", default="https://github.com/root-project/root.git", |
195 | 207 | help="url to repository") |
| 208 | + parser.add_argument("--overrides", default=None, help="Override build options using a syntax like 'A=1 B=2'", nargs="*") |
196 | 209 |
|
197 | 210 | args = parser.parse_args() |
198 | 211 |
|
|
0 commit comments