This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cc5aed
commit 8980cf2
Showing
3 changed files
with
162 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#Include to use build specific variables | ||
include(${CMAKE_CURRENT_BINARY_DIR}/toolchain.cmake) | ||
|
||
mason_use(geojson 0.1.4) | ||
mason_use(jni.hpp 2.0.0) | ||
mason_use(libjpeg-turbo 1.4.2) | ||
mason_use(libpng 1.6.20) | ||
mason_use(libzip 0.11.2) | ||
mason_use(nunicode 1.6) | ||
mason_use(sqlite 3.9.1) | ||
mason_use(zlib system) | ||
|
||
macro(mbgl_platform_core) | ||
|
||
target_sources(mbgl-core | ||
# Loop | ||
PRIVATE platform/android/src/thread.cpp | ||
PRIVATE platform/android/src/async_task.cpp | ||
PRIVATE platform/android/src/run_loop.cpp | ||
PRIVATE platform/android/src/timer.cpp | ||
|
||
# File source | ||
PRIVATE platform/android/src/http_file_source.cpp | ||
PRIVATE platform/android/src/asset_file_source.cpp | ||
PRIVATE platform/default/default_file_source.cpp | ||
PRIVATE platform/default/online_file_source.cpp | ||
|
||
# Offline | ||
# PRIVATE include/mbgl/storage/offline.hpp | ||
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/native_map_view.cpp | ||
PRIVATE platform/android/src/log_android.cpp | ||
PRIVATE platform/default/string_stdlib.cpp | ||
|
||
# Image handling | ||
PRIVATE platform/default/image.cpp | ||
PRIVATE platform/default/png_reader.cpp | ||
PRIVATE platform/default/jpeg_reader.cpp | ||
|
||
# Headless view | ||
# TODO | ||
) | ||
|
||
target_include_directories(mbgl-core | ||
PRIVATE 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 libpng) | ||
target_add_mason_package(mbgl-core PUBLIC libjpeg-turbo) | ||
target_add_mason_package(mbgl-core PUBLIC zlib) | ||
target_add_mason_package(mbgl-core PUBLIC libzip) | ||
target_add_mason_package(mbgl-core PUBLIC geojson) | ||
target_add_mason_package(mbgl-core PUBLIC jni.hpp) | ||
|
||
target_link_libraries(mbgl-core | ||
PUBLIC -llog | ||
PUBLIC -landroid | ||
PUBLIC -lEGL | ||
PUBLIC -lGLESv2 | ||
PUBLIC -lstdc++ | ||
PUBLIC -latomic | ||
) | ||
endmacro() | ||
|
||
add_library(mapbox-gl SHARED | ||
platform/android/src/jni.cpp | ||
platform/android/src/attach_env.cpp | ||
) | ||
|
||
target_link_libraries(mapbox-gl | ||
PUBLIC mbgl-core | ||
) | ||
|
||
add_library(example-custom-layer SHARED | ||
platform/android/src/example_custom_layer.cpp | ||
) | ||
|
||
target_link_libraries(example-custom-layer | ||
PRIVATE mbgl-core | ||
) | ||
|
||
set(ANDROID_SDK_PROJECT_DIR ${CMAKE_SOURCE_DIR}/platform/android/MapboxGLAndroidSDK) | ||
set(ANDROID_JNI_TARGET_DIR ${ANDROID_SDK_PROJECT_DIR}/src/main/jniLibs/${ANDROID_JNIDIR}/) | ||
set(ANDROID_ASSETS_TARGET_DIR ${ANDROID_SDK_PROJECT_DIR}/src/main/assets/) | ||
|
||
add_custom_target(copy-files | ||
DEPENDS mapbox-gl | ||
DEPENDS example-custom-layer | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ANDROID_JNI_TARGET_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:mapbox-gl> ${ANDROID_JNI_TARGET_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:example-custom-layer> ${ANDROID_JNI_TARGET_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ANDROID_ASSETS_TARGET_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/common/ca-bundle.crt ${ANDROID_ASSETS_TARGET_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/platform/default/resources/api_mapbox_com-digicert.der ${ANDROID_ASSETS_TARGET_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/platform/default/resources/api_mapbox_com-geotrust.der ${ANDROID_ASSETS_TARGET_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/platform/default/resources/star_tilestream_net.der ${ANDROID_ASSETS_TARGET_DIR} | ||
) | ||
|
||
add_custom_target(_all ALL | ||
DEPENDS mapbox-gl | ||
DEPENDS example-custom-layer | ||
DEPENDS copy-files | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters