aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2020-01-23 16:39:51 +0000
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-09-10 07:20:41 +0000
commit7996ca3d5506c401756a29e9ed3c6969eb96f116 (patch)
treebf0c7d1eee951dd6c418fd9a253887978d4c5b20
parentfc0f0df74b5bf7327b566531b58b23620cba195a (diff)
downloadmeson-7996ca3d5506c401756a29e9ed3c6969eb96f116.zip
meson-7996ca3d5506c401756a29e9ed3c6969eb96f116.tar.gz
meson-7996ca3d5506c401756a29e9ed3c6969eb96f116.tar.bz2
ninja: Generate all STATIC_LINKER rules
Don't stop generating STATIC_LINKER rules at the first MachineChoice which isn't available (i.e. generate a STATIC_LINKER rule, even if STATIC_LINKER_FOR_BUILD isn't needed) Also warn about internal errors which lead to non-existent rule references, rather than exploding with a KeyError.
-rw-r--r--mesonbuild/backend/ninjabackend.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 0cf1d54..ded4415 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -1106,7 +1106,10 @@ int dummy;
if build.rulename != 'phony':
# reference rule
- build.rule = self.ruledict[build.rulename]
+ if build.rulename in self.ruledict:
+ build.rule = self.ruledict[build.rulename]
+ else:
+ mlog.warning("build statement for {} references non-existent rule {}".format(build.outfilenames, build.rulename))
def write_rules(self, outfile):
for b in self.build_elements:
@@ -1751,7 +1754,7 @@ int dummy;
for for_machine in MachineChoice:
static_linker = self.build.static_linker[for_machine]
if static_linker is None:
- return
+ continue
rule = 'STATIC_LINKER{}'.format(self.get_rule_suffix(for_machine))
cmdlist = []
args = ['$in']