From 040fa07e36f959a16c54436f86323b5354b484fe Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 30 Sep 2017 03:56:36 +0530 Subject: [PATCH] tests/common/145: Move each target into its own subdir This helps test whether /WHOLEARCHIVE and --whole-archive arguments resolve into the right subdirectories. --- .../145 whole archive/allofme/meson.build | 1 + .../common/145 whole archive/exe/meson.build | 2 ++ .../common/145 whole archive/exe2/meson.build | 1 + .../common/145 whole archive/meson.build | 21 +++++++------------ .../145 whole archive/shlib/meson.build | 4 ++++ .../145 whole archive/stlib/meson.build | 1 + .../145 whole archive/wholeshlib/meson.build | 1 + 7 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 test cases/common/145 whole archive/allofme/meson.build create mode 100644 test cases/common/145 whole archive/exe/meson.build create mode 100644 test cases/common/145 whole archive/exe2/meson.build create mode 100644 test cases/common/145 whole archive/shlib/meson.build create mode 100644 test cases/common/145 whole archive/stlib/meson.build create mode 100644 test cases/common/145 whole archive/wholeshlib/meson.build diff --git a/test cases/common/145 whole archive/allofme/meson.build b/test cases/common/145 whole archive/allofme/meson.build new file mode 100644 index 000000000..f5c2027b5 --- /dev/null +++ b/test cases/common/145 whole archive/allofme/meson.build @@ -0,0 +1 @@ +stlib = static_library('allofme', '../libfile.c') diff --git a/test cases/common/145 whole archive/exe/meson.build b/test cases/common/145 whole archive/exe/meson.build new file mode 100644 index 000000000..f47a24627 --- /dev/null +++ b/test cases/common/145 whole archive/exe/meson.build @@ -0,0 +1,2 @@ +exe = executable('prog', '../prog.c', + link_with : dylib) diff --git a/test cases/common/145 whole archive/exe2/meson.build b/test cases/common/145 whole archive/exe2/meson.build new file mode 100644 index 000000000..5365f03b6 --- /dev/null +++ b/test cases/common/145 whole archive/exe2/meson.build @@ -0,0 +1 @@ +exe2 = executable('prog2', '../prog.c', link_with : dylib2) diff --git a/test cases/common/145 whole archive/meson.build b/test cases/common/145 whole archive/meson.build index 6689c3c40..617ae0340 100644 --- a/test cases/common/145 whole archive/meson.build +++ b/test cases/common/145 whole archive/meson.build @@ -1,5 +1,7 @@ project('whole archive', 'c') +add_project_arguments('-I' + meson.source_root(), language : 'c') + cc = meson.get_compiler('c') if cc.get_id() == 'msvc' @@ -8,22 +10,15 @@ if cc.get_id() == 'msvc' endif endif -stlib = static_library('allofme', 'libfile.c') - -# Nothing in dylib.c uses func1, so the linker would throw it -# away and thus linking the exe would fail. -dylib = shared_library('shlib', 'dylib.c', - link_whole : stlib) - -exe = executable('prog', 'prog.c', - link_with : dylib) +subdir('allofme') +subdir('shlib') +subdir('exe') test('prog', exe) # link_whole only -static = static_library('static', 'dylib.c') -dylib2 = shared_library('link_whole', link_whole : [stlib, static]) - -exe2 = executable('prog2', 'prog.c', link_with : dylib2) +subdir('stlib') +subdir('wholeshlib') +subdir('exe2') test('prog2', exe2) diff --git a/test cases/common/145 whole archive/shlib/meson.build b/test cases/common/145 whole archive/shlib/meson.build new file mode 100644 index 000000000..34a1b78a9 --- /dev/null +++ b/test cases/common/145 whole archive/shlib/meson.build @@ -0,0 +1,4 @@ +# Nothing in dylib.c uses func1, so the linker would throw it +# away and thus linking the exe would fail. +dylib = shared_library('shlib', '../dylib.c', + link_whole : stlib) diff --git a/test cases/common/145 whole archive/stlib/meson.build b/test cases/common/145 whole archive/stlib/meson.build new file mode 100644 index 000000000..07a434e06 --- /dev/null +++ b/test cases/common/145 whole archive/stlib/meson.build @@ -0,0 +1 @@ +static = static_library('static', '../dylib.c') diff --git a/test cases/common/145 whole archive/wholeshlib/meson.build b/test cases/common/145 whole archive/wholeshlib/meson.build new file mode 100644 index 000000000..69a1995ce --- /dev/null +++ b/test cases/common/145 whole archive/wholeshlib/meson.build @@ -0,0 +1 @@ +dylib2 = shared_library('link_whole', link_whole : [stlib, static])