summaryrefslogtreecommitdiff
path: root/platform/ios/config.cmake
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-09-25 21:35:04 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-09-28 13:48:36 -0400
commit64c75b442c4d387e4867757abf49462c561e5955 (patch)
tree63f572961f6309a851d2e85ebe191e6a3cb7e5ab /platform/ios/config.cmake
parentd73e33eb62858b91212314d97bfe9cf49e857141 (diff)
downloadqtlocation-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/ios/config.cmake')
-rw-r--r--platform/ios/config.cmake64
1 files changed, 38 insertions, 26 deletions
diff --git a/platform/ios/config.cmake b/platform/ios/config.cmake
index 4e873e73ea..c3db194988 100644
--- a/platform/ios/config.cmake
+++ b/platform/ios/config.cmake
@@ -2,37 +2,29 @@ add_definitions(-DMBGL_USE_GLES2=1)
mason_use(icu VERSION 58.1-min-size)
-macro(mbgl_platform_core)
- set_xcode_property(mbgl-core IPHONEOS_DEPLOYMENT_TARGET "8.0")
- set_xcode_property(mbgl-core ENABLE_BITCODE "YES")
- set_xcode_property(mbgl-core BITCODE_GENERATION_MODE bitcode)
- set_xcode_property(mbgl-core ONLY_ACTIVE_ARCH $<$<CONFIG:Debug>:YES>)
+macro(initialize_ios_target target)
+ set_xcode_property(${target} IPHONEOS_DEPLOYMENT_TARGET "8.0")
+ set_xcode_property(${target} ENABLE_BITCODE "YES")
+ set_xcode_property(${target} BITCODE_GENERATION_MODE bitcode)
+ set_xcode_property(${target} ONLY_ACTIVE_ARCH $<$<CONFIG:Debug>:YES>)
- target_sources(mbgl-core
- # Loop
- PRIVATE platform/darwin/src/async_task.cpp
- PRIVATE platform/darwin/src/run_loop.cpp
- PRIVATE platform/darwin/src/timer.cpp
+ target_compile_options(${target}
+ PRIVATE -fobjc-arc
+ )
+endmacro()
- # 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
+include(cmake/loop-darwin.cmake)
+initialize_ios_target(mbgl-loop-darwin)
+
+
+macro(mbgl_platform_core)
+ initialize_ios_target(mbgl-core)
+
+ target_sources(mbgl-core
# 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
@@ -73,7 +65,6 @@ macro(mbgl_platform_core)
target_add_mason_package(mbgl-core PRIVATE icu)
target_compile_options(mbgl-core
- PRIVATE -fobjc-arc
PRIVATE -fvisibility=hidden
)
@@ -97,6 +88,27 @@ macro(mbgl_platform_core)
PUBLIC "-framework ImageIO"
PUBLIC "-framework MobileCoreServices"
PUBLIC "-framework SystemConfiguration"
+ )
+endmacro()
+
+
+macro(mbgl_filesource)
+ initialize_ios_target(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 -fvisibility=hidden
+ )
+
+ target_link_libraries(mbgl-filesource
PUBLIC "-lsqlite3"
+ PUBLIC "-framework Foundation"
)
endmacro()