diff options
Diffstat (limited to 'platform/macos')
-rw-r--r-- | platform/macos/config.cmake | 21 | ||||
-rw-r--r-- | platform/macos/macos.xcodeproj/project.pbxproj | 18 | ||||
-rw-r--r-- | platform/macos/src/MGLAnnotationImage.h | 3 | ||||
-rw-r--r-- | platform/macos/src/MGLAttributionButton.h | 2 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.h | 3 | ||||
-rw-r--r-- | platform/macos/src/Mapbox.h | 6 |
6 files changed, 36 insertions, 17 deletions
diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake index dab507d42a..2e4b7a01b2 100644 --- a/platform/macos/config.cmake +++ b/platform/macos/config.cmake @@ -9,8 +9,6 @@ mason_use(icu VERSION 58.1) include(cmake/loop-darwin.cmake) macro(mbgl_platform_core) - set_xcode_property(mbgl-core GCC_SYMBOLS_PRIVATE_EXTERN YES) - target_sources(mbgl-core # File source PRIVATE platform/darwin/src/http_file_source.mm @@ -62,6 +60,7 @@ macro(mbgl_platform_core) target_compile_options(mbgl-core PRIVATE -fobjc-arc + PRIVATE -fvisibility=hidden ) target_include_directories(mbgl-core @@ -85,8 +84,6 @@ endmacro() macro(mbgl_platform_render) - set_xcode_property(mbgl-render GCC_SYMBOLS_PRIVATE_EXTERN YES) - target_link_libraries(mbgl-render PRIVATE mbgl-loop PRIVATE "-framework Foundation" @@ -100,8 +97,6 @@ endmacro() macro(mbgl_platform_offline) - set_xcode_property(mbgl-offline GCC_SYMBOLS_PRIVATE_EXTERN YES) - target_link_libraries(mbgl-offline PRIVATE mbgl-loop PRIVATE "-framework Foundation" @@ -115,8 +110,6 @@ endmacro() macro(mbgl_platform_test) - set_xcode_property(mbgl-test GCC_SYMBOLS_PRIVATE_EXTERN YES) - target_sources(mbgl-test PRIVATE test/src/main.cpp ) @@ -127,6 +120,10 @@ macro(mbgl_platform_test) COMPILE_FLAGS -DWORK_DIRECTORY="${CMAKE_SOURCE_DIR}" ) + target_compile_options(mbgl-test + PRIVATE -fvisibility=hidden + ) + target_link_libraries(mbgl-test PRIVATE mbgl-loop PRIVATE "-framework Foundation" @@ -139,7 +136,9 @@ macro(mbgl_platform_test) endmacro() macro(mbgl_platform_benchmark) - set_xcode_property(mbgl-benchmark GCC_SYMBOLS_PRIVATE_EXTERN YES) + target_compile_options(mbgl-benchmark + PRIVATE -fvisibility=hidden + ) target_sources(mbgl-benchmark PRIVATE benchmark/src/main.cpp @@ -163,7 +162,9 @@ macro(mbgl_platform_benchmark) endmacro() macro(mbgl_platform_node) - set_xcode_property(mbgl-node GCC_SYMBOLS_PRIVATE_EXTERN YES) + target_compile_options(mbgl-node + PRIVATE -fvisibility=hidden + ) target_link_libraries(mbgl-node PRIVATE "-framework Foundation" diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index f00f56e058..6f6aad2436 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -58,6 +58,8 @@ 40E1601D1DF217D6005EA6D9 /* MGLStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */; }; 52BECB0A1CC5A26F009CD791 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52BECB091CC5A26F009CD791 /* SystemConfiguration.framework */; }; 5548BE781D09E718005DDE81 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3451CC31D1200DB3429 /* libmbgl-core.a */; }; + 556660C61E1BEA0100E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C51E1BEA0100E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556660D61E1D07E400E2C41B /* MGLVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */; }; 558F18221D0B13B100123F46 /* libmbgl-loop.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 558F18211D0B13B000123F46 /* libmbgl-loop.a */; }; 55D9B4B11D005D3900C1CCE2 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D9B4B01D005D3900C1CCE2 /* libz.tbd */; }; DA00FC8A1D5EEAC3009AABC8 /* MGLAttributionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA00FC881D5EEAC3009AABC8 /* MGLAttributionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -305,6 +307,8 @@ 52BECB091CC5A26F009CD791 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 5548BE791D0ACBB2005DDE81 /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop-darwin.a"; path = "cmake/Debug/libmbgl-loop-darwin.a"; sourceTree = "<group>"; }; 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop-darwin.a"; path = "cmake/Debug/libmbgl-loop-darwin.a"; sourceTree = "<group>"; }; + 556660C51E1BEA0100E2C41B /* MGLFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLFoundation.h; sourceTree = "<group>"; }; + 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLVersionNumber.m; path = ../../darwin/test/MGLVersionNumber.m; sourceTree = "<group>"; }; 558F18211D0B13B000123F46 /* libmbgl-loop.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop.a"; path = "../../build/osx/Debug/libmbgl-loop.a"; sourceTree = "<group>"; }; 55D9B4B01D005D3900C1CCE2 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 55FE0E8D1D100A0900FD240B /* config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = config.xcconfig; path = ../../build/macos/config.xcconfig; sourceTree = "<group>"; }; @@ -882,6 +886,7 @@ DAE6C3CB1CC34BD800DB3429 /* MGLOfflineStorageTests.m */, DAE6C3CC1CC34BD800DB3429 /* MGLStyleTests.mm */, DD58A4C71D822C6200E1F038 /* MGLExpressionTests.mm */, + 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */, DAE6C33A1CC30DB200DB3429 /* Info.plist */, DA2784FD1DF03060001D5B8D /* Media.xcassets */, ); @@ -903,6 +908,7 @@ DA00FC881D5EEAC3009AABC8 /* MGLAttributionInfo.h */, DAF0D8151DFE6B1800B28378 /* MGLAttributionInfo_Private.h */, DA00FC891D5EEAC3009AABC8 /* MGLAttributionInfo.mm */, + 556660C51E1BEA0100E2C41B /* MGLFoundation.h */, DAE6C34D1CC31E0400DB3429 /* MGLMapCamera.h */, DAE6C36E1CC31E2A00DB3429 /* MGLMapCamera.mm */, DD0902B01DB1AC6400C5BDCE /* MGLNetworkConfiguration.h */, @@ -957,6 +963,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + 556660C61E1BEA0100E2C41B /* MGLFoundation.h in Headers */, DA8F258F1D51CA600010E6B5 /* MGLRasterStyleLayer.h in Headers */, 3508EC641D749D39009B0EE4 /* NSExpression+MGLAdditions.h in Headers */, DAE6C38D1CC31E2A00DB3429 /* MGLOfflineRegion_Private.h in Headers */, @@ -1322,6 +1329,7 @@ 3599A3E81DF70E2000E77FB2 /* MGLStyleValueTests.m in Sources */, DAEDC4321D6033F1000224FF /* MGLAttributionInfoTests.m in Sources */, DA0CD58E1CF56F5800A5F5A5 /* MGLFeatureTests.mm in Sources */, + 556660D61E1D07E400E2C41B /* MGLVersionNumber.m in Sources */, DA2207BC1DC076940002F84D /* MGLStyleValueTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1489,6 +1497,7 @@ COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = "$(SRCROOT)/app/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + OTHER_CFLAGS = "-fvisibility=hidden"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL; PRODUCT_NAME = "Mapbox GL"; }; @@ -1501,6 +1510,7 @@ COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = "$(SRCROOT)/app/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + OTHER_CFLAGS = "-fvisibility=hidden"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL; PRODUCT_NAME = "Mapbox GL"; }; @@ -1542,7 +1552,6 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - GCC_SYMBOLS_PRIVATE_EXTERN = YES; HEADER_SEARCH_PATHS = ( "$(mbgl_core_INCLUDE_DIRECTORIES)", "$(mbgl_loop_INCLUDE_DIRECTORIES)", @@ -1550,6 +1559,7 @@ INFOPLIST_FILE = "$(SRCROOT)/sdk/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + OTHER_CFLAGS = "-fvisibility=hidden"; OTHER_LDFLAGS = ( "$(mbgl_core_LINK_LIBRARIES)", "$(mbgl_loop_LINK_LIBRARIES)", @@ -1558,7 +1568,7 @@ PRODUCT_NAME = Mapbox; SKIP_INSTALL = YES; VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; + VERSION_INFO_PREFIX = "__attribute__((visibility (\"default\"))) "; }; name = Debug; }; @@ -1575,7 +1585,6 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - GCC_SYMBOLS_PRIVATE_EXTERN = YES; HEADER_SEARCH_PATHS = ( "$(mbgl_core_INCLUDE_DIRECTORIES)", "$(mbgl_loop_INCLUDE_DIRECTORIES)", @@ -1583,6 +1592,7 @@ INFOPLIST_FILE = "$(SRCROOT)/sdk/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + OTHER_CFLAGS = "-fvisibility=hidden"; OTHER_LDFLAGS = ( "$(mbgl_core_LINK_LIBRARIES)", "$(mbgl_loop_LINK_LIBRARIES)", @@ -1592,7 +1602,7 @@ SKIP_INSTALL = YES; STRIP_STYLE = "non-global"; VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; + VERSION_INFO_PREFIX = "__attribute__((visibility (\"default\"))) "; }; name = Release; }; diff --git a/platform/macos/src/MGLAnnotationImage.h b/platform/macos/src/MGLAnnotationImage.h index 37d43d7277..d41fd32ec4 100644 --- a/platform/macos/src/MGLAnnotationImage.h +++ b/platform/macos/src/MGLAnnotationImage.h @@ -1,5 +1,7 @@ #import <AppKit/AppKit.h> +#import "MGLFoundation.h" + NS_ASSUME_NONNULL_BEGIN /** @@ -8,6 +10,7 @@ NS_ASSUME_NONNULL_BEGIN `NSImage` objects with annotation-related metadata. They may be recycled later and put into a reuse queue that is maintained by the map view. */ +MGL_EXPORT @interface MGLAnnotationImage : NSObject #pragma mark Initializing and Preparing the Image Object diff --git a/platform/macos/src/MGLAttributionButton.h b/platform/macos/src/MGLAttributionButton.h index 88fcdadf78..3e0b53a6d0 100644 --- a/platform/macos/src/MGLAttributionButton.h +++ b/platform/macos/src/MGLAttributionButton.h @@ -1,5 +1,6 @@ #import <Cocoa/Cocoa.h> +#import "MGLFoundation.h" #import "MGLTypes.h" NS_ASSUME_NONNULL_BEGIN @@ -7,6 +8,7 @@ NS_ASSUME_NONNULL_BEGIN @class MGLAttributionInfo; /// Button that looks like a hyperlink and opens a URL. +MGL_EXPORT @interface MGLAttributionButton : NSButton /// Returns an `MGLAttributionButton` instance with the given info. diff --git a/platform/macos/src/MGLMapView.h b/platform/macos/src/MGLMapView.h index ea87f3b338..c934ba6e97 100644 --- a/platform/macos/src/MGLMapView.h +++ b/platform/macos/src/MGLMapView.h @@ -1,6 +1,7 @@ #import <Cocoa/Cocoa.h> #import <CoreLocation/CoreLocation.h> +#import "MGLFoundation.h" #import "MGLTypes.h" #import "MGLGeometry.h" @@ -47,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN @note You are responsible for getting permission to use the map data and for ensuring that your use adheres to the relevant terms of use. */ -IB_DESIGNABLE +MGL_EXPORT IB_DESIGNABLE @interface MGLMapView : NSView #pragma mark Creating Instances diff --git a/platform/macos/src/Mapbox.h b/platform/macos/src/Mapbox.h index 524ff1a93a..b16aaf7e67 100644 --- a/platform/macos/src/Mapbox.h +++ b/platform/macos/src/Mapbox.h @@ -1,10 +1,12 @@ #import <Cocoa/Cocoa.h> +#import "MGLFoundation.h" + /// Project version number for Mapbox. -FOUNDATION_EXPORT double MapboxVersionNumber; +FOUNDATION_EXPORT MGL_EXPORT double MapboxVersionNumber; /// Project version string for Mapbox. -FOUNDATION_EXPORT const unsigned char MapboxVersionString[]; +FOUNDATION_EXPORT MGL_EXPORT const unsigned char MapboxVersionString[]; #import "MGLAccountManager.h" #import "MGLAnnotation.h" |