diff options
Diffstat (limited to 'numpy/core/setup.py')
-rw-r--r-- | numpy/core/setup.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py index 3fc0f85f1..a5f423d8f 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -686,6 +686,13 @@ def configuration(parent_package='',top_path=None): ) ), ): + is_cpp = lang == 'c++' + if is_cpp: + # this a workround to get rid of invalid c++ flags + # without doing big changes to config. + # c tested first, compiler should be here + bk_c = config_cmd.compiler + config_cmd.compiler = bk_c.cxx_compiler() st = config_cmd.try_link(test_code, lang=lang) if not st: # rerun the failing command in verbose mode @@ -695,6 +702,8 @@ def configuration(parent_package='',top_path=None): f"Broken toolchain: cannot link a simple {lang.upper()} " f"program. {note}" ) + if is_cpp: + config_cmd.compiler = bk_c mlibs = check_mathlib(config_cmd) posix_mlib = ' '.join(['-l%s' % l for l in mlibs]) |