From 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:41:38 +0200 Subject: Adding upstream version 1.0.1. Signed-off-by: Daniel Baumann --- .../contrib/subprojects/alpha/a.c | 14 ++++++++++++++ .../contrib/subprojects/alpha/meson.build | 4 ++++ .../alpha/var/subprojects/wrap_files_might_be_here | 1 + .../contrib/subprojects/beta/b.c | 14 ++++++++++++++ .../contrib/subprojects/beta/meson.build | 4 ++++ .../167 subproject nested subproject dirs/meson.build | 11 +++++++++++ .../common/167 subproject nested subproject dirs/prog.c | 5 +++++ 7 files changed, 53 insertions(+) create mode 100644 test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/a.c create mode 100644 test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build create mode 100644 test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here create mode 100644 test cases/common/167 subproject nested subproject dirs/contrib/subprojects/beta/b.c create mode 100644 test cases/common/167 subproject nested subproject dirs/contrib/subprojects/beta/meson.build create mode 100644 test cases/common/167 subproject nested subproject dirs/meson.build create mode 100644 test cases/common/167 subproject nested subproject dirs/prog.c (limited to 'test cases/common/167 subproject nested subproject dirs') diff --git a/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/a.c b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/a.c new file mode 100644 index 0000000..102041e --- /dev/null +++ b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/a.c @@ -0,0 +1,14 @@ +int func2(void); + +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC func(void) { return func2(); } diff --git a/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build new file mode 100644 index 0000000..1014db1 --- /dev/null +++ b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build @@ -0,0 +1,4 @@ +project('alpha project', 'c', subproject_dir: 'var/subprojects') + +b = subproject('beta') +l = library('a', 'a.c', link_with : b.get_variable('lb')) diff --git a/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here @@ -0,0 +1 @@ + diff --git a/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/beta/b.c b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/beta/b.c new file mode 100644 index 0000000..8c07177 --- /dev/null +++ b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/beta/b.c @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC func2(void) { + return 42; +} diff --git a/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/beta/meson.build b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/beta/meson.build new file mode 100644 index 0000000..1720d3e --- /dev/null +++ b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/beta/meson.build @@ -0,0 +1,4 @@ +project('beta project', 'c') + +lb = shared_library('b', 'b.c') +notfound = dependency('', required : false) diff --git a/test cases/common/167 subproject nested subproject dirs/meson.build b/test cases/common/167 subproject nested subproject dirs/meson.build new file mode 100644 index 0000000..875eed3 --- /dev/null +++ b/test cases/common/167 subproject nested subproject dirs/meson.build @@ -0,0 +1,11 @@ +project('gamma project', 'c', subproject_dir: 'contrib/subprojects') + +a = subproject('alpha') +lib = a.get_variable('l') + +# Ensure that the dependency version is not checked for a not-found dependency +notfound = dependency('', version : '>=1.0', required : false, + fallback : ['beta', 'notfound']) + +exe = executable('prog', 'prog.c', link_with : lib) +test('basic', exe) diff --git a/test cases/common/167 subproject nested subproject dirs/prog.c b/test cases/common/167 subproject nested subproject dirs/prog.c new file mode 100644 index 0000000..27162c5 --- /dev/null +++ b/test cases/common/167 subproject nested subproject dirs/prog.c @@ -0,0 +1,5 @@ +int func(void); + +int main(void) { + return func() == 42 ? 0 : 1; +} -- cgit v1.2.3