summaryrefslogtreecommitdiff
path: root/include/mbgl/util
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-07-23 17:45:54 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-09-17 12:28:55 +0300
commita849b38390c66f968678630eb44eb6061d82b333 (patch)
treeb41926d00e546ab5bbf36c7608bae3716b5154ec /include/mbgl/util
parent79670593de7ce2a7bfcf86d373dd145f5c52cb55 (diff)
downloadqtlocation-mapboxgl-a849b38390c66f968678630eb44eb6061d82b333.tar.gz
[build] Mark explicitly visible symbols
Easier to maintain than a linker script. We build everything with visibility hidden by default.
Diffstat (limited to 'include/mbgl/util')
-rw-r--r--include/mbgl/util/util.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/mbgl/util/util.hpp b/include/mbgl/util/util.hpp
index 7960b40299..178f1cba48 100644
--- a/include/mbgl/util/util.hpp
+++ b/include/mbgl/util/util.hpp
@@ -19,3 +19,24 @@
#else
#define MBGL_CONSTEXPR inline
#endif
+
+// Compiler defines for making symbols visible, otherwise they
+// will be defined as hidden by default.
+
+#if defined WIN32
+ #ifdef MBGL_BUILDING_LIB
+ #ifdef __GNUC__
+ #define MBGL_EXPORT __attribute__((dllexport))
+ #else
+ #define MBGL_EXPORT __declspec(dllexport)
+ #endif
+ #else
+ #ifdef __GNUC__
+ #define MBGL_EXPORT __attribute__((dllimport))
+ #else
+ #define MBGL_EXPORT __declspec(dllimport)
+ #endif
+ #endif
+#else
+ #define MBGL_EXPORT __attribute__((visibility ("default"))) // NOLINT
+#endif