Skip to content

Commit

Permalink
[SCons] SConstruct for C++ demos inherits compiler and options
Browse files Browse the repository at this point in the history
Use the same values for the compiler name and the compiler flags as were used
when compiling Cantera.
  • Loading branch information
speth committed Apr 7, 2016
1 parent ee1b07a commit 0a3927a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
13 changes: 2 additions & 11 deletions samples/cxx/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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 = []
Expand Down
1 change: 1 addition & 0 deletions samples/cxx/SConstruct.in
Original file line number Diff line number Diff line change
@@ -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@,
Expand Down

0 comments on commit 0a3927a

Please sign in to comment.