diff options
author | David Cournapeau <cournape@gmail.com> | 2008-09-03 08:30:17 (GMT) |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-09-03 08:30:17 (GMT) |
commit | 7df73d3a8dd2b3058c5d1bf2b4520706018ec010 (patch) | |
tree | 851b4f428c803a3782c3024453b2316338368d43 /src/engine/SCons/Conftest.py | |
parent | 43f47128378072a3b78910bbc4274a1ff94ed9f7 (diff) | |
download | SCons-7df73d3a8dd2b3058c5d1bf2b4520706018ec010.zip SCons-7df73d3a8dd2b3058c5d1bf2b4520706018ec010.tar.gz SCons-7df73d3a8dd2b3058c5d1bf2b4520706018ec010.tar.bz2 |
Add CheckCXX check.
Diffstat (limited to 'src/engine/SCons/Conftest.py')
-rw-r--r-- | src/engine/SCons/Conftest.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/engine/SCons/Conftest.py b/src/engine/SCons/Conftest.py index 34fd5e8..de918b1 100644 --- a/src/engine/SCons/Conftest.py +++ b/src/engine/SCons/Conftest.py @@ -162,6 +162,26 @@ int main() _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]: |