_YesNoResult(context, ret, None, text)
return ret
+def CheckCXX(context):
+ """
+ Configure check for a working CXX compiler.
+
+ This checks whether the CXX compiler, as defined in the $CXX construction
+ variable, can compile a CXX source file. It uses the current $CXXCOM value
+ too, so that it can test against non working flags.
+
+ """
+ context.Display("Checking whether the C++ compiler works")
+ text = """
+int main()
+{
+ return 0;
+}
+"""
+ ret = _check_empty_program(context, 'CXX', text, 'C++')
+ _YesNoResult(context, ret, None, text)
+ return ret
+
def _check_empty_program(context, comp, text, language):
"""Return 0 on success, 1 otherwise."""
if not context.env.has_key(comp) or not context.env[comp]:
# add default tests
default_tests = {
'CheckCC' : CheckCC,
+ 'CheckCXX' : CheckCXX,
'CheckFunc' : CheckFunc,
'CheckType' : CheckType,
'CheckTypeSize' : CheckTypeSize,
res = SCons.Conftest.CheckCC(context)
return not res
+def CheckCXX(context):
+ res = SCons.Conftest.CheckCXX(context)
+ return not res
+
# Bram: Make this function obsolete? CheckHeader() is more generic.
def CheckCHeader(context, header, include_quotes = '""'):
finally:
sconf.Finish()
+ def test_CheckCXX(self):
+ """Test SConf.CheckCXX()
+ """
+ self._resetSConfState()
+ sconf = self.SConf.SConf(self.scons_env,
+ conf_dir=self.test.workpath('config.tests'),
+ log_file=self.test.workpath('config.log'))
+ try:
+ self._test_check_compilers('CXX', sconf.CheckCXX, 'CheckCXX')
+ finally:
+ sconf.Finish()
+
def test_CheckHeader(self):
"""Test SConf.CheckHeader()