aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-07-27 03:11:50 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2014-07-27 03:11:50 +0300
commitaf0ca6751a9b8d1c9ad643602b7d699ed8bc7a76 (patch)
tree6706b9ee8cde2723d62867e30ce336af50d6a401
parentbae850775328650c3fc326221a97cf74ea3f04c3 (diff)
downloadmeson-af0ca6751a9b8d1c9ad643602b7d699ed8bc7a76.zip
meson-af0ca6751a9b8d1c9ad643602b7d699ed8bc7a76.tar.gz
meson-af0ca6751a9b8d1c9ad643602b7d699ed8bc7a76.tar.bz2
Made all unit tests pass again.
-rw-r--r--build.py7
-rw-r--r--ninjabackend.py10
2 files changed, 13 insertions, 4 deletions
diff --git a/build.py b/build.py
index 8136d9e..daa2777 100644
--- a/build.py
+++ b/build.py
@@ -637,8 +637,11 @@ class CustomTarget:
self.dependencies.append(c)
# GIR scanner will attempt to execute this binary but
# it assumes that it is in path, so always give it a full path.
- totarget = os.path.join('.', c.get_subdir(), c.get_filename())
- final_cmd.append(totarget)
+ tmp = c.get_filename()
+ if isinstance(tmp, str):
+ tmp =[tmp]
+ totarget = [os.path.join('.', c.get_subdir(), i) for i in tmp]
+ final_cmd += totarget
elif isinstance(c, list):
# Hackety hack, only supports one level of flattening. Should really
# work to arbtrary depth.
diff --git a/ninjabackend.py b/ninjabackend.py
index 7b70565..547a8ae 100644
--- a/ninjabackend.py
+++ b/ninjabackend.py
@@ -136,9 +136,15 @@ class NinjaBackend(backends.Backend):
outfile.close()
os.replace(tempfilename, outfilename)
+ def hackety_hack(self, hack):
+ if isinstance(hack, list):
+ return hack[0]
+ return hack
+
def generate_custom_target(self, target, outfile):
ofilenames = [os.path.join(target.subdir, i) for i in target.output]
- deps = [os.path.join(i.get_subdir(), i.get_filename()) for i in target.get_dependencies()]
+ # FIXME, should not grab element at zero but rather expand all.
+ deps = [os.path.join(i.get_subdir(), self.hackety_hack(i.get_filename())) for i in target.get_dependencies()]
srcs = [os.path.join(self.build_to_src, target.subdir, i) for i in target.sources]
deps += srcs
elem = NinjaBuildElement(ofilenames, 'CUSTOM_COMMAND', deps)
@@ -147,7 +153,7 @@ class NinjaBackend(backends.Backend):
if i == '@INPUT@':
cmd += srcs
elif i == '@OUTPUT@':
- cmd.append += ofilenames
+ cmd += ofilenames
else:
cmd.append(i)
elem.add_item('COMMAND', cmd)