Skip to content

Commit 7b6f074

Browse files
committed
Unconditionally specify C++17
Ref: robotpy#17
1 parent 16b7bb5 commit 7b6f074

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

setup.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,10 @@ def has_flag(compiler, flagname):
125125
return True
126126

127127

128-
def cpp_flag(compiler):
129-
"""Return the -std=c++[11/14/17] compiler flag.
130-
131-
The highest version available is preferred.
132-
"""
133-
if has_flag(compiler, "-std=c++17"):
134-
return "-std=c++17"
135-
else:
136-
raise RuntimeError("Unsupported compiler -- at least C++17 support is needed!")
137-
138-
139128
class BuildExt(build_ext):
140129
"""A custom build extension for adding compiler-specific options."""
141130

142-
c_opts = {"msvc": ["/EHsc", "/DNOMINMAX"], "unix": []}
131+
c_opts = {"msvc": ["/EHsc", "/DNOMINMAX", "/std:c++17"], "unix": ["-std=c++17"]}
143132

144133
if sys.platform == "darwin":
145134
c_opts["unix"] += ["-stdlib=libc++", "-mmacosx-version-min=10.7"]
@@ -155,7 +144,6 @@ def build_extensions(self):
155144
opts.append("-g0") # remove debug symbols
156145
else:
157146
opts.append("-O0")
158-
opts.append(cpp_flag(self.compiler))
159147
if has_flag(self.compiler, "-fvisibility=hidden"):
160148
opts.append("-fvisibility=hidden")
161149
if sys.platform != "darwin":

0 commit comments

Comments
 (0)