File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,12 +36,13 @@ if(WIN32 AND ITLABAI_SYCL_IMPLEMENTATION STREQUAL "IntelLLVM")
3636 "to point to the runtime import library" )
3737 endif ()
3838
39- target_link_options (SYCL_Example PRIVATE /clang:-fsycl )
40- if (ITLABAI_SYCL_TARGETS)
41- target_link_options (SYCL_Example PRIVATE
42- /clang:-fsycl-targets=${ITLABAI_SYCL_TARGETS}
43- )
44- endif ()
39+ set (CMAKE_CXX_LINK_EXECUTABLE
40+ "python \" ${CMAKE_SOURCE_DIR } /scripts/ci/windows_sycl_link.py\" "
41+ "--compiler \" ${CMAKE_CXX_COMPILER } \" "
42+ "--target <TARGET> "
43+ "--sycl-targets \" ${ITLABAI_SYCL_TARGETS} \" "
44+ "--objects <OBJECTS> "
45+ "--libraries <LINK_LIBRARIES>" )
4546
4647 set (SYCL_EXAMPLE_KERNEL_OBJECT
4748 "${CMAKE_CURRENT_BINARY_DIR } /SYCL_Example.sycl_kernel.obj" )
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ from __future__ import annotations
4+
5+ import argparse
6+ import subprocess
7+ import sys
8+
9+
10+ def main () -> int :
11+ parser = argparse .ArgumentParser ()
12+ parser .add_argument ("--compiler" , required = True )
13+ parser .add_argument ("--target" , required = True )
14+ parser .add_argument ("--sycl-targets" , default = "" )
15+ parser .add_argument ("--objects" , nargs = "+" , required = True )
16+ parser .add_argument ("--libraries" , nargs = "*" , default = [])
17+ args = parser .parse_args ()
18+
19+ command = [args .compiler , "/clang:-fsycl" ]
20+ if args .sycl_targets :
21+ command .append (f"/clang:-fsycl-targets={ args .sycl_targets } " )
22+
23+ command .extend (args .objects )
24+ command .extend (
25+ [
26+ "/link" ,
27+ f"/OUT:{ args .target } " ,
28+ * args .libraries ,
29+ ]
30+ )
31+
32+ print ("+" , " " .join (command ), flush = True )
33+ result = subprocess .run (command , check = False )
34+ return result .returncode
35+
36+
37+ if __name__ == "__main__" :
38+ sys .exit (main ())
You can’t perform that action at this time.
0 commit comments