@@ -10,8 +10,8 @@ def is_xpu():
1010
1111
1212def _cc_cmd (cc , src , out , include_dirs , library_dirs , libraries ):
13- if cc in [ "cl" , "clang-cl" ] :
14- cc_cmd = [cc , src , "/nologo" , "/O2" , "/LD" ]
13+ if "cl.EXE" in cc or "clang-cl" in cc :
14+ cc_cmd = [cc , "/Zc:__cplusplus" , src , "/nologo" , "/O2" , "/LD" ]
1515 cc_cmd += [f"/I{ dir } " for dir in include_dirs ]
1616 cc_cmd += [f"/Fo{ os .path .join (os .path .dirname (out ), 'main.obj' )} " ]
1717 cc_cmd += ["/link" ]
@@ -66,19 +66,22 @@ def _build(name, src, srcdir, library_dirs, include_dirs, libraries, extra_compi
6666 clangpp = shutil .which ("clang++" )
6767 gxx = shutil .which ("g++" )
6868 icpx = shutil .which ("icpx" )
69- cxx = icpx if os .name == "nt" else icpx or clangpp or gxx
69+ cl = shutil .which ("cl" )
70+ cxx = icpx or cl if os .name == "nt" else icpx or clangpp or gxx
7071 if cxx is None :
7172 raise RuntimeError ("Failed to find C++ compiler. Please specify via CXX environment variable." )
7273 cc = cxx
7374 import numpy as np
7475 numpy_include_dir = np .get_include ()
7576 include_dirs = include_dirs + [numpy_include_dir ]
76- if icpx is not None :
77+ if cxx is icpx :
7778 extra_compile_args += ["-fsycl" ]
7879 else :
7980 extra_compile_args += ["--std=c++17" ]
8081 if os .name == "nt" :
81- library_dirs = library_dirs + [os .path .join (sysconfig .get_paths (scheme = scheme )["stdlib" ], ".." , "libs" )]
82+ library_dirs = library_dirs + [
83+ os .path .abspath (os .path .join (sysconfig .get_paths (scheme = scheme )["stdlib" ], ".." , "libs" ))
84+ ]
8285 else :
8386 cc_cmd = [cc ]
8487
0 commit comments