mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 15:05:19 +00:00
wasm_export.h: Use "default" visibility for gcc and clang (#3957)
Since the top-level CMakelists.txt is appending `-fvisibility=hidden` to the compile options, no public symbols are exported by default. This forbids users from linking against the shared library. Using `gcc/clang` attributes [1], it is possible to override the definition for `WASM_RUNTIME_API_EXTERN` so that only required symbols are correctly exported. [1]: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes
This commit is contained in:
parent
9563909d6c
commit
296c3cc69d
|
@ -23,6 +23,8 @@
|
||||||
#else
|
#else
|
||||||
#define WASM_RUNTIME_API_EXTERN __declspec(dllimport)
|
#define WASM_RUNTIME_API_EXTERN __declspec(dllimport)
|
||||||
#endif
|
#endif
|
||||||
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
|
#define WASM_RUNTIME_API_EXTERN __attribute__((visibility("default")))
|
||||||
#else
|
#else
|
||||||
#define WASM_RUNTIME_API_EXTERN
|
#define WASM_RUNTIME_API_EXTERN
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user