diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-02-20 14:33:42 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-02-20 14:33:42 +0200 |
commit | 2cbe876f714f2c6fc66a5bcb0dfe9118752f850d (patch) | |
tree | 69d90849ab4eb5176154764787a20fdd80bac806 /mesonbuild | |
parent | a15e784851dee647aeaf96f180f4947cd4775bd6 (diff) | |
parent | fabb49773e522a68e10c4be80067d28abecc4017 (diff) | |
download | meson-2cbe876f714f2c6fc66a5bcb0dfe9118752f850d.zip meson-2cbe876f714f2c6fc66a5bcb0dfe9118752f850d.tar.gz meson-2cbe876f714f2c6fc66a5bcb0dfe9118752f850d.tar.bz2 |
Merge pull request #388 from nirbheek/extprog.path
Add path() method to ExternalProgramHolder types
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/build.py | 2 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index c0ba895..f9e628d 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -808,6 +808,8 @@ class CustomTarget: if not isinstance(s, str): raise InvalidArguments('Array as argument %d contains a non-string.' % i) final_cmd.append(s) + elif isinstance(c, File): + final_cmd.append(os.path.join(c.subdir, c.fname)) else: raise InvalidArguments('Argument %s in "command" is invalid.' % i) self.command = final_cmd diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index a633917..4d41f1a 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -242,11 +242,15 @@ class ExternalProgramHolder(InterpreterObject): def __init__(self, ep): InterpreterObject.__init__(self) self.held_object = ep - self.methods.update({'found': self.found_method}) + self.methods.update({'found': self.found_method, + 'path': self.path_method}) def found_method(self, args, kwargs): return self.found() + def path_method(self, args, kwargs): + return self.get_command() + def found(self): return self.held_object.found() |