Fixed generated SConstruct files to work with MSVC
cherry-pick of r1634 from 2.0 maintenance branch
This commit is contained in:
parent
b1f480daa5
commit
c77539e577
3 changed files with 14 additions and 4 deletions
|
|
@ -971,12 +971,13 @@ config_h = env.Command('include/cantera/base/config.h',
|
|||
env.AlwaysBuild(config_h)
|
||||
env['config_h_target'] = config_h
|
||||
|
||||
env['boost_libs'] = []
|
||||
if env['build_thread_safe']:
|
||||
env['use_boost_libs'] = True
|
||||
env['boost_libs'] = [env['boost_thread_lib']]
|
||||
if env['CC'] != 'cl':
|
||||
env['boost_libs'].append(env['boost_thread_lib'])
|
||||
else:
|
||||
env['use_boost_libs'] = False
|
||||
env['boost_libs'] = []
|
||||
|
||||
# *********************
|
||||
# *** Build Cantera ***
|
||||
|
|
|
|||
|
|
@ -9,6 +9,14 @@ 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),
|
||||
|
|
@ -30,7 +38,8 @@ for subdir, name, extensions in samples:
|
|||
localenv['boost_inc_dir'])
|
||||
libdirs = (localenv['ct_libdir'], localenv['sundials_libdir'],
|
||||
localenv['blas_lapack_dir'], localenv['boost_lib_dir'])
|
||||
linkflags = ('-g', localenv['thread_flags'])
|
||||
linkflags = (debug_link_flag, localenv['thread_flags'])
|
||||
localenv['tmpl_compiler_flags'] = repr(compilerFlags)
|
||||
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])
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
env = Environment()
|
||||
|
||||
env.Append(CCFLAGS='-g',
|
||||
env.Append(CCFLAGS=@tmpl_compiler_flags@,
|
||||
CPPPATH=@tmpl_cantera_incdirs@,
|
||||
LIBS=@tmpl_cantera_libs@,
|
||||
LIBPATH=@tmpl_cantera_libdirs@,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue