[build] Mark explicitly visible symbols
Easier to maintain than a linker script. We build everything with visibility hidden by default.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/util/util.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
int runBenchmark(int argc, char* argv[]);
|
||||
MBGL_EXPORT int runBenchmark(int argc, char* argv[]);
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/util/util.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <jni/jni.hpp>
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/util/util.hpp>
|
||||
|
||||
#include "jni.hpp"
|
||||
|
||||
namespace mbgl {
|
||||
namespace android {
|
||||
|
||||
void registerNatives(JavaVM* vm);
|
||||
MBGL_EXPORT void registerNatives(JavaVM* vm);
|
||||
|
||||
} // namespace android
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "runtime.hpp"
|
||||
#include "../jni.hpp"
|
||||
#include "../jni_native.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <dlfcn.h>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/util/util.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
int runTests(int argc, char* argv[]);
|
||||
MBGL_EXPORT int runTests(int argc, char* argv[]);
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user