diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-07-10 13:21:41 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2023-07-10 23:12:24 +0300 |
commit | 1fef03c0f04e86300bee5ff3f628752d9e27304d (patch) | |
tree | da30cc605ac56797cfa20fb7fdb2cfa87d8d55f7 /test cases | |
parent | cd63853ad2928023ea045fb331866d547e9f49fc (diff) | |
download | meson-1fef03c0f04e86300bee5ff3f628752d9e27304d.zip meson-1fef03c0f04e86300bee5ff3f628752d9e27304d.tar.gz meson-1fef03c0f04e86300bee5ff3f628752d9e27304d.tar.bz2 |
build: dependencies should come after link_with on link command
This fixes regression caused by
https://github.com/mesonbuild/meson/commit/3162b901cab46d66a30c66a4406195523714ecdc
that changes the order in which libraries are put on the link command.
In addition, that commit was wrong because libraries from dependencies
were processed before process_compiler() is called, which that commit
wanted to avoid.
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/unit/113 complex link cases/meson.build | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test cases/unit/113 complex link cases/meson.build b/test cases/unit/113 complex link cases/meson.build index 31753ed..04e6281 100644 --- a/test cases/unit/113 complex link cases/meson.build +++ b/test cases/unit/113 complex link cases/meson.build @@ -47,3 +47,14 @@ s1 = static_library('t7-s1', 's1.c') s2 = static_library('t7-s2', 's2.c') s3 = static_library('t7-s3', 's3.c', link_with: [s1, s2], install: true) e = executable('t7-e1', 'main.c', link_with: s3) + +# Regression test: s3 should come last in the linker command. This seems to be +# required for at least backward compatibility reasons: +# https://github.com/mesonbuild/meson/pull/11957#issuecomment-1629243208 +s1 = static_library('t8-s1', 's1.c') +s2 = static_library('t8-s2', 's2.c') +s3 = static_library('t8-s3', 's3.c') +e = executable('t8-e1', 'main.c', + link_with: [s1, s2], + dependencies: declare_dependency(link_with: s3), +) |