Skip to content

Commit

Permalink
on failure, compile test program
Browse files Browse the repository at this point in the history
  • Loading branch information
NQNStudios committed Jan 22, 2025
1 parent 572559c commit 70ecf87
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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=[]):
Expand Down

0 comments on commit 70ecf87

Please sign in to comment.