diff options
| author | chitranjali <chitranjali189@gmail.com> | 2018-03-21 14:19:36 +0530 |
|---|---|---|
| committer | chitranjali <chitranjali189@gmail.com> | 2018-03-29 13:26:32 +0530 |
| commit | 83766313a71e79fd81bc6d89cabdb21f90fc3251 (patch) | |
| tree | 2a4ec073bbd1a1d64c20f5367ce3190b90abf759 /test cases/unit | |
| parent | b4aee4675afd9f9f4a36aea628bab4249d7addbc (diff) | |
| download | meson-83766313a71e79fd81bc6d89cabdb21f90fc3251.tar.gz | |
fix2865
Diffstat (limited to 'test cases/unit')
4 files changed, 32 insertions, 0 deletions
diff --git a/test cases/unit/25 shared_mod linking/installed_files.txt b/test cases/unit/25 shared_mod linking/installed_files.txt new file mode 100644 index 000000000..c7dab9f6f --- /dev/null +++ b/test cases/unit/25 shared_mod linking/installed_files.txt @@ -0,0 +1 @@ +usr/bin/prog?exe diff --git a/test cases/unit/25 shared_mod linking/libfile.c b/test cases/unit/25 shared_mod linking/libfile.c new file mode 100644 index 000000000..44f7667d4 --- /dev/null +++ b/test cases/unit/25 shared_mod linking/libfile.c @@ -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 func() { + return 0; +} diff --git a/test cases/unit/25 shared_mod linking/main.c b/test cases/unit/25 shared_mod linking/main.c new file mode 100644 index 000000000..12f9c984b --- /dev/null +++ b/test cases/unit/25 shared_mod linking/main.c @@ -0,0 +1,11 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_IMPORT __declspec(dllimport) +#else + #define DLL_IMPORT +#endif + +int DLL_IMPORT func(); + +int main(int argc, char **arg) { + return func(); +} diff --git a/test cases/unit/25 shared_mod linking/meson.build b/test cases/unit/25 shared_mod linking/meson.build new file mode 100644 index 000000000..d8934e948 --- /dev/null +++ b/test cases/unit/25 shared_mod linking/meson.build @@ -0,0 +1,6 @@ +project('shared library linking test', 'c', 'cpp') + +lib = shared_module('mylib', + 'libfile.c' # Split to different lines before and after the comma to test parser. + , install : false) # Don't install libraries in common tests; the path is platform-specific +exe = executable('prog', 'main.c', link_with : lib, install : true)
\ No newline at end of file |
