aboutsummaryrefslogtreecommitdiff
path: root/environment.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-06-03 23:57:20 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-06-03 23:57:20 +0300
commit2fdc7c7dbc5ac046416f1148856b38f6439df74f (patch)
treee5448dbe73e282adf5d8f9169b9d687a613ce202 /environment.py
parentaa38b1859fbbded725eac001b077b4230fb6332e (diff)
downloadmeson-2fdc7c7dbc5ac046416f1148856b38f6439df74f.zip
meson-2fdc7c7dbc5ac046416f1148856b38f6439df74f.tar.gz
meson-2fdc7c7dbc5ac046416f1148856b38f6439df74f.tar.bz2
Added has_header method.
Diffstat (limited to 'environment.py')
-rwxr-xr-xenvironment.py5
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)