aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-11-19 01:14:05 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-11-20 16:52:45 -0500
commit8f41154827d9608234d0c0455551392d968d9e23 (patch)
treee180bf6db1c2bd2f8370108b693c5e7a45a9bf7f /mesonbuild
parentaa9668a2fc40b728ec0e3afed85ac9e12c3c50f1 (diff)
downloadmeson-8f41154827d9608234d0c0455551392d968d9e23.zip
meson-8f41154827d9608234d0c0455551392d968d9e23.tar.gz
meson-8f41154827d9608234d0c0455551392d968d9e23.tar.bz2
Can specify headers to install with Files.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/ninjabackend.py5
-rw-r--r--mesonbuild/interpreter.py10
2 files changed, 7 insertions, 8 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 8efb5fb..2bfb822 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -656,12 +656,15 @@ int dummy;
incroot = self.environment.get_includedir()
headers = self.build.get_headers()
+ srcdir = self.environment.get_source_dir()
+ builddir = self.environment.get_build_dir()
for h in headers:
outdir = h.get_custom_install_dir()
if outdir is None:
outdir = os.path.join(incroot, h.get_install_subdir())
for f in h.get_sources():
- abspath = os.path.join(self.environment.get_source_dir(), h.get_source_subdir(), f)
+ assert(isinstance(f, File))
+ abspath = f.absolute_path(srcdir, builddir)
i = [abspath, outdir]
d.headers.append(i)
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 1c562b6..b20d98c 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -457,10 +457,9 @@ class IncludeDirsHolder(InterpreterObject):
class Headers(InterpreterObject):
- def __init__(self, src_subdir, sources, kwargs):
+ def __init__(self, sources, kwargs):
InterpreterObject.__init__(self)
self.sources = sources
- self.source_subdir = src_subdir
self.install_subdir = kwargs.get('subdir', '')
self.custom_install_dir = kwargs.get('install_dir', None)
if self.custom_install_dir is not None:
@@ -473,9 +472,6 @@ class Headers(InterpreterObject):
def get_install_subdir(self):
return self.install_subdir
- def get_source_subdir(self):
- return self.source_subdir
-
def get_sources(self):
return self.sources
@@ -2155,9 +2151,9 @@ requirements use the version keyword argument instead.''')
self.build.benchmarks.append(t)
mlog.debug('Adding benchmark "', mlog.bold(args[0]), '".', sep='')
- @stringArgs
def func_install_headers(self, node, args, kwargs):
- h = Headers(self.subdir, args, kwargs)
+ source_files = self.source_strings_to_files(args)
+ h = Headers(source_files, kwargs)
self.build.headers.append(h)
return h