diff options
author | Sayed Adel <seiko@imavr.com> | 2021-11-14 05:14:00 +0200 |
---|---|---|
committer | Sayed Adel <seiko@imavr.com> | 2021-11-14 05:14:00 +0200 |
commit | b9173e5c8b0410a9c96f3711d304e756a3e55efc (patch) | |
tree | cb897f72af7799d34f45829e3d13c045ad76bc45 /numpy/core/setup.py | |
parent | d06f2288e078876f5e0bebde4e844b64a0b0ffee (diff) | |
download | numpy-b9173e5c8b0410a9c96f3711d304e756a3e55efc.tar.gz |
DIST: Workaround ignore invalid C++ flags for config/try_link
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]) |