diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2021-10-25 16:46:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-25 16:46:11 +0200 |
| commit | 24ad521d3e74762cee08ca91867551d33a9e7b9f (patch) | |
| tree | 99383710e05b1e0bb046ce086ad522f54d55d5bc /include | |
| parent | 9817fe7db31d5a0716876e1f8f7f1a9ba4b91be0 (diff) | |
| parent | 6e9b324ab7bf5909df7e68409e060282db14fa54 (diff) | |
| download | PROJ-24ad521d3e74762cee08ca91867551d33a9e7b9f.tar.gz PROJ-24ad521d3e74762cee08ca91867551d33a9e7b9f.zip | |
Merge pull request #2912 from rouault/cmake_static_build
CMake: revise how we deal with symbol export and static builds
Diffstat (limited to 'include')
| -rw-r--r-- | include/proj/util.hpp | 63 |
1 files changed, 29 insertions, 34 deletions
diff --git a/include/proj/util.hpp b/include/proj/util.hpp index acc793cc..3f5e208e 100644 --- a/include/proj/util.hpp +++ b/include/proj/util.hpp @@ -50,43 +50,38 @@ namespace proj {} //! @cond Doxygen_Suppress #ifndef PROJ_DLL -#ifdef PROJ_MSVC_DLL_EXPORT -#define PROJ_DLL __declspec(dllexport) -#elif defined(PROJ_MSVC_DLL_IMPORT) -#define PROJ_DLL __declspec(dllimport) -#elif defined(__GNUC__) -#define PROJ_DLL __attribute__((visibility("default"))) -#else -#define PROJ_DLL -#endif +# if defined(_MSC_VER) +# ifdef PROJ_MSVC_DLL_EXPORT +# define PROJ_DLL __declspec(dllexport) +# else +# define PROJ_DLL __declspec(dllimport) +# endif +# elif defined(__GNUC__) +# define PROJ_DLL __attribute__ ((visibility("default"))) +# else +# define PROJ_DLL +# endif #endif #ifndef PROJ_MSVC_DLL - -#ifdef PROJ_MSVC_DLL_EXPORT -#define PROJ_MSVC_DLL PROJ_DLL -#define PROJ_GCC_DLL -#define PROJ_INTERNAL -#elif defined(PROJ_MSVC_DLL_IMPORT) -#define PROJ_MSVC_DLL PROJ_DLL -#define PROJ_GCC_DLL -#define PROJ_INTERNAL -#elif defined(__GNUC__) -#define PROJ_MSVC_DLL -#define PROJ_GCC_DLL PROJ_DLL -#if !defined(__MINGW32__) -#define PROJ_INTERNAL __attribute__((visibility("hidden"))) -#else -#define PROJ_INTERNAL -#endif -#else -#define PROJ_MSVC_DLL -#define PROJ_GCC_DLL -#define PROJ_INTERNAL -#endif - -#define PROJ_FOR_TEST PROJ_DLL - +# if defined(_MSC_VER) +# define PROJ_MSVC_DLL PROJ_DLL +# define PROJ_GCC_DLL +# define PROJ_INTERNAL +# elif defined(__GNUC__) +# define PROJ_MSVC_DLL +# define PROJ_GCC_DLL PROJ_DLL +# if !defined(__MINGW32__) +# define PROJ_INTERNAL __attribute__((visibility("hidden"))) +# else +# define PROJ_INTERNAL +# endif +# else +# define PROJ_MSVC_DLL +# define PROJ_GCC_DLL +# define PROJ_INTERNAL +# endif +# define PROJ_FOR_TEST PROJ_DLL #endif #include "nn.hpp" |
