aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-09-21 20:02:21 +0300
committerGitHub <noreply@github.com>2017-09-21 20:02:21 +0300
commit2f6702839e9f1c109230ace33e997b4d06663479 (patch)
tree11dd328f3f47faceac656dae816da01073ce4689 /mesonbuild
parentb6821dc590906b540c51417261235d0f1ea1c08c (diff)
parent63ada0ce26024f1f961497c4ae09796571d02114 (diff)
downloadmeson-2f6702839e9f1c109230ace33e997b4d06663479.zip
meson-2f6702839e9f1c109230ace33e997b4d06663479.tar.gz
meson-2f6702839e9f1c109230ace33e997b4d06663479.tar.bz2
Merge pull request #2340 from NickeZ/generator-fix
Add @PLAINNAME@ and @BASENAME@ to arguments argument for Generator
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/ninjabackend.py2
-rw-r--r--mesonbuild/backend/vs2010backend.py2
-rw-r--r--mesonbuild/build.py6
3 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index aeb2411..f67e412 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -1784,7 +1784,6 @@ rule FORTRAN_DEP_HACK
exe_arr = self.exe_object_to_cmd_array(exe)
infilelist = genlist.get_inputs()
outfilelist = genlist.get_outputs()
- base_args = generator.get_arglist()
extra_dependencies = [os.path.join(self.build_to_src, i) for i in genlist.extra_depends]
source_target_dir = self.get_target_source_dir(target)
for i in range(len(infilelist)):
@@ -1794,6 +1793,7 @@ rule FORTRAN_DEP_HACK
sole_output = ''
curfile = infilelist[i]
infilename = curfile.rel_to_builddir(self.build_to_src)
+ base_args = generator.get_arglist(infilename)
outfiles = genlist.get_outputs_for(curfile)
outfiles = [os.path.join(self.get_target_private_dir(target), of) for of in outfiles]
if generator.depfile is None:
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index 0bbc17c..5c2f836 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -106,7 +106,6 @@ class Vs2010Backend(backends.Backend):
infilelist = genlist.get_inputs()
outfilelist = genlist.get_outputs()
exe_arr = self.exe_object_to_cmd_array(exe)
- base_args = generator.get_arglist()
idgroup = ET.SubElement(parent_node, 'ItemGroup')
for i in range(len(infilelist)):
if len(infilelist) == len(outfilelist):
@@ -115,6 +114,7 @@ class Vs2010Backend(backends.Backend):
sole_output = ''
curfile = infilelist[i]
infilename = os.path.join(down, curfile.rel_to_builddir(self.build_to_src))
+ base_args = generator.get_arglist(infilename)
outfiles_rel = genlist.get_outputs_for(curfile)
outfiles = [os.path.join(target_private_dir, of) for of in outfiles_rel]
generator_output_files += outfiles
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index e2bc262..c54abbd 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1075,8 +1075,10 @@ class Generator:
basename = os.path.splitext(plainname)[0]
return self.depfile.replace('@BASENAME@', basename).replace('@PLAINNAME@', plainname)
- def get_arglist(self):
- return self.arglist
+ def get_arglist(self, inname):
+ plainname = os.path.split(inname)[1]
+ basename = os.path.splitext(plainname)[0]
+ return [x.replace('@BASENAME@', basename).replace('@PLAINNAME@', plainname) for x in self.arglist]
def process_files(self, name, files, state, extra_args=[]):
output = GeneratedList(self, extra_args=extra_args)