@@ -19,6 +19,7 @@ def do_configure(args):
19
19
sycl_build_pi_cuda = 'OFF'
20
20
llvm_enable_assertions = 'ON'
21
21
llvm_enable_doxygen = 'OFF'
22
+ llvm_build_shared_libs = 'OFF'
22
23
23
24
if platform .system () == 'Linux' :
24
25
icd_loader_lib = os .path .join (icd_loader_lib , "libOpenCL.so" )
@@ -37,6 +38,9 @@ def do_configure(args):
37
38
if args .docs :
38
39
llvm_enable_doxygen = 'ON'
39
40
41
+ if args .shared_libs :
42
+ llvm_build_shared_libs = 'ON'
43
+
40
44
install_dir = os .path .join (args .obj_dir , "install" )
41
45
42
46
cmake_cmd = [
@@ -59,10 +63,16 @@ def do_configure(args):
59
63
"-DCMAKE_INSTALL_PREFIX={}" .format (install_dir ),
60
64
"-DSYCL_INCLUDE_TESTS=ON" , # Explicitly include all kinds of SYCL tests.
61
65
"-DLLVM_ENABLE_DOXYGEN={}" .format (llvm_enable_doxygen ),
66
+ "-DBUILD_SHARED_LIBS={}" .format (llvm_build_shared_libs ),
62
67
"-DSYCL_ENABLE_XPTI_TRACING=ON" , # Explicitly turn on XPTI tracing
63
68
llvm_dir
64
69
]
65
70
71
+ if not args .no_ocl :
72
+ cmake_cmd .extend ([
73
+ "-DOpenCL_INCLUDE_DIR={}" .format (ocl_header_dir ),
74
+ "-DOpenCL_LIBRARY={}" .format (icd_loader_lib )])
75
+
66
76
print (cmake_cmd )
67
77
68
78
try :
@@ -93,6 +103,8 @@ def main():
93
103
parser .add_argument ("--cuda" , action = 'store_true' , help = "switch from OpenCL to CUDA" )
94
104
parser .add_argument ("--assertions" , action = 'store_true' , help = "build with assertions" )
95
105
parser .add_argument ("--docs" , action = 'store_true' , help = "build Doxygen documentation" )
106
+ parser .add_argument ("--no-ocl" , action = 'store_true' , help = "download OpenCL deps via CMake" )
107
+ parser .add_argument ("--shared-libs" , action = 'store_true' , help = "Build shared libraries" )
96
108
97
109
args = parser .parse_args ()
98
110
0 commit comments