Skip to content

Commit 20729dc

Browse files
authored
Properly specify std:c++17 for msvc (#3207)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 131d95a commit 20729dc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python/triton/runtime/build.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def is_xpu():
1111

1212
def _cc_cmd(cc, src, out, include_dirs, library_dirs, libraries):
1313
if "cl.EXE" in cc or "clang-cl" in cc:
14-
cc_cmd = [cc, "/Zc:__cplusplus", src, "/nologo", "/O2", "/LD"]
14+
cc_cmd = [cc, "/Zc:__cplusplus", "/std:c++17", 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"]
@@ -77,7 +77,8 @@ def _build(name, src, srcdir, library_dirs, include_dirs, libraries, extra_compi
7777
if cxx is icpx:
7878
extra_compile_args += ["-fsycl"]
7979
else:
80-
extra_compile_args += ["--std=c++17"]
80+
if os.name != "nt":
81+
extra_compile_args += ["--std=c++17"]
8182
if os.name == "nt":
8283
library_dirs = library_dirs + [
8384
os.path.abspath(os.path.join(sysconfig.get_paths(scheme=scheme)["stdlib"], "..", "libs"))

0 commit comments

Comments
 (0)