diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-06-03 23:57:20 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-06-03 23:57:20 +0300 |
commit | 2fdc7c7dbc5ac046416f1148856b38f6439df74f (patch) | |
tree | e5448dbe73e282adf5d8f9169b9d687a613ce202 /environment.py | |
parent | aa38b1859fbbded725eac001b077b4230fb6332e (diff) | |
download | meson-2fdc7c7dbc5ac046416f1148856b38f6439df74f.zip meson-2fdc7c7dbc5ac046416f1148856b38f6439df74f.tar.gz meson-2fdc7c7dbc5ac046416f1148856b38f6439df74f.tar.bz2 |
Added has_header method.
Diffstat (limited to 'environment.py')
-rwxr-xr-x | environment.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/environment.py b/environment.py index 1660656..46aa349 100755 --- a/environment.py +++ b/environment.py @@ -109,6 +109,11 @@ class CCompiler(): if pe.returncode != 0: raise EnvironmentException('Executables created by C compiler %s are not runnable.' % self.name_string()) + def has_header(self, hname): + templ = '''#include<%s> +''' + return self.compiles(templ % hname) + def compiles(self, code): suflen = len(self.default_suffix) (fd, srcname) = tempfile.mkstemp(suffix='.'+self.default_suffix) |