summaryrefslogtreecommitdiff
path: root/platform/android/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/android/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/android/config.cmake')
-rw-r--r--platform/android/config.cmake52
1 files changed, 32 insertions, 20 deletions
diff --git a/platform/android/config.cmake b/platform/android/config.cmake
index 227334e0b5..8dd537d36e 100644
--- a/platform/android/config.cmake
+++ b/platform/android/config.cmake
@@ -31,25 +31,6 @@ macro(mbgl_platform_core)
PRIVATE platform/android/src/run_loop_impl.hpp
PRIVATE platform/android/src/timer.cpp
- # File source
- PRIVATE platform/android/src/http_file_source.cpp
- PRIVATE platform/android/src/asset_manager.hpp
- PRIVATE platform/android/src/asset_manager_file_source.cpp
- PRIVATE platform/android/src/asset_manager_file_source.hpp
- PRIVATE platform/default/default_file_source.cpp
- PRIVATE platform/default/asset_file_source.cpp
- PRIVATE platform/default/local_file_source.cpp
- PRIVATE platform/default/online_file_source.cpp
-
- # 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/android/src/logging_android.cpp
PRIVATE platform/android/src/thread.cpp
@@ -95,7 +76,6 @@ macro(mbgl_platform_core)
PUBLIC platform/default
)
- target_add_mason_package(mbgl-core PUBLIC sqlite)
target_add_mason_package(mbgl-core PUBLIC nunicode)
target_add_mason_package(mbgl-core PUBLIC geojson)
target_add_mason_package(mbgl-core PUBLIC jni.hpp)
@@ -120,6 +100,37 @@ macro(mbgl_platform_core)
)
endmacro()
+
+macro(mbgl_filesource)
+ target_sources(mbgl-filesource
+ # File source
+ PRIVATE platform/android/src/http_file_source.cpp
+ PRIVATE platform/android/src/asset_manager.hpp
+ PRIVATE platform/android/src/asset_manager_file_source.cpp
+ PRIVATE platform/android/src/asset_manager_file_source.hpp
+
+ # Database
+ PRIVATE platform/default/sqlite3.cpp
+ )
+
+ target_add_mason_package(mbgl-filesource PUBLIC sqlite)
+ target_add_mason_package(mbgl-filesource PUBLIC jni.hpp)
+
+ target_compile_options(mbgl-filesource
+ PRIVATE -fvisibility=hidden
+ PRIVATE -ffunction-sections
+ PRIVATE -fdata-sections
+ )
+
+ target_link_libraries(mbgl-filesource
+ PUBLIC -llog
+ PUBLIC -landroid
+ PUBLIC -lstdc++
+ PUBLIC -latomic
+ )
+endmacro()
+
+
## Main library ##
add_library(mbgl-android STATIC
@@ -300,6 +311,7 @@ target_compile_options(mbgl-android
)
target_link_libraries(mbgl-android
+ PUBLIC mbgl-filesource
PUBLIC mbgl-core
)