File tree Expand file tree Collapse file tree 3 files changed +121
-321
lines changed
Expand file tree Collapse file tree 3 files changed +121
-321
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,14 @@ def build_extensions(self):
181181 env = self .add_optimization_flags ()
182182 for package in good_packages :
183183 package .do_custom_build (env )
184+ # Make sure we don't accidentally use too modern C++ constructs, even
185+ # though modern compilers default to enabling them. Enabling this for
186+ # a single platform is enough; also only do this for C++-only
187+ # extensions as clang refuses to compile C/ObjC with -std=c++11.
188+ if sys .platform != "win32" :
189+ for ext in self .distribution .ext_modules [:]:
190+ if not any (src .endswith ((".c" , ".m" )) for src in ext .sources ):
191+ ext .extra_compile_args .append ("-std=c++11" )
184192 return super ().build_extensions ()
185193
186194 def build_extension (self , ext ):
You can’t perform that action at this time.
0 commit comments