Skip to content

Commit

Permalink
build C++ extensions on windows with /std:c++17 (pytorch#97413)
Browse files Browse the repository at this point in the history
build C++ extensions on windows with /std:c++17

Summary:
We added -std=c++17 to Posix builds, but neglected to add this for
Windows. This just brings back parity.

Test Plan: Rely on CI.

Reviewers: ezyang

Subscribers:

Tasks:

Tags:

---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/pytorch/pytorch/pull/97413).
* pytorch#97175
* __->__ pytorch#97413
Pull Request resolved: pytorch#97413
Approved by: https://github.com/ezyang
  • Loading branch information
mikey dagitses authored and pytorchmergebot committed Mar 23, 2023
1 parent feace5d commit bdaf402
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/utils/cpp_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,7 @@ def _write_ninja_file_to_build_library(path,
common_cflags += ['-D_GLIBCXX_USE_CXX11_ABI=' + str(int(torch._C._GLIBCXX_USE_CXX11_ABI))]

if IS_WINDOWS:
cflags = common_cflags + COMMON_MSVC_FLAGS + extra_cflags
cflags = common_cflags + COMMON_MSVC_FLAGS + ['/std:c++17'] + extra_cflags
cflags = _nt_quote_args(cflags)
else:
cflags = common_cflags + ['-fPIC', '-std=c++17'] + extra_cflags
Expand Down

0 comments on commit bdaf402

Please sign in to comment.