Skip to content
This repository was archived by the owner on Nov 5, 2023. It is now read-only.

Commit 962e1c7

Browse files
authored
Merge pull request #95 from auscompgeek/std-cxx
Unconditionally specify C++17
2 parents 16b7bb5 + 39e439b commit 962e1c7

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

setup.py

+2-14
Original file line numberDiff line numberDiff line change
@@ -125,24 +125,13 @@ 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":
145-
c_opts["unix"] += ["-stdlib=libc++", "-mmacosx-version-min=10.7"]
134+
c_opts["unix"] += ["-stdlib=libc++", "-mmacosx-version-min=10.14"]
146135

147136
def build_extensions(self):
148137
ct = self.compiler.compiler_type
@@ -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)