File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -686,6 +686,13 @@ def get_mathlib_info(*args):
686686 )
687687 ),
688688 ):
689+ is_cpp = lang == 'c++'
690+ if is_cpp :
691+ # this a workround to get rid of invalid c++ flags
692+ # without doing big changes to config.
693+ # c tested first, compiler should be here
694+ bk_c = config_cmd .compiler
695+ config_cmd .compiler = bk_c .cxx_compiler ()
689696 st = config_cmd .try_link (test_code , lang = lang )
690697 if not st :
691698 # rerun the failing command in verbose mode
@@ -695,6 +702,8 @@ def get_mathlib_info(*args):
695702 f"Broken toolchain: cannot link a simple { lang .upper ()} "
696703 f"program. { note } "
697704 )
705+ if is_cpp :
706+ config_cmd .compiler = bk_c
698707 mlibs = check_mathlib (config_cmd )
699708
700709 posix_mlib = ' ' .join (['-l%s' % l for l in mlibs ])
You can’t perform that action at this time.
0 commit comments