diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-09-25 21:35:04 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-09-28 13:48:36 -0400 |
commit | 64c75b442c4d387e4867757abf49462c561e5955 (patch) | |
tree | 63f572961f6309a851d2e85ebe191e6a3cb7e5ab /platform/macos | |
parent | d73e33eb62858b91212314d97bfe9cf49e857141 (diff) | |
download | qtlocation-mapboxgl-64c75b442c4d387e4867757abf49462c561e5955.tar.gz |
[build] split out DefaultFileSource and dependents to a separate target
We don't want to link it into the node bindings, so keep it in a separate target
Diffstat (limited to 'platform/macos')
-rw-r--r-- | platform/macos/config.cmake | 47 | ||||
-rw-r--r-- | platform/macos/macos.xcodeproj/project.pbxproj | 30 |
2 files changed, 52 insertions, 25 deletions
diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake index bb2cc9ac1c..aca99f9b40 100644 --- a/platform/macos/config.cmake +++ b/platform/macos/config.cmake @@ -6,29 +6,11 @@ mason_use(gtest VERSION 1.8.0) mason_use(benchmark VERSION 1.2.0) mason_use(icu VERSION 58.1-min-size) +include(cmake/loop-uv.cmake) include(cmake/loop-darwin.cmake) macro(mbgl_platform_core) target_sources(mbgl-core - # File source - PRIVATE platform/darwin/src/http_file_source.mm - PRIVATE platform/default/asset_file_source.cpp - PRIVATE platform/default/default_file_source.cpp - PRIVATE platform/default/local_file_source.cpp - PRIVATE platform/default/online_file_source.cpp - - # Default styles - PRIVATE platform/default/mbgl/util/default_styles.hpp - - # Offline - PRIVATE platform/default/mbgl/storage/offline.cpp - PRIVATE platform/default/mbgl/storage/offline_database.cpp - PRIVATE platform/default/mbgl/storage/offline_database.hpp - PRIVATE platform/default/mbgl/storage/offline_download.cpp - PRIVATE platform/default/mbgl/storage/offline_download.hpp - PRIVATE platform/default/sqlite3.cpp - PRIVATE platform/default/sqlite3.hpp - # Misc PRIVATE platform/darwin/mbgl/storage/reachability.h PRIVATE platform/darwin/mbgl/storage/reachability.m @@ -86,23 +68,47 @@ macro(mbgl_platform_core) PUBLIC "-framework ImageIO" PUBLIC "-framework CoreServices" PUBLIC "-framework SystemConfiguration" + ) +endmacro() + + +macro(mbgl_filesource) + target_sources(mbgl-filesource + # File source + PRIVATE platform/darwin/src/http_file_source.mm + + # Database + PRIVATE platform/default/sqlite3.cpp + ) + + target_compile_options(mbgl-filesource + PRIVATE -fobjc-arc + PRIVATE -fvisibility=hidden + ) + + target_link_libraries(mbgl-filesource PUBLIC "-lsqlite3" + PUBLIC "-framework Foundation" ) endmacro() macro(mbgl_platform_glfw) target_link_libraries(mbgl-glfw + PRIVATE mbgl-filesource PRIVATE mbgl-loop-darwin ) + target_compile_options(mbgl-glfw PRIVATE -fvisibility=hidden ) + endmacro() macro(mbgl_platform_render) target_link_libraries(mbgl-render + PRIVATE mbgl-filesource PRIVATE mbgl-loop-darwin ) target_compile_options(mbgl-render @@ -113,6 +119,7 @@ endmacro() macro(mbgl_platform_offline) target_link_libraries(mbgl-offline + PRIVATE mbgl-filesource PRIVATE mbgl-loop-darwin ) target_compile_options(mbgl-offline @@ -137,6 +144,7 @@ macro(mbgl_platform_test) ) target_link_libraries(mbgl-test + PRIVATE mbgl-filesource PRIVATE mbgl-loop-darwin ) endmacro() @@ -157,6 +165,7 @@ macro(mbgl_platform_benchmark) ) target_link_libraries(mbgl-benchmark + PRIVATE mbgl-filesource PRIVATE mbgl-loop-darwin ) endmacro() diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index fcb0544479..34f8860686 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -80,6 +80,8 @@ 556660D61E1D07E400E2C41B /* MGLVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */; }; 558DE7A61E56161C00C7916D /* MGLFoundation_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 558DE7A41E56161C00C7916D /* MGLFoundation_Private.h */; }; 558DE7A71E56161C00C7916D /* MGLFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 558DE7A51E56161C00C7916D /* MGLFoundation.mm */; }; + 55D120A31F7906E6004B6D81 /* libmbgl-filesource.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D120A41F7906E6004B6D81 /* libmbgl-filesource.a */; }; + 55D120A51F790A0C004B6D81 /* libmbgl-filesource.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D120A41F7906E6004B6D81 /* libmbgl-filesource.a */; }; 55E2AD111E5B0A6900E8C587 /* MGLOfflineStorageTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55E2AD101E5B0A6900E8C587 /* MGLOfflineStorageTests.mm */; }; 92092EF01F5EB10E00AF5130 /* MGLMapSnapshotter.h in Headers */ = {isa = PBXBuildFile; fileRef = 92092EEE1F5EB10E00AF5130 /* MGLMapSnapshotter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 92092EF11F5EB10E00AF5130 /* MGLMapSnapshotter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 92092EEF1F5EB10E00AF5130 /* MGLMapSnapshotter.mm */; }; @@ -353,6 +355,7 @@ 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLVersionNumber.m; path = ../../darwin/test/MGLVersionNumber.m; sourceTree = "<group>"; }; 558DE7A41E56161C00C7916D /* MGLFoundation_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFoundation_Private.h; sourceTree = "<group>"; }; 558DE7A51E56161C00C7916D /* MGLFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFoundation.mm; sourceTree = "<group>"; }; + 55D120A41F7906E6004B6D81 /* libmbgl-filesource.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libmbgl-filesource.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 55D9B4B01D005D3900C1CCE2 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 55E2AD101E5B0A6900E8C587 /* MGLOfflineStorageTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLOfflineStorageTests.mm; path = ../../darwin/test/MGLOfflineStorageTests.mm; sourceTree = "<group>"; }; 55FE0E8D1D100A0900FD240B /* config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = config.xcconfig; path = ../../build/macos/config.xcconfig; sourceTree = "<group>"; }; @@ -609,6 +612,7 @@ buildActionMask = 2147483647; files = ( 5548BE781D09E718005DDE81 /* libmbgl-core.a in Frameworks */, + 55D120A31F7906E6004B6D81 /* libmbgl-filesource.a in Frameworks */, 52B5D17F1E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -618,6 +622,7 @@ buildActionMask = 2147483647; files = ( DAE0DD7A1D5F015A005A6BB1 /* libmbgl-core.a in Frameworks */, + 55D120A51F790A0C004B6D81 /* libmbgl-filesource.a in Frameworks */, DAE6C3321CC30DB200DB3429 /* Mapbox.framework in Frameworks */, 52B5D1801E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */, ); @@ -979,6 +984,7 @@ DAE6C31E1CC308BC00DB3429 /* Frameworks */ = { isa = PBXGroup; children = ( + 55D120A41F7906E6004B6D81 /* libmbgl-filesource.a */, 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */, 55D9B4B01D005D3900C1CCE2 /* libz.tbd */, 52BECB091CC5A26F009CD791 /* SystemConfiguration.framework */, @@ -1818,7 +1824,10 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; + HEADER_SEARCH_PATHS = ( + "$(mbgl_core_INCLUDE_DIRECTORIES)", + "$(mbgl_filesource_INCLUDE_DIRECTORIES)", + ); INFOPLIST_FILE = "$(SRCROOT)/sdk/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; @@ -1829,7 +1838,7 @@ OTHER_CFLAGS = "-fvisibility=hidden"; OTHER_LDFLAGS = ( "$(mbgl_core_LINK_LIBRARIES)", - "$(mbgl_loop_LINK_LIBRARIES)", + "$(mbgl_filesource_LINK_LIBRARIES)", ); PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL; PRODUCT_NAME = Mapbox; @@ -1852,14 +1861,17 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; + HEADER_SEARCH_PATHS = ( + "$(mbgl_core_INCLUDE_DIRECTORIES)", + "$(mbgl_filesource_INCLUDE_DIRECTORIES)", + ); 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)", + "$(mbgl_filesource_LINK_LIBRARIES)", ); PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL; PRODUCT_NAME = Mapbox; @@ -1876,7 +1888,10 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; - HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; + HEADER_SEARCH_PATHS = ( + "$(mbgl_core_INCLUDE_DIRECTORIES)", + "$(mbgl_filesource_INCLUDE_DIRECTORIES)", + ); INFOPLIST_FILE = test/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -1905,7 +1920,10 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; - HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; + HEADER_SEARCH_PATHS = ( + "$(mbgl_core_INCLUDE_DIRECTORIES)", + "$(mbgl_filesource_INCLUDE_DIRECTORIES)", + ); INFOPLIST_FILE = test/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; OTHER_CFLAGS = "-fvisibility=hidden"; |