mirror of
https://github.com/Cantera/cantera.git
synced 2026-08-05 18:57:00 -05:00
[SCons] Check for <tr1/tuple>
This header is used by GTest. If not present, define 'GTEST_USE_OWN_TR1_TUPLE' to use an alternative version. Fixes a compilation error on OS X.
This commit is contained in:
@@ -811,6 +811,7 @@ env['HAS_TIMES_H'] = conf.CheckCHeader('sys/times.h', '""')
|
||||
env['HAS_UNISTD_H'] = conf.CheckCHeader('unistd.h', '""')
|
||||
env['HAS_MATH_H_ERF'] = conf.CheckDeclaration('erf', '#include <math.h>', 'C++')
|
||||
env['HAS_BOOST_MATH'] = conf.CheckCXXHeader('boost/math/special_functions/erf.hpp', '<>')
|
||||
env['HAS_TR1_TUPLE'] = conf.CheckCXXHeader('tr1/tuple', '<>')
|
||||
boost_version_source = get_expression_value(['<boost/version.hpp>'], 'BOOST_LIB_VERSION')
|
||||
retcode, boost_lib_version = conf.TryRun(boost_version_source, '.cpp')
|
||||
env['BOOST_LIB_VERSION'] = boost_lib_version.strip()
|
||||
|
||||
@@ -159,6 +159,8 @@ localenv = env.Clone()
|
||||
localenv.Prepend(CPPPATH=[Dir('#ext/gtest'),
|
||||
Dir('#ext/gtest/include')],
|
||||
CPPDEFINES={'GTEST_HAS_PTHREAD': 0})
|
||||
if not localenv['HAS_TR1_TUPLE']:
|
||||
localenv.Append(CPPDEFINES='GTEST_USE_OWN_TR1_TUPLE')
|
||||
|
||||
gtest = build(localenv.Library(pjoin('../lib', 'gtest'),
|
||||
source=['gtest/src/gtest-all.cc']))
|
||||
|
||||
@@ -9,6 +9,9 @@ localenv.Prepend(CPPPATH=['#ext/gtest/include', '#include'],
|
||||
localenv.Append(LIBS=['gtest'] + localenv['cantera_libs'],
|
||||
CCFLAGS=env['warning_flags'])
|
||||
|
||||
if not localenv['HAS_TR1_TUPLE']:
|
||||
localenv.Append(CPPDEFINES='GTEST_USE_OWN_TR1_TUPLE')
|
||||
|
||||
localenv['ENV']['CANTERA_DATA'] = Dir('#build/data').abspath
|
||||
|
||||
PASSED_FILES = {}
|
||||
|
||||
Reference in New Issue
Block a user