Skip to content

Commit c4c5e4c

Browse files
Add Windows support to build_locally.py
1 parent 05a5abd commit c4c5e4c

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

scripts/build_locally.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,15 @@ def run(
1111
compiler_root=None,
1212
cmake_executable=None,
1313
):
14-
IS_LIN = False
14+
build_system = None
1515

1616
if "linux" in sys.platform:
17-
IS_LIN = True
17+
build_system = "Unix Makefiles"
1818
elif sys.platform in ["win32", "cygwin"]:
19-
pass
19+
build_system = "Ninja"
2020
else:
2121
assert False, sys.platform + " not supported"
2222

23-
if not IS_LIN:
24-
raise RuntimeError(
25-
"This scripts only supports coverage collection on Linux"
26-
)
2723
setup_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
2824
cmake_args = [
2925
sys.executable,
@@ -37,7 +33,7 @@ def run(
3733
cmake_args += [
3834
"--",
3935
"-G",
40-
"Unix Makefiles",
36+
build_system,
4137
"-DCMAKE_BUILD_TYPE=Debug",
4238
"-DCMAKE_C_COMPILER:PATH=" + c_compiler,
4339
"-DCMAKE_CXX_COMPILER:PATH=" + cxx_compiler,
@@ -86,7 +82,7 @@ def run(
8682

8783
if args.oneapi:
8884
args.c_compiler = "icx"
89-
args.cxx_compiler = "icpx"
85+
args.cxx_compiler = "icpx" if "linux" in sys.platform else "icx"
9086
args.compiler_root = None
9187
else:
9288
args_to_validate = [

0 commit comments

Comments
 (0)