From 0a3927a07777e9ead24c646e151bdf0b4c736767 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 6 Apr 2016 22:07:51 -0400 Subject: [PATCH] [SCons] SConstruct for C++ demos inherits compiler and options Use the same values for the compiler name and the compiler flags as were used when compiling Cantera. --- samples/cxx/SConscript | 13 ++----------- samples/cxx/SConstruct.in | 1 + 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/samples/cxx/SConscript b/samples/cxx/SConscript index 59982464e..259d9fe68 100644 --- a/samples/cxx/SConscript +++ b/samples/cxx/SConscript @@ -9,14 +9,6 @@ samples = [('combustor', 'combustor', ['cpp']), ('NASA_coeffs', 'NASA_coeffs', ['cpp']), ('rankine', 'rankine', ['cpp'])] -if env['CC'] == 'cl': - debug_link_flag = '/DEBUG' - compilerFlags = ['/EHsc', '/MD', '/nologo', '/W3', - '/D_SCL_SECURE_NO_WARNINGS', '/D_CRT_SECURE_NO_WARNINGS'] -else: - debug_link_flag = '-g' - compilerFlags = ['-g', '-Wall'] - for subdir, name, extensions in samples: localenv = env.Clone() buildSample(localenv.Program, pjoin(subdir, name), @@ -46,13 +38,12 @@ for subdir, name, extensions in samples: localenv['boost_inc_dir']) + tuple(localenv['extra_inc_dirs']) libdirs = ((localenv['ct_libdir'], localenv['sundials_libdir'], localenv['blas_lapack_dir']) + tuple(localenv['extra_lib_dirs'])) - linkflags = (debug_link_flag, localenv['thread_flags']) - localenv['tmpl_compiler_flags'] = repr(compilerFlags) + localenv['tmpl_compiler_flags'] = repr(localenv['CCFLAGS'] + localenv['CXXFLAGS']) localenv['tmpl_cantera_frameworks'] = repr(localenv['FRAMEWORKS']) localenv['tmpl_cantera_incdirs'] = repr([x for x in incdirs if x]) localenv['tmpl_cantera_libs'] = repr(localenv['cantera_libs']) localenv['tmpl_cantera_libdirs'] = repr([x for x in libdirs if x]) - localenv['tmpl_cantera_linkflags'] = repr([x for x in linkflags if x]) + localenv['tmpl_cantera_linkflags'] = repr(localenv['LINKFLAGS']) localenv['tmpl_progname'] = name localenv['tmpl_sourcename'] = name + '.cpp' env_args = [] diff --git a/samples/cxx/SConstruct.in b/samples/cxx/SConstruct.in index cae5ff129..b645a2812 100644 --- a/samples/cxx/SConstruct.in +++ b/samples/cxx/SConstruct.in @@ -1,5 +1,6 @@ env = Environment(@tmpl_env_args@) +env['CXX'] = '@CXX@' env.Append(CCFLAGS=@tmpl_compiler_flags@, CPPPATH=@tmpl_cantera_incdirs@, LIBS=@tmpl_cantera_libs@,