Which allow passing arguments specifically to the static or shared libraries. For design, this is all handled in the interpreter, by the build layer the arguments are combined into the existing fields. This limits changes required in the mid and backend layerspull/12331/head
parent
e24f430512
commit
013536fcb4
11 changed files with 153 additions and 6 deletions
@ -0,0 +1,9 @@ |
||||
## `<lang>_(shared|static)_args` for both_library, library, and build_target |
||||
|
||||
We now allow passing arguments like `c_static_args` and `c_shared_args`. This |
||||
allows a [[both_libraries]] to have arguments specific to either the shared or |
||||
static library, as well as common arguments to both. |
||||
|
||||
There is a drawback to this, since Meson now cannot re-use object files between |
||||
the static and shared targets. This could lead to much higher compilation time |
||||
when using a [[both_libraries]] if there are many sources. |
@ -0,0 +1,11 @@ |
||||
int func3(const int x) { |
||||
return x + 1; |
||||
} |
||||
|
||||
#ifndef WORK |
||||
# error "did not get static only C args" |
||||
#endif |
||||
|
||||
#ifdef BREAK |
||||
# error "got shared only C args, but shouldn't have" |
||||
#endif |
@ -0,0 +1,22 @@ |
||||
#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 |
||||
|
||||
#ifndef WORK |
||||
# error "Did not get shared only arguments" |
||||
#endif |
||||
|
||||
#ifdef BREAK |
||||
# error "got static only C args, but shouldn't have" |
||||
#endif |
||||
|
||||
int DLL_PUBLIC libfunc(void) { |
||||
return 3; |
||||
} |
Loading…
Reference in new issue