Skip to content

Commit 7deab06

Browse files
author
WCSim CI
committed
Split overlap check & parallel build options into separate arguments
1 parent 1a80cdd commit 7deab06

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

build.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
import argparse
55
from common import CommonWebPageFuncs
66

7-
def main(option):
7+
def main(args):
88

99
cw = CommonWebPageFuncs()
1010
extra_options = ""
1111

12-
if option == 1:
12+
if args.overlap_check:
1313
extra_options = "-DWCSim_Geometry_Overlaps_CHECK=ON"
1414

1515
cw.create_directory("build")
@@ -18,7 +18,7 @@ def main(option):
1818

1919
cmake_command = f"cmake -DWCSim_DEBUG_COMPILE_FLAG=ON {extra_options} -DCMAKE_INSTALL_PREFIX=../install/ ../src/"
2020
make_command = "make"
21-
if option == 1:
21+
if args.parallel:
2222
make_command += " -j`nproc`"
2323
make_install_command = "make install"
2424

@@ -28,6 +28,7 @@ def main(option):
2828

2929
if __name__ == "__main__":
3030
parser = argparse.ArgumentParser(description="Build and install script")
31-
parser.add_argument("-o","--option", required=True,type=int, help="Option to pass to the script. Option 0 does nothing. Option 1 sets WCSim_Geometry_Overlaps_CHECK=ON & compiles with multiple threads", choices=list(range(2)))
31+
parser.add_argument("--parallel", action='store_true', help="Build code in parallel?")
32+
parser.add_argument("--overlap-check", action='store_true', help="Build with overlap checking on? WARNING! Running with this is very slow!")
3233
args = parser.parse_args()
33-
main(args.option)
34+
main(args)

0 commit comments

Comments
 (0)