This is only needed on Linux and BSD. So, we always unconditionally enable self.pic for Windows and OS X.pull/856/head
parent
ee8b3b12a0
commit
ce1393609f
5 changed files with 51 additions and 3 deletions
@ -0,0 +1,11 @@ |
||||
project('statchain', 'c') |
||||
|
||||
host_system = host_machine.system() |
||||
if host_system == 'windows' or host_system == 'darwin' |
||||
error('Test only fails on Linux and BSD') |
||||
endif |
||||
|
||||
statlib = static_library('stat', 'stat.c', pic : false) |
||||
shlib2 = shared_library('shr2', 'shlib2.c', link_with : statlib) |
||||
exe = executable('prog', 'prog.c', link_with : shlib2) |
||||
test('runtest', exe) |
@ -0,0 +1,10 @@ |
||||
int shlibfunc2(); |
||||
int statlibfunc(); |
||||
|
||||
int main(int argc, char **argv) { |
||||
if (statlibfunc() != 42) |
||||
return 1; |
||||
if (shlibfunc2() != 24) |
||||
return 1; |
||||
return 0; |
||||
} |
@ -0,0 +1,16 @@ |
||||
#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 statlibfunc(void); |
||||
|
||||
int DLL_PUBLIC shlibfunc2(void) { |
||||
return 24; |
||||
} |
@ -0,0 +1,3 @@ |
||||
int statlibfunc() { |
||||
return 42; |
||||
} |
Loading…
Reference in new issue