aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/ninjabackend.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-03-23 08:32:01 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-03-23 10:26:29 +0530
commit7f80f81ac9c00ed328566d9aec5140b4f9d1d21d (patch)
treebd5efaf8b6cde4683a1852f3f3759fbc46a727dc /mesonbuild/backend/ninjabackend.py
parent8482286236f6d91dfaa02e4254e0e15430e67eb2 (diff)
downloadmeson-7f80f81ac9c00ed328566d9aec5140b4f9d1d21d.zip
meson-7f80f81ac9c00ed328566d9aec5140b4f9d1d21d.tar.gz
meson-7f80f81ac9c00ed328566d9aec5140b4f9d1d21d.tar.bz2
Preserve the order of internal deps in a target
We were adding them to the CompilerArgs instance in the order in which they are specified, which is wrong because later dependencies would override previous ones. Add them in the reverse order instead. Closes https://github.com/mesonbuild/meson/issues/1495
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r--mesonbuild/backend/ninjabackend.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 1acfe78..e0106b2 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -1831,10 +1831,12 @@ rule FORTRAN_DEP_HACK
# and from `include_directories:` of internal deps of the target.
#
# Target include dirs should override internal deps include dirs.
+ # This is handled in BuildTarget.process_kwargs()
#
# Include dirs from internal deps should override include dirs from
- # external deps.
- for i in target.get_include_dirs():
+ # external deps and must maintain the order in which they are specified.
+ # Hence, we must reverse the list so that the order is preserved.
+ for i in reversed(target.get_include_dirs()):
basedir = i.get_curdir()
for d in i.get_incdirs():
# Avoid superfluous '/.' at the end of paths when d is '.'