5
5
6
6
def run (
7
7
use_oneapi = True ,
8
+ build_type = "Release" ,
8
9
c_compiler = None ,
9
10
cxx_compiler = None ,
10
11
level_zero = True ,
11
12
compiler_root = None ,
12
13
cmake_executable = None ,
13
14
use_glog = False ,
14
15
):
15
- IS_LIN = False
16
+ build_system = None
16
17
17
18
if "linux" in sys .platform :
18
- IS_LIN = True
19
+ build_system = "Unix Makefiles"
19
20
elif sys .platform in ["win32" , "cygwin" ]:
20
- pass
21
+ build_system = "Ninja"
21
22
else :
22
23
assert False , sys .platform + " not supported"
23
24
24
- if not IS_LIN :
25
- raise RuntimeError (
26
- "This scripts only supports coverage collection on Linux"
27
- )
28
25
setup_dir = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
29
26
cmake_args = [
30
27
sys .executable ,
@@ -38,8 +35,8 @@ def run(
38
35
cmake_args += [
39
36
"--" ,
40
37
"-G" ,
41
- "Unix Makefiles" ,
42
- "-DCMAKE_BUILD_TYPE=Debug" ,
38
+ build_system ,
39
+ "-DCMAKE_BUILD_TYPE=" + build_type ,
43
40
"-DCMAKE_C_COMPILER:PATH=" + c_compiler ,
44
41
"-DCMAKE_CXX_COMPILER:PATH=" + cxx_compiler ,
45
42
"-DDPCTL_ENABLE_LO_PROGRAM_CREATION=" + ("ON" if level_zero else "OFF" ),
@@ -72,6 +69,13 @@ def run(
72
69
dest = "oneapi" ,
73
70
action = "store_true" ,
74
71
)
72
+ driver .add_argument (
73
+ "--debug" ,
74
+ default = "Release" ,
75
+ const = "Debug" ,
76
+ action = "store_const" ,
77
+ help = "Set the compilation mode to debugging" ,
78
+ )
75
79
driver .add_argument (
76
80
"--compiler-root" , type = str , help = "Path to compiler home directory"
77
81
)
@@ -94,7 +98,7 @@ def run(
94
98
95
99
if args .oneapi :
96
100
args .c_compiler = "icx"
97
- args .cxx_compiler = "icpx"
101
+ args .cxx_compiler = "icpx" if "linux" in sys . platform else "icx"
98
102
args .compiler_root = None
99
103
else :
100
104
args_to_validate = [
@@ -115,6 +119,7 @@ def run(
115
119
116
120
run (
117
121
use_oneapi = args .oneapi ,
122
+ build_type = args .debug ,
118
123
c_compiler = args .c_compiler ,
119
124
cxx_compiler = args .cxx_compiler ,
120
125
level_zero = args .level_zero ,
0 commit comments