From 70ecf87e3d0d4382a760a633fb985ef25137b1db Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Tue, 21 Jan 2025 22:31:44 -0600 Subject: [PATCH] on failure, compile test program --- SConstruct | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index c2cffad5d..48bd7d393 100644 --- a/SConstruct +++ b/SConstruct @@ -79,9 +79,7 @@ if platform not in ("darwin", "win32", "posix"): Exit(1) print('Building for:', platform) print('Using toolchain:', toolset) -cxx = env['CXX'] -if cxx.startswith('$'): - cxx = env[cxx[1:]] +cxx = env.subst(env['CXX']) print('C++ compiler:', cxx) env.VariantDir('#build/obj', 'src') @@ -332,6 +330,15 @@ if not env.GetOption('clean'): if not conf.CheckCXX(): print("There's a problem with your compiler!") + with open('test.cpp', 'w') as test_file: + test_file.writelines([ + 'int main(void)\n', + '{\n', + 'return 0;\n', + '}\n', + ]) + import subprocess + subprocess.run([cxx, 'test.cpp']) Exit(1) def check_lib(lib, disp, suffixes=[], versions=[], msvc_versions=[]):