aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmeson.py2
-rw-r--r--mparser.py6
-rw-r--r--ninjabackend.py5
3 files changed, 7 insertions, 6 deletions
diff --git a/meson.py b/meson.py
index 2f54835..3b932da 100755
--- a/meson.py
+++ b/meson.py
@@ -181,7 +181,7 @@ if __name__ == '__main__':
except Exception as e:
if isinstance(e, MesonException):
if hasattr(e, 'file') and hasattr(e, 'lineno') and hasattr(e, 'colno'):
- mlog.log(mlog.red('\nMeson encountered an error in %s:%d,%d:' % (e.file, e.lineno, e.colno)))
+ mlog.log(mlog.red('\nMeson encountered an error in file %s, line %d, column %d:' % (e.file, e.lineno, e.colno)))
else:
mlog.log(mlog.red('\nMeson encountered an error:'))
mlog.log(e)
diff --git a/mparser.py b/mparser.py
index 1f7de21..7796dd8 100644
--- a/mparser.py
+++ b/mparser.py
@@ -16,11 +16,11 @@
import re
import sys
+from coredata import MesonException
-class ParseException(Exception):
+class ParseException(MesonException):
def __init__(self, text, lineno, colno):
- super().__init__()
- self.text = text
+ super().__init__(text)
self.lineno = lineno
self.colno = colno
diff --git a/ninjabackend.py b/ninjabackend.py
index 0a5913b..e88c0c8 100644
--- a/ninjabackend.py
+++ b/ninjabackend.py
@@ -732,11 +732,12 @@ class NinjaBackend(backends.Backend):
commands += linker.get_std_link_flags()
else:
raise RuntimeError('Unknown build target type.')
- for dep in target.get_external_deps():
- commands += dep.get_link_flags()
dependencies = target.get_dependencies()
commands += self.build_target_link_arguments(linker, dependencies)
commands += target.link_flags
+ # External deps must be last because target link libraries may depend on them.
+ for dep in target.get_external_deps():
+ commands += dep.get_link_flags()
commands += linker.build_rpath_args(self.environment.get_build_dir(), target.get_rpaths())
if self.environment.coredata.coverage:
commands += linker.get_coverage_link_flags()