parent
fcee3c9eba
commit
db9a5f7fc7
7 changed files with 49 additions and 0 deletions
@ -0,0 +1,15 @@ |
||||
int func2(); |
||||
|
||||
#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() { return func2(); } |
||||
|
@ -0,0 +1,4 @@ |
||||
project('alpha project', 'c', subproject_dir: 'var/subprojects') |
||||
|
||||
b = subproject('beta') |
||||
l = shared_library('a', 'a.c', link_with : b.get_variable('lb')) |
@ -0,0 +1 @@ |
||||
|
@ -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() { |
||||
return 42; |
||||
} |
@ -0,0 +1,3 @@ |
||||
project('beta project', 'c') |
||||
|
||||
lb = shared_library('b', 'b.c') |
@ -0,0 +1,7 @@ |
||||
project('gamma project', 'c', subproject_dir: 'contrib/subprojects') |
||||
|
||||
a = subproject('alpha') |
||||
lib = a.get_variable('l') |
||||
|
||||
exe = executable('prog', 'prog.c', link_with : lib) |
||||
test('basic', exe) |
@ -0,0 +1,5 @@ |
||||
int func(); |
||||
|
||||
int main(int argc, char **argv) { |
||||
return func() == 42 ? 0 : 1; |
||||
} |
Loading…
Reference in new issue