diff options
| author | Xavier Claessens <xavier.claessens@collabora.com> | 2019-09-18 21:23:03 -0400 |
|---|---|---|
| committer | Xavier Claessens <xclaesse@gmail.com> | 2019-10-01 13:06:45 -0400 |
| commit | 484b721369957100ee6d2b76f17224a583e2bd86 (patch) | |
| tree | 50e1340d6f72e584e82ce6718ff75accdc9d3ac3 /test cases/unit | |
| parent | f396c71c52a7a3589c2998fce000843fc1e73835 (diff) | |
| download | meson-484b721369957100ee6d2b76f17224a583e2bd86.tar.gz | |
Fix link_with of a static library with an uninstalled static library
Diffstat (limited to 'test cases/unit')
| -rw-r--r-- | test cases/unit/69 static link/lib/func3.c | 4 | ||||
| -rw-r--r-- | test cases/unit/69 static link/lib/func4.c | 6 | ||||
| -rw-r--r-- | test cases/unit/69 static link/lib/meson.build | 8 | ||||
| -rw-r--r-- | test cases/unit/69 static link/meson.build | 4 | ||||
| -rw-r--r-- | test cases/unit/69 static link/test2.c | 6 |
5 files changed, 28 insertions, 0 deletions
diff --git a/test cases/unit/69 static link/lib/func3.c b/test cases/unit/69 static link/lib/func3.c new file mode 100644 index 000000000..04f9f8939 --- /dev/null +++ b/test cases/unit/69 static link/lib/func3.c @@ -0,0 +1,4 @@ +int func3() +{ + return 1; +} diff --git a/test cases/unit/69 static link/lib/func4.c b/test cases/unit/69 static link/lib/func4.c new file mode 100644 index 000000000..c44c99099 --- /dev/null +++ b/test cases/unit/69 static link/lib/func4.c @@ -0,0 +1,6 @@ +int func3(); + +int func4() +{ + return func3() + 1; +} diff --git a/test cases/unit/69 static link/lib/meson.build b/test cases/unit/69 static link/lib/meson.build index 0d7f10882..f5cc76b62 100644 --- a/test cases/unit/69 static link/lib/meson.build +++ b/test cases/unit/69 static link/lib/meson.build @@ -6,3 +6,11 @@ libfunc1 = static_library('func1', 'func1.c', libfunc2 = static_library('func2', 'func2.c', link_whole : libfunc1, install : true) + +# Same as above, but with link_with instead of link_whole, +# libfunc4 should contain both func3() and func4() symbols +libfunc3 = static_library('func3', 'func3.c', + install : false) +libfunc4 = static_library('func4', 'func4.c', + link_with : libfunc3, + install : true) diff --git a/test cases/unit/69 static link/meson.build b/test cases/unit/69 static link/meson.build index 5126df668..4d5d074ac 100644 --- a/test cases/unit/69 static link/meson.build +++ b/test cases/unit/69 static link/meson.build @@ -5,3 +5,7 @@ cc = meson.get_compiler('c') # Verify that installed libfunc2.a is usable func2_dep = cc.find_library('func2') test('test1', executable('test1', 'test1.c', dependencies : func2_dep)) + +# Verify that installed libfunc4.a is usable +func4_dep = cc.find_library('func4') +test('test2', executable('test2', 'test2.c', dependencies : func4_dep)) diff --git a/test cases/unit/69 static link/test2.c b/test cases/unit/69 static link/test2.c new file mode 100644 index 000000000..561422af0 --- /dev/null +++ b/test cases/unit/69 static link/test2.c @@ -0,0 +1,6 @@ +int func4(); + +int main(int argc, char *argv[]) +{ + return func4() == 2 ? 0 : 1; +} |
