aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-03-25 18:55:47 +0200
committerGitHub <noreply@github.com>2017-03-25 18:55:47 +0200
commitd668bea11dbc7140459ad8f9e326cbe0aa1e738f (patch)
tree23391a9d61ee061eae7cbc8b76c66d412472c19d /mesonbuild/backend/backends.py
parentaeb694d9c379fbf7c4d01c3848e6441d690ce492 (diff)
parentb35a808972a4a51438e0c76f117c557fe3a1ffa1 (diff)
downloadmeson-d668bea11dbc7140459ad8f9e326cbe0aa1e738f.zip
meson-d668bea11dbc7140459ad8f9e326cbe0aa1e738f.tar.gz
meson-d668bea11dbc7140459ad8f9e326cbe0aa1e738f.tar.bz2
Merge pull request #1496 from centricular/fix-internal-dep-order
Preserve internal-dep include order in build target dependencies
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 5939488..fa9a82f 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -375,9 +375,11 @@ class Backend:
# Set -fPIC for static libraries by default unless explicitly disabled
if isinstance(target, build.StaticLibrary) and target.pic:
commands += compiler.get_pic_args()
- # Add compile args needed to find external dependencies
- # Link args are added while generating the link command
- for dep in target.get_external_deps():
+ # Add compile args needed to find external dependencies. Link args are
+ # added while generating the link command.
+ # NOTE: We must preserve the order in which external deps are
+ # specified, so we reverse the list before iterating over it.
+ for dep in reversed(target.get_external_deps()):
commands += dep.get_compile_args()
# Qt needs -fPIC for executables
# XXX: We should move to -fPIC for all executables