diff options
Diffstat (limited to 'test cases/cmake/5 object library')
3 files changed, 25 insertions, 8 deletions
diff --git a/test cases/cmake/5 object library/meson.build b/test cases/cmake/5 object library/meson.build index c338136..f38a2dd 100644 --- a/test cases/cmake/5 object library/meson.build +++ b/test cases/cmake/5 object library/meson.build @@ -1,15 +1,10 @@ -project('cmake_object_lib_test', 'cpp') +project('cmake_object_lib_test', ['c', 'cpp']) dep_test = dependency('ZLIB', method: 'cmake', required: false) if not dep_test.found() error('MESON_SKIP_TEST: zlib is not installed') endif -cpp = meson.get_compiler('cpp') -if build_machine.system() == 'windows' and cpp.get_id() != 'gcc' - error('MESON_SKIP_TEST: Windows link.exe is not supported because of symbol export problems') -endif - cm = import('cmake') sub_pro = cm.subproject('cmObjLib') diff --git a/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp b/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp index 58c9413..84b7bc7 100644 --- a/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp +++ b/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp @@ -2,4 +2,15 @@ #include <string> -std::string getLibStr(); +#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 + +std::string DLL_PUBLIC getLibStr(); diff --git a/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp b/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp index 71db6b7..52ccc16 100644 --- a/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp +++ b/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp @@ -2,4 +2,15 @@ #include <string> -std::string getZlibVers(); +#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 + +std::string DLL_PUBLIC getZlibVers(); |