From b9173e5c8b0410a9c96f3711d304e756a3e55efc Mon Sep 17 00:00:00 2001 From: Sayed Adel Date: Sun, 14 Nov 2021 05:14:00 +0200 Subject: DIST: Workaround ignore invalid C++ flags for config/try_link --- numpy/core/setup.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'numpy/core/setup.py') 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]) -- cgit v1.2.1