-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interpreter: add <lang>_(static|shared)_args
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 layers
- Loading branch information
Showing
11 changed files
with
153 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters