From a849b38390c66f968678630eb44eb6061d82b333 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Tue, 23 Jul 2019 17:45:54 +0300 Subject: [build] Mark explicitly visible symbols Easier to maintain than a linker script. We build everything with visibility hidden by default. --- include/mbgl/util/util.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/mbgl') 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 -- cgit v1.2.1