aboutsummaryrefslogtreecommitdiff
path: root/interpreter.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-12-09 03:41:19 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-12-09 03:41:19 +0200
commitf10bf29c6807ea89f0cb2ad728e0d4854d17d69f (patch)
treef48fb70f24713450f7557e48dbf97008687d2fbb /interpreter.py
parent6495334b03bc527e2e576339bfee31bfbac50aec (diff)
downloadmeson-f10bf29c6807ea89f0cb2ad728e0d4854d17d69f.zip
meson-f10bf29c6807ea89f0cb2ad728e0d4854d17d69f.tar.gz
meson-f10bf29c6807ea89f0cb2ad728e0d4854d17d69f.tar.bz2
And, with that, subprojects actually work.
Diffstat (limited to 'interpreter.py')
-rw-r--r--interpreter.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/interpreter.py b/interpreter.py
index 4e7dae9..61f5938 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -730,6 +730,8 @@ class Interpreter():
dirname = args[0]
if not isinstance(dirname, str):
raise InterpreterException('Subproject argument must be a string')
+ if self.subdir != '':
+ raise InterpreterException('Subprojects must be defined at the root directory.')
if self.subproject != '':
raise InterpreterException('Subprojects of subprojects are not yet supported.')
if dirname in self.subprojects:
@@ -985,7 +987,8 @@ class Interpreter():
for a in args:
if not isinstance(a, str):
raise InvalidArguments('Argument %s is not a string.' % str(a))
- i = IncludeDirsHolder(self.subdir, args, kwargs)
+ curdir = os.path.join(self.subproject, self.subdir)
+ i = IncludeDirsHolder(curdir, args, kwargs)
return i
def func_add_global_arguments(self, node, args, kwargs):
@@ -1047,7 +1050,8 @@ class Interpreter():
if name in self.build.targets:
raise InvalidCode('Tried to create target "%s", but a target of that name already exists.' % name)
self.check_sources_exist(os.path.join(self.source_root, self.subdir), sources)
- l = targetclass(name, self.subdir, is_cross, sources, objs, self.environment, kwargs)
+ full_subdir = os.path.join(self.subproject, self.subdir)
+ l = targetclass(name, full_subdir, is_cross, sources, objs, self.environment, kwargs)
self.build.targets[name] = l.held_object
if self.environment.is_cross_build() and l.is_cross:
txt = ' cross build '