summaryrefslogtreecommitdiff
path: root/numpy/distutils
diff options
context:
space:
mode:
authorserge-sans-paille <serge.guelton@telecom-bretagne.eu>2022-04-07 07:55:46 +0200
committerserge-sans-paille <serge.guelton@telecom-bretagne.eu>2022-04-08 10:02:41 +0200
commitc91a7d0c5691c9d78bd75284777fda73f225155d (patch)
tree667b576e0f0a3618a970d4443c4c7f5fd79d1d1e /numpy/distutils
parentca85c17e712c93717abb5c2b921393c3ecfc47c4 (diff)
downloadnumpy-c91a7d0c5691c9d78bd75284777fda73f225155d.tar.gz
Introduce numpy.core.setup_common.NPY_CXX_FLAGS
Group all C++ flags in one location. This avoids redundancy and makes sure we test the flags we use, and use the flags we test. Fix #21302
Diffstat (limited to 'numpy/distutils')
-rw-r--r--numpy/distutils/ccompiler_opt.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/distutils/ccompiler_opt.py b/numpy/distutils/ccompiler_opt.py
index 6d2114c95..886066a61 100644
--- a/numpy/distutils/ccompiler_opt.py
+++ b/numpy/distutils/ccompiler_opt.py
@@ -16,6 +16,14 @@ import re
import subprocess
import textwrap
+# These flags are used to compile any C++ source within Numpy.
+# They are chosen to have very few runtime dependencies.
+NPY_CXX_FLAGS = [
+ '-std=c++11', # Minimal standard version
+ '-D__STDC_VERSION__=0', # for compatibility with C headers
+ '-fno-exceptions', # no exception support
+ '-fno-rtti'] # no runtime type information
+
class _Config:
"""An abstract class holds all configurable attributes of `CCompilerOpt`,