diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:38 +0000 |
commit | 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch) | |
tree | 4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/common/120 extract all shared library | |
parent | Initial commit. (diff) | |
download | meson-upstream.tar.xz meson-upstream.zip |
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/common/120 extract all shared library')
8 files changed, 56 insertions, 0 deletions
diff --git a/test cases/common/120 extract all shared library/extractor.h b/test cases/common/120 extract all shared library/extractor.h new file mode 100644 index 0000000..cfb7ff6 --- /dev/null +++ b/test cases/common/120 extract all shared library/extractor.h @@ -0,0 +1,6 @@ +#pragma once + +int func1(void); +int func2(void); +int func3(void); +int func4(void); diff --git a/test cases/common/120 extract all shared library/four.c b/test cases/common/120 extract all shared library/four.c new file mode 100644 index 0000000..f67a85e --- /dev/null +++ b/test cases/common/120 extract all shared library/four.c @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func4(void) { + return 4; +} diff --git a/test cases/common/120 extract all shared library/func1234.def b/test cases/common/120 extract all shared library/func1234.def new file mode 100644 index 0000000..d62c08d --- /dev/null +++ b/test cases/common/120 extract all shared library/func1234.def @@ -0,0 +1,5 @@ +EXPORTS + func1 + func2 + func3 + func4 diff --git a/test cases/common/120 extract all shared library/meson.build b/test cases/common/120 extract all shared library/meson.build new file mode 100644 index 0000000..e7c5809 --- /dev/null +++ b/test cases/common/120 extract all shared library/meson.build @@ -0,0 +1,15 @@ +project('extract all', 'c', 'cpp') + +if meson.backend() == 'xcode' + error('MESON_SKIP_TEST: Xcode backend does not handle libraries with only objects, not sources.') +endif + +a = static_library('a', 'one.c', 'two.c') +b = static_library('b', 'three.c', 'four.c') +# libc.so cannot be used, it already exists as a reserved name +c = shared_library('cee', + objects : [a.extract_all_objects(), b.extract_all_objects()], + vs_module_defs : 'func1234.def') + +e = executable('proggie', 'prog.c', link_with : c) +test('extall', e) diff --git a/test cases/common/120 extract all shared library/one.c b/test cases/common/120 extract all shared library/one.c new file mode 100644 index 0000000..152a145 --- /dev/null +++ b/test cases/common/120 extract all shared library/one.c @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func1(void) { + return 1; +} diff --git a/test cases/common/120 extract all shared library/prog.c b/test cases/common/120 extract all shared library/prog.c new file mode 100644 index 0000000..de0cc7f --- /dev/null +++ b/test cases/common/120 extract all shared library/prog.c @@ -0,0 +1,10 @@ +#include"extractor.h" +#include<stdio.h> + +int main(void) { + if((1+2+3+4) != (func1() + func2() + func3() + func4())) { + printf("Arithmetic is fail.\n"); + return 1; + } + return 0; +} diff --git a/test cases/common/120 extract all shared library/three.c b/test cases/common/120 extract all shared library/three.c new file mode 100644 index 0000000..24604ed --- /dev/null +++ b/test cases/common/120 extract all shared library/three.c @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func3(void) { + return 3; +} diff --git a/test cases/common/120 extract all shared library/two.c b/test cases/common/120 extract all shared library/two.c new file mode 100644 index 0000000..800cd2d --- /dev/null +++ b/test cases/common/120 extract all shared library/two.c @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func2(void) { + return 2; +} |