[cmake] Use MLN prefix instead of MBGL (#1054)

Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
Tadej Novak
2023-04-28 00:34:38 +02:00
committed by GitHub
parent e4501c789d
commit 95c7e3818d
43 changed files with 247 additions and 246 deletions

View File

@@ -15,8 +15,8 @@ cmake ../source/ \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_INSTALL_PREFIX=../install \ -DCMAKE_INSTALL_PREFIX=../install \
-DMBGL_WITH_QT=ON \ -DMLN_WITH_QT=ON \
-DMBGL_QT_DEPLOYMENT=ON \ -DMLN_QT_DEPLOYMENT=ON \
-DMBGL_QT_LIBRARY_ONLY=ON -DMLN_QT_LIBRARY_ONLY=ON
ninja ninja
ninja install ninja install

View File

@@ -13,9 +13,9 @@ qt-cmake ../source/ \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_INSTALL_PREFIX=../install \ -DCMAKE_INSTALL_PREFIX=../install \
-DMBGL_WITH_QT=ON \ -DMLN_WITH_QT=ON \
-DMBGL_QT_DEPLOYMENT=ON \ -DMLN_QT_DEPLOYMENT=ON \
-DMBGL_QT_LIBRARY_ONLY=ON -DMLN_QT_LIBRARY_ONLY=ON
ninja ninja
ninja install ninja install
cd ../install cd ../install

View File

@@ -37,7 +37,7 @@ jobs:
JOBS: 8 JOBS: 8
BUILDTYPE: Debug BUILDTYPE: Debug
IS_LOCAL_DEVELOPMENT: false IS_LOCAL_DEVELOPMENT: false
MBGL_ANDROID_STL: c++_static MLN_ANDROID_STL: c++_static
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@@ -34,7 +34,7 @@ jobs:
JOBS: 8 JOBS: 8
BUILDTYPE: Debug BUILDTYPE: Debug
IS_LOCAL_DEVELOPMENT: false IS_LOCAL_DEVELOPMENT: false
MBGL_ANDROID_STL: c++_static MLN_ANDROID_STL: c++_static
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@@ -48,7 +48,7 @@ jobs:
- name: Build Maplibre GL Core - name: Build Maplibre GL Core
run: | run: |
cmake --version cmake --version
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Debug -DMBGL_WITH_CLANG_TIDY=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMBGL_WITH_COVERAGE=ON cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Debug -DMLN_WITH_CLANG_TIDY=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMLN_WITH_COVERAGE=ON
cmake --build build --target mbgl-core mbgl-test-runner mbgl-render-test-runner cmake --build build --target mbgl-core mbgl-test-runner mbgl-render-test-runner
- name: Archive mbgl-test-runner - name: Archive mbgl-test-runner

View File

@@ -194,9 +194,9 @@ jobs:
-DCMAKE_INSTALL_PREFIX="../install" \ -DCMAKE_INSTALL_PREFIX="../install" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="${DEPLOYMENT_TARGET}" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="${DEPLOYMENT_TARGET}" \
-DCMAKE_OSX_ARCHITECTURES="${DEPLOYMENT_ARCH}" \ -DCMAKE_OSX_ARCHITECTURES="${DEPLOYMENT_ARCH}" \
-DMBGL_WITH_QT=ON \ -DMLN_WITH_QT=ON \
-DMBGL_QT_DEPLOYMENT=ON \ -DMLN_QT_DEPLOYMENT=ON \
-DMBGL_QT_LIBRARY_ONLY=ON -DMLN_QT_LIBRARY_ONLY=ON
ninja ninja
ninja install ninja install
@@ -221,9 +221,9 @@ jobs:
-DCMAKE_C_COMPILER_LAUNCHER="ccache.exe" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache.exe" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache.exe" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache.exe" \
-DCMAKE_INSTALL_PREFIX="../install" \ -DCMAKE_INSTALL_PREFIX="../install" \
-DMBGL_WITH_QT=ON \ -DMLN_WITH_QT=ON \
-DMBGL_QT_DEPLOYMENT=ON \ -DMLN_QT_DEPLOYMENT=ON \
-DMBGL_QT_LIBRARY_ONLY=ON -DMLN_QT_LIBRARY_ONLY=ON
ninja.exe ninja.exe
ninja.exe install ninja.exe install

View File

@@ -26,7 +26,7 @@ cc_library(
"src", "src",
], ],
local_defines = [ local_defines = [
r"MBGL_VERSION_REV=\"standalone\"", r"MLN_VERSION_REV=\"standalone\"",
], ],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [

View File

@@ -5,9 +5,10 @@
### ✨ New features ### ✨ New features
- *...Add new stuff here...* - *...Add new stuff here...*
- [windows] Added windows build support for core applications and node [#707](https://github.com/maplibre/maplibre-native/pull/707) - [core] All CMake properties are now prefixed `MLN_*` [1054](https://github.com/maplibre/maplibre-gl-native/pull/1054).
- [core] Add `ClientOptions` to configure client information [#365](https://github.com/maplibre/maplibre-native/pull/365). - [windows] Added windows build support for core applications and node [#707](https://github.com/maplibre/maplibre-gl-native/pull/707)
- [node] Add workflow to create node binary releases for Ubuntu 20.04 x64 and MacOS 12 x64/arm64 [#378](https://github.com/maplibre/maplibre-native/pull/378), [#459](https://github.com/maplibre/maplibre-native/pull/459). - [core] Add `ClientOptions` to configure client information [#365](https://github.com/maplibre/maplibre-gl-native/pull/365).
- [node] Add workflow to create node binary releases for Ubuntu 20.04 x64 and MacOS 12 x64/arm64 [#378](https://github.com/maplibre/maplibre-gl-native/pull/378), [#459](https://github.com/maplibre/maplibre-gl-native/pull/459).
### ✨ Technical Improvements ### ✨ Technical Improvements

View File

@@ -1,18 +1,18 @@
cmake_minimum_required(VERSION 3.10 FATAL_ERROR) cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
option(MBGL_WITH_CORE_ONLY "Build only the core bits, no platform code" OFF) option(MLN_WITH_CORE_ONLY "Build only the core bits, no platform code" OFF)
option(MBGL_WITH_CLANG_TIDY "Build with clang-tidy checks enabled" OFF) option(MLN_WITH_CLANG_TIDY "Build with clang-tidy checks enabled" OFF)
option(MBGL_WITH_COVERAGE "Enable code coverage collection" OFF) option(MLN_WITH_COVERAGE "Enable code coverage collection" OFF)
option(MBGL_WITH_QT "Build MapLibre Native Qt bindings" OFF) option(MLN_WITH_QT "Build MapLibre Native Qt bindings" OFF)
option(MLN_WITH_NODE "Build MapLibre Native Node.js bindings" OFF) option(MLN_WITH_NODE "Build MapLibre Native Node.js bindings" OFF)
option(MBGL_WITH_SANITIZER "Use [address|thread|undefined] here" OFF) option(MLN_WITH_SANITIZER "Use [address|thread|undefined] here" OFF)
option(MBGL_WITH_RTTI "Compile with runtime type information" OFF) option(MLN_WITH_RTTI "Compile with runtime type information" OFF)
option(MBGL_WITH_OPENGL "Build with OpenGL renderer" ON) option(MLN_WITH_OPENGL "Build with OpenGL renderer" ON)
option(MBGL_WITH_EGL "Build with EGL renderer" OFF) option(MLN_WITH_EGL "Build with EGL renderer" OFF)
option(MBGL_WITH_OSMESA "Build with OSMesa (Software) renderer" OFF) option(MLN_WITH_OSMESA "Build with OSMesa (Software) renderer" OFF)
option(MBGL_WITH_WERROR "Make all compilation warnings errors" ON) option(MLN_WITH_WERROR "Make all compilation warnings errors" ON)
if (MBGL_WITH_CLANG_TIDY) if (MLN_WITH_CLANG_TIDY)
find_program(CLANG_TIDY_COMMAND NAMES clang-tidy) find_program(CLANG_TIDY_COMMAND NAMES clang-tidy)
if(NOT CLANG_TIDY_COMMAND) if(NOT CLANG_TIDY_COMMAND)
message(FATAL_ERROR "ENABLE_CLANG_TIDY is ON but clang-tidy is not found!") message(FATAL_ERROR "ENABLE_CLANG_TIDY is ON but clang-tidy is not found!")
@@ -25,11 +25,11 @@ if (MBGL_WITH_CLANG_TIDY)
set(CLANG_TIDY_COMMAND "${CLANG_TIDY_COMMAND};--extra-arg=-Wno-error=unknown-warning-option") set(CLANG_TIDY_COMMAND "${CLANG_TIDY_COMMAND};--extra-arg=-Wno-error=unknown-warning-option")
endif() endif()
if (MBGL_WITH_QT AND NOT CMAKE_OSX_DEPLOYMENT_TARGET) if (MLN_WITH_QT AND NOT CMAKE_OSX_DEPLOYMENT_TARGET)
set(CMAKE_OSX_DEPLOYMENT_TARGET 13.0) set(CMAKE_OSX_DEPLOYMENT_TARGET 13.0)
endif() endif()
if(WIN32 AND NOT MBGL_WITH_QT) if(WIN32 AND NOT MLN_WITH_QT)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/platform/windows/custom-toolchain.cmake) set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/platform/windows/custom-toolchain.cmake)
endif() endif()
@@ -58,35 +58,35 @@ set(UBSAN_BLACKLIST ${PROJECT_SOURCE_DIR}/scripts/ubsan.blacklist)
target_compile_options( target_compile_options(
mbgl-compiler-options mbgl-compiler-options
INTERFACE INTERFACE
$<$<BOOL:${MBGL_WITH_COVERAGE}>:--coverage> $<$<BOOL:${MLN_WITH_COVERAGE}>:--coverage>
$<$<BOOL:${MBGL_WITH_SANITIZER}>:-DSANITIZE> $<$<BOOL:${MLN_WITH_SANITIZER}>:-DSANITIZE>
$<$<BOOL:${MBGL_WITH_SANITIZER}>:-fno-omit-frame-pointer> $<$<BOOL:${MLN_WITH_SANITIZER}>:-fno-omit-frame-pointer>
$<$<BOOL:${MBGL_WITH_SANITIZER}>:-fno-optimize-sibling-calls> $<$<BOOL:${MLN_WITH_SANITIZER}>:-fno-optimize-sibling-calls>
$<$<STREQUAL:${MBGL_WITH_SANITIZER},address>:-fsanitize=address> $<$<STREQUAL:${MLN_WITH_SANITIZER},address>:-fsanitize=address>
$<$<STREQUAL:${MBGL_WITH_SANITIZER},thread>:-fsanitize=thread> $<$<STREQUAL:${MLN_WITH_SANITIZER},thread>:-fsanitize=thread>
$<$<STREQUAL:${MBGL_WITH_SANITIZER},undefined>:-fsanitize=implicit-conversion, $<$<STREQUAL:${MLN_WITH_SANITIZER},undefined>:-fsanitize=implicit-conversion,
-fsanitize-blacklist=${UBSAN_BLACKLIST}> -fsanitize-blacklist=${UBSAN_BLACKLIST}>
$<$<STREQUAL:${MBGL_WITH_SANITIZER},undefined>:-fsanitize=undefined, $<$<STREQUAL:${MLN_WITH_SANITIZER},undefined>:-fsanitize=undefined,
-fsanitize-blacklist=${UBSAN_BLACKLIST}> -fsanitize-blacklist=${UBSAN_BLACKLIST}>
$<$<STREQUAL:${MBGL_WITH_SANITIZER},undefined>:-fsanitize=unsigned-integer-overflow, $<$<STREQUAL:${MLN_WITH_SANITIZER},undefined>:-fsanitize=unsigned-integer-overflow,
-fsanitize-blacklist=${UBSAN_BLACKLIST}> -fsanitize-blacklist=${UBSAN_BLACKLIST}>
$<$<STREQUAL:${MBGL_WITH_SANITIZER},undefined>:-fsanitize=nullability, $<$<STREQUAL:${MLN_WITH_SANITIZER},undefined>:-fsanitize=nullability,
-fsanitize-blacklist=${UBSAN_BLACKLIST}> -fsanitize-blacklist=${UBSAN_BLACKLIST}>
$<$<STREQUAL:${MBGL_WITH_SANITIZER},undefined>:-fsanitize=float-divide-by-zero, $<$<STREQUAL:${MLN_WITH_SANITIZER},undefined>:-fsanitize=float-divide-by-zero,
-fsanitize-blacklist=${UBSAN_BLACKLIST}> -fsanitize-blacklist=${UBSAN_BLACKLIST}>
$<$<PLATFORM_ID:iOS>:-fembed-bitcode> $<$<PLATFORM_ID:iOS>:-fembed-bitcode>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<OR:$<BOOL:${MBGL_WITH_RTTI}>,$<CXX_COMPILER_ID:MSVC>>>>:-fno-rtti> $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<OR:$<BOOL:${MLN_WITH_RTTI}>,$<CXX_COMPILER_ID:MSVC>>>>:-fno-rtti>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<PLATFORM_ID:Windows>>>:-Wall> $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<PLATFORM_ID:Windows>>>:-Wall>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<PLATFORM_ID:Windows>>>:-Wshadow> $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<PLATFORM_ID:Windows>>>:-Wshadow>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<PLATFORM_ID:Windows>>>:-Wextra> $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<PLATFORM_ID:Windows>>>:-Wextra>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<PLATFORM_ID:Windows>>,$<BOOL:${MBGL_WITH_WERROR}>>:-Werror> $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<PLATFORM_ID:Windows>>,$<BOOL:${MLN_WITH_WERROR}>>:-Werror>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<PLATFORM_ID:Android>>:-Wno-error=tautological-constant-compare> $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<PLATFORM_ID:Android>>:-Wno-error=tautological-constant-compare>
$<$<CXX_COMPILER_ID:GNU>:-Wno-error=maybe-uninitialized> $<$<CXX_COMPILER_ID:GNU>:-Wno-error=maybe-uninitialized>
$<$<CXX_COMPILER_ID:GNU>:-Wno-error=return-type> $<$<CXX_COMPILER_ID:GNU>:-Wno-error=return-type>
$<$<CXX_COMPILER_ID:GNU>:-Wno-error=unknown-pragmas> $<$<CXX_COMPILER_ID:GNU>:-Wno-error=unknown-pragmas>
$<$<AND:$<CXX_COMPILER_ID:AppleClang>,$<NOT:$<BOOL:${MBGL_WITH_QT}>>>:-Wno-error=deprecated-declarations> $<$<AND:$<CXX_COMPILER_ID:AppleClang>,$<NOT:$<BOOL:${MLN_WITH_QT}>>>:-Wno-error=deprecated-declarations>
$<$<AND:$<CXX_COMPILER_ID:AppleClang>,$<NOT:$<BOOL:${MBGL_WITH_QT}>>>:-Wno-error=unused-parameter> $<$<AND:$<CXX_COMPILER_ID:AppleClang>,$<NOT:$<BOOL:${MLN_WITH_QT}>>>:-Wno-error=unused-parameter>
$<$<AND:$<CXX_COMPILER_ID:AppleClang>,$<NOT:$<BOOL:${MBGL_WITH_QT}>>>:-Wno-error=unused-property-ivar> $<$<AND:$<CXX_COMPILER_ID:AppleClang>,$<NOT:$<BOOL:${MLN_WITH_QT}>>>:-Wno-error=unused-property-ivar>
$<$<CXX_COMPILER_ID:MSVC>:/utf-8> $<$<CXX_COMPILER_ID:MSVC>:/utf-8>
$<$<CXX_COMPILER_ID:MSVC>:/WX> # all warnings as errors $<$<CXX_COMPILER_ID:MSVC>:/WX> # all warnings as errors
$<$<CXX_COMPILER_ID:MSVC>:/EHsc> # exceptions $<$<CXX_COMPILER_ID:MSVC>:/EHsc> # exceptions
@@ -100,10 +100,10 @@ target_compile_options(
target_link_libraries( target_link_libraries(
mbgl-compiler-options mbgl-compiler-options
INTERFACE INTERFACE
$<$<BOOL:${MBGL_WITH_COVERAGE}>:--coverage> $<$<BOOL:${MLN_WITH_COVERAGE}>:--coverage>
$<$<STREQUAL:${MBGL_WITH_SANITIZER},address>:-fsanitize=address> $<$<STREQUAL:${MLN_WITH_SANITIZER},address>:-fsanitize=address>
$<$<STREQUAL:${MBGL_WITH_SANITIZER},thread>:-fsanitize=thread> $<$<STREQUAL:${MLN_WITH_SANITIZER},thread>:-fsanitize=thread>
$<$<STREQUAL:${MBGL_WITH_SANITIZER},undefined>:-fsanitize=undefined> $<$<STREQUAL:${MLN_WITH_SANITIZER},undefined>:-fsanitize=undefined>
) )
cmake_policy(SET CMP0063 NEW) cmake_policy(SET CMP0063 NEW)
@@ -124,7 +124,7 @@ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
if(MBGL_WITH_QT AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0") if(MLN_WITH_QT AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
add_library(mbgl-core OBJECT) add_library(mbgl-core OBJECT)
else() else()
add_library(mbgl-core STATIC) add_library(mbgl-core STATIC)
@@ -871,7 +871,7 @@ list(APPEND SRC_FILES
${PROJECT_SOURCE_DIR}/src/mbgl/util/work_request.cpp ${PROJECT_SOURCE_DIR}/src/mbgl/util/work_request.cpp
) )
if(MBGL_WITH_OPENGL) if(MLN_WITH_OPENGL)
message(STATUS "Configuring GL-Native with OpenGL renderer backend") message(STATUS "Configuring GL-Native with OpenGL renderer backend")
target_compile_definitions( target_compile_definitions(
mbgl-core mbgl-core
@@ -984,7 +984,7 @@ target_sources(
${SRC_FILES} ${SRC_FILES}
) )
if (MBGL_WITH_CLANG_TIDY) if (MLN_WITH_CLANG_TIDY)
set_target_properties(mbgl-core PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}") set_target_properties(mbgl-core PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
endif() endif()
@@ -999,18 +999,18 @@ if(EXISTS ${PROJECT_SOURCE_DIR}/.git/HEAD)
--short=8 --short=8
HEAD HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE MBGL_VERSION_REV OUTPUT_VARIABLE MLN_VERSION_REV
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
else() else()
set(MBGL_VERSION_REV 00000000) set(MLN_VERSION_REV 00000000)
endif() endif()
set_source_files_properties( set_source_files_properties(
${PROJECT_SOURCE_DIR}/src/mbgl/util/version.cpp ${PROJECT_SOURCE_DIR}/src/mbgl/util/version.cpp
PROPERTIES PROPERTIES
COMPILE_DEFINITIONS COMPILE_DEFINITIONS
MBGL_VERSION_REV="${MBGL_VERSION_REV}" MBGL_VERSION_REV="${MLN_VERSION_REV}"
) )
target_include_directories( target_include_directories(
@@ -1110,13 +1110,13 @@ add_library(
Mapbox::Map ALIAS mbgl-core Mapbox::Map ALIAS mbgl-core
) )
if(MBGL_WITH_CORE_ONLY) if(MLN_WITH_CORE_ONLY)
return() return()
endif() endif()
include(${PROJECT_SOURCE_DIR}/scripts/license.cmake) include(${PROJECT_SOURCE_DIR}/scripts/license.cmake)
if(MBGL_WITH_QT) if(MLN_WITH_QT)
include(${PROJECT_SOURCE_DIR}/platform/qt/qt.cmake) include(${PROJECT_SOURCE_DIR}/platform/qt/qt.cmake)
elseif(CMAKE_SYSTEM_NAME STREQUAL Android) elseif(CMAKE_SYSTEM_NAME STREQUAL Android)
include(${PROJECT_SOURCE_DIR}/platform/android/android.cmake) include(${PROJECT_SOURCE_DIR}/platform/android/android.cmake)

View File

@@ -17,11 +17,11 @@ MapLibre Native shares a single C++ core library with all platforms. To build it
To build, run the following from the root directory To build, run the following from the root directory
```bash ```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DMBGL_WITH_CORE_ONLY=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMBGL_WITH_COVERAGE=ON cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DMLN_WITH_CORE_ONLY=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMLN_WITH_COVERAGE=ON
``` ```
`CMAKE_BUILD_TYPE=Debug` will build debug artifacts. You can opt to omit it if that is not necessary. `CMAKE_BUILD_TYPE=Debug` will build debug artifacts. You can opt to omit it if that is not necessary.
`MBGL_WITH_CORE_ONLY=ON` will build only the core libraries. `MLN_WITH_CORE_ONLY=ON` will build only the core libraries.
Built artifacts should be available on `build` folder. Built artifacts should be available on `build` folder.

View File

@@ -76,7 +76,7 @@ or any of the platform make files:
* iOS developers can use [Xcode](https://developer.apple.com/support/debugging/). See also [Advanced Debugging with Xcode and LLDB](https://developer.apple.com/videos/play/wwdc2018/412/). * iOS developers can use [Xcode](https://developer.apple.com/support/debugging/). See also [Advanced Debugging with Xcode and LLDB](https://developer.apple.com/videos/play/wwdc2018/412/).
## Static Analysis ## Static Analysis
We use [`clang-tidy`](https://clang.llvm.org/extra/clang-tidy/) for static analysis and run it on CI for each pull request. If you want to run it locally use `-DMBGL_WITH_CLANG_TIDY=ON` CMake option and just run regular build. For the list of enabled checks please see: We use [`clang-tidy`](https://clang.llvm.org/extra/clang-tidy/) for static analysis and run it on CI for each pull request. If you want to run it locally use `-DMLN_WITH_CLANG_TIDY=ON` CMake option and just run regular build. For the list of enabled checks please see:
[`.clang-tidy`](.clang-tidy) and [`test/.clang-tidy`](test/.clang-tidy)(for tests we are less strict and use different set of checks). [`.clang-tidy`](.clang-tidy) and [`test/.clang-tidy`](test/.clang-tidy)(for tests we are less strict and use different set of checks).
## Logging in C++ ## Logging in C++

View File

@@ -52,11 +52,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
endif() endif()
# Needed for testing private classes # Needed for testing private classes
get_target_property(MBGL_CORE_PRIVATE_LIBRARIES mbgl-core LINK_LIBRARIES) get_target_property(MLN_CORE_PRIVATE_LIBRARIES mbgl-core LINK_LIBRARIES)
target_link_libraries( target_link_libraries(
mbgl-benchmark mbgl-benchmark
PRIVATE ${MBGL_CORE_PRIVATE_LIBRARIES} mbgl-vendor-benchmark mbgl-compiler-options PRIVATE ${MLN_CORE_PRIVATE_LIBRARIES} mbgl-vendor-benchmark mbgl-compiler-options
PUBLIC mbgl-core PUBLIC mbgl-core
) )

View File

@@ -34,10 +34,10 @@ target_link_libraries(
set_property(TARGET mbgl-expression-test PROPERTY FOLDER Executables) set_property(TARGET mbgl-expression-test PROPERTY FOLDER Executables)
string(RANDOM LENGTH 5 ALPHABET 0123456789 MBGL_EXPRESSION_TEST_SEED) string(RANDOM LENGTH 5 ALPHABET 0123456789 MLN_EXPRESSION_TEST_SEED)
add_test( add_test(
NAME mbgl-expression-test NAME mbgl-expression-test
COMMAND mbgl-expression-test -s --seed=${MBGL_EXPRESSION_TEST_SEED} COMMAND mbgl-expression-test -s --seed=${MLN_EXPRESSION_TEST_SEED}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
) )

View File

@@ -31,23 +31,23 @@ endif
#### Android targets ########################################################### #### Android targets ###########################################################
MBGL_ANDROID_ABIS = arm-v7;armeabi-v7a MLN_ANDROID_ABIS = arm-v7;armeabi-v7a
MBGL_ANDROID_ABIS += arm-v8;arm64-v8a MLN_ANDROID_ABIS += arm-v8;arm64-v8a
MBGL_ANDROID_ABIS += x86;x86 MLN_ANDROID_ABIS += x86;x86
MBGL_ANDROID_ABIS += x86-64;x86_64 MLN_ANDROID_ABIS += x86-64;x86_64
MBGL_ANDROID_LOCAL_WORK_DIR = /data/local/tmp/core-tests MLN_ANDROID_LOCAL_WORK_DIR = /data/local/tmp/core-tests
MBGL_ANDROID_LOCAL_BENCHMARK_DIR = /data/local/tmp/benchmark MLN_ANDROID_LOCAL_BENCHMARK_DIR = /data/local/tmp/benchmark
MBGL_ANDROID_LIBDIR = lib$(if $(filter arm-v8 x86-64,$1),64) MLN_ANDROID_LIBDIR = lib$(if $(filter arm-v8 x86-64,$1),64)
MBGL_ANDROID_DALVIKVM = dalvikvm$(if $(filter arm-v8 x86-64,$1),64,32) MLN_ANDROID_DALVIKVM = dalvikvm$(if $(filter arm-v8 x86-64,$1),64,32)
MBGL_ANDROID_APK_SUFFIX = $(if $(filter Release,$(BUILDTYPE)),release,debug) MLN_ANDROID_APK_SUFFIX = $(if $(filter Release,$(BUILDTYPE)),release,debug)
MBGL_ANDROID_CORE_TEST_DIR = MapboxGLAndroidSDK/.externalNativeBuild/cmake/$(buildtype)/$2/core-tests MLN_ANDROID_CORE_TEST_DIR = MapboxGLAndroidSDK/.externalNativeBuild/cmake/$(buildtype)/$2/core-tests
MBGL_ANDROID_BENCHMARK_DIR = MapboxGLAndroidSDK/.externalNativeBuild/cmake/$(buildtype)/$2/benchmark MLN_ANDROID_BENCHMARK_DIR = MapboxGLAndroidSDK/.externalNativeBuild/cmake/$(buildtype)/$2/benchmark
MBGL_ANDROID_STL ?= c++_static MLN_ANDROID_STL ?= c++_static
SOCKET_TIMEOUT = 360000 SOCKET_TIMEOUT = 360000
CONNECTION_TIMEOUT = 360000 CONNECTION_TIMEOUT = 360000
MBGL_ANDROID_GRADLE = ./gradlew --parallel --max-workers=$(JOBS) -Pmapbox.buildtype=$(buildtype) -Pmapbox.stl=$(MBGL_ANDROID_STL) -Dorg.gradle.internal.http.socketTimeout=$(SOCKET_TIMEOUT) -Dorg.gradle.internal.http.connectionTimeout=$(CONNECTION_TIMEOUT) MLN_ANDROID_GRADLE = ./gradlew --parallel --max-workers=$(JOBS) -Pmapbox.buildtype=$(buildtype) -Pmapbox.stl=$(MLN_ANDROID_STL) -Dorg.gradle.internal.http.socketTimeout=$(SOCKET_TIMEOUT) -Dorg.gradle.internal.http.connectionTimeout=$(CONNECTION_TIMEOUT)
MBGL_ANDROID_GRADLE_SINGLE_JOB = ./gradlew --parallel --max-workers=1 -Pmapbox.buildtype=$(buildtype) -Pmapbox.stl=$(MBGL_ANDROID_STL) -Dorg.gradle.internal.http.socketTimeout=$(SOCKET_TIMEOUT) -Dorg.gradle.internal.http.connectionTimeout=$(CONNECTION_TIMEOUT) MLN_ANDROID_GRADLE_SINGLE_JOB = ./gradlew --parallel --max-workers=1 -Pmapbox.buildtype=$(buildtype) -Pmapbox.stl=$(MLN_ANDROID_STL) -Dorg.gradle.internal.http.socketTimeout=$(SOCKET_TIMEOUT) -Dorg.gradle.internal.http.connectionTimeout=$(CONNECTION_TIMEOUT)
# Generate code based on the style specification # Generate code based on the style specification
.PHONY: android-style-code .PHONY: android-style-code
@@ -61,51 +61,51 @@ define ANDROID_RULES
.PHONY: android-test-lib-$1 .PHONY: android-test-lib-$1
android-test-lib-$1: android-test-lib-$1:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=$2 -Pmapbox.with_test=true :MapboxGLAndroidSDKTestApp:assemble$(BUILDTYPE) $(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 -Pmapbox.with_test=true :MapboxGLAndroidSDKTestApp:assemble$(BUILDTYPE)
.PHONY: android-benchmark-$1 .PHONY: android-benchmark-$1
android-benchmark-$1: android-benchmark-$1:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=$2 -Pmapbox.with_benchmark=true :MapboxGLAndroidSDKTestApp:assemble$(BUILDTYPE) $(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 -Pmapbox.with_benchmark=true :MapboxGLAndroidSDKTestApp:assemble$(BUILDTYPE)
# Build SDK for for specified abi # Build SDK for for specified abi
.PHONY: android-lib-$1 .PHONY: android-lib-$1
android-lib-$1: android-lib-$1:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDK:assemble$(BUILDTYPE) $(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDK:assemble$(BUILDTYPE)
# Build test app and SDK for for specified abi # Build test app and SDK for for specified abi
.PHONY: android-$1 .PHONY: android-$1
android-$1: android-$1:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:assemble$(BUILDTYPE) $(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:assemble$(BUILDTYPE)
# Build the core test for specified abi # Build the core test for specified abi
.PHONY: android-core-test-$1 .PHONY: android-core-test-$1
android-core-test-$1: android-test-lib-$1 android-core-test-$1: android-test-lib-$1
# Compile main sources and extract the classes (using the test app to get all transitive dependencies in one place) # Compile main sources and extract the classes (using the test app to get all transitive dependencies in one place)
mkdir -p $(MBGL_ANDROID_CORE_TEST_DIR) mkdir -p $(MLN_ANDROID_CORE_TEST_DIR)
unzip -o MapboxGLAndroidSDKTestApp/build/outputs/apk/$(buildtype)/MapboxGLAndroidSDKTestApp-$(MBGL_ANDROID_APK_SUFFIX).apk classes.dex -d $(MBGL_ANDROID_CORE_TEST_DIR) unzip -o MapboxGLAndroidSDKTestApp/build/outputs/apk/$(buildtype)/MapboxGLAndroidSDKTestApp-$(MLN_ANDROID_APK_SUFFIX).apk classes.dex -d $(MLN_ANDROID_CORE_TEST_DIR)
run-android-core-test-$1-%: android-core-test-$1 run-android-core-test-$1-%: android-core-test-$1
# Ensure clean state on the device # Ensure clean state on the device
adb shell "rm -Rf $(MBGL_ANDROID_LOCAL_WORK_DIR) && mkdir -p $(MBGL_ANDROID_LOCAL_WORK_DIR)/test && mkdir -p $(MBGL_ANDROID_LOCAL_WORK_DIR)/scripts/style-spec-reference" adb shell "rm -Rf $(MLN_ANDROID_LOCAL_WORK_DIR) && mkdir -p $(MLN_ANDROID_LOCAL_WORK_DIR)/test && mkdir -p $(MLN_ANDROID_LOCAL_WORK_DIR)/scripts/style-spec-reference"
# Push all needed files to the device # Push all needed files to the device
adb push $(MBGL_ANDROID_CORE_TEST_DIR)/classes.dex $(MBGL_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1 adb push $(MLN_ANDROID_CORE_TEST_DIR)/classes.dex $(MLN_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1
adb push MapboxGLAndroidSDK/build/intermediates/intermediate-jars/$(buildtype)/jni/$2/libmapbox-gl.so $(MBGL_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1 adb push MapboxGLAndroidSDK/build/intermediates/intermediate-jars/$(buildtype)/jni/$2/libmapbox-gl.so $(MLN_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1
adb push test/fixtures $(MBGL_ANDROID_LOCAL_WORK_DIR)/test > /dev/null 2>&1 adb push test/fixtures $(MLN_ANDROID_LOCAL_WORK_DIR)/test > /dev/null 2>&1
adb push scripts/style-spec-reference/v8.json $(MBGL_ANDROID_LOCAL_WORK_DIR)/scripts/style-spec-reference > /dev/null 2>&1 adb push scripts/style-spec-reference/v8.json $(MLN_ANDROID_LOCAL_WORK_DIR)/scripts/style-spec-reference > /dev/null 2>&1
adb push MapboxGLAndroidSDK/build/intermediates/cmake/$(buildtype)/obj/$2/mbgl-test $(MBGL_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1 adb push MapboxGLAndroidSDK/build/intermediates/cmake/$(buildtype)/obj/$2/mbgl-test $(MLN_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1
# Create gtest filter for skipped tests. # Create gtest filter for skipped tests.
$(eval SKIPPED_TESTS := -$(shell sed -n '/#\|^$$/!p' tests/skipped.txt | sed ':a;$!N;s/\n/:/g;ta')) $(eval SKIPPED_TESTS := -$(shell sed -n '/#\|^$$/!p' tests/skipped.txt | sed ':a;$!N;s/\n/:/g;ta'))
# Kick off the tests # Kick off the tests
adb shell "export LD_LIBRARY_PATH=$(MBGL_ANDROID_LOCAL_WORK_DIR) && cd $(MBGL_ANDROID_LOCAL_WORK_DIR) && chmod +x mbgl-test && ./mbgl-test --class_path=$(MBGL_ANDROID_LOCAL_WORK_DIR)/classes.dex --gtest_filter=$$*:$(SKIPPED_TESTS)" adb shell "export LD_LIBRARY_PATH=$(MLN_ANDROID_LOCAL_WORK_DIR) && cd $(MLN_ANDROID_LOCAL_WORK_DIR) && chmod +x mbgl-test && ./mbgl-test --class_path=$(MLN_ANDROID_LOCAL_WORK_DIR)/classes.dex --gtest_filter=$$*:$(SKIPPED_TESTS)"
# Gather the results and unpack them # Gather the results and unpack them
adb shell "cd $(MBGL_ANDROID_LOCAL_WORK_DIR) && tar -cvzf results.tgz test/fixtures/* > /dev/null 2>&1" adb shell "cd $(MLN_ANDROID_LOCAL_WORK_DIR) && tar -cvzf results.tgz test/fixtures/* > /dev/null 2>&1"
adb pull $(MBGL_ANDROID_LOCAL_WORK_DIR)/results.tgz $(MBGL_ANDROID_CORE_TEST_DIR)/ > /dev/null 2>&1 adb pull $(MLN_ANDROID_LOCAL_WORK_DIR)/results.tgz $(MLN_ANDROID_CORE_TEST_DIR)/ > /dev/null 2>&1
rm -rf $(MBGL_ANDROID_CORE_TEST_DIR)/results && mkdir -p $(MBGL_ANDROID_CORE_TEST_DIR)/results rm -rf $(MLN_ANDROID_CORE_TEST_DIR)/results && mkdir -p $(MLN_ANDROID_CORE_TEST_DIR)/results
tar -xzf $(MBGL_ANDROID_CORE_TEST_DIR)/results.tgz --strip-components=2 -C $(MBGL_ANDROID_CORE_TEST_DIR)/results tar -xzf $(MLN_ANDROID_CORE_TEST_DIR)/results.tgz --strip-components=2 -C $(MLN_ANDROID_CORE_TEST_DIR)/results
# Run the core test for specified abi # Run the core test for specified abi
.PHONY: run-android-core-test-$1 .PHONY: run-android-core-test-$1
@@ -116,47 +116,47 @@ run-android-core-test-$1: run-android-core-test-$1-*
run-android-benchmark-$1: run-android-benchmark-$1-* run-android-benchmark-$1: run-android-benchmark-$1-*
run-android-benchmark-$1-%: android-benchmark-$1 run-android-benchmark-$1-%: android-benchmark-$1
mkdir -p $(MBGL_ANDROID_BENCHMARK_DIR) mkdir -p $(MLN_ANDROID_BENCHMARK_DIR)
unzip -o MapboxGLAndroidSDKTestApp/build/outputs/apk/$(buildtype)/MapboxGLAndroidSDKTestApp-$(MBGL_ANDROID_APK_SUFFIX).apk classes.dex -d $(MBGL_ANDROID_BENCHMARK_DIR) unzip -o MapboxGLAndroidSDKTestApp/build/outputs/apk/$(buildtype)/MapboxGLAndroidSDKTestApp-$(MLN_ANDROID_APK_SUFFIX).apk classes.dex -d $(MLN_ANDROID_BENCHMARK_DIR)
# Delete old test folder and create new one # Delete old test folder and create new one
adb shell "rm -Rf $(MBGL_ANDROID_LOCAL_BENCHMARK_DIR) && mkdir -p $(MBGL_ANDROID_LOCAL_BENCHMARK_DIR)/benchmark && mkdir -p $(MBGL_ANDROID_LOCAL_BENCHMARK_DIR)/test" adb shell "rm -Rf $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) && mkdir -p $(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/benchmark && mkdir -p $(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/test"
# Push compiled java sources, test data and executable to device # Push compiled java sources, test data and executable to device
adb push $(MBGL_ANDROID_BENCHMARK_DIR)/classes.dex $(MBGL_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1 adb push $(MLN_ANDROID_BENCHMARK_DIR)/classes.dex $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1
adb push MapboxGLAndroidSDK/build/intermediates/intermediate-jars/$(buildtype)/jni/$2/libmapbox-gl.so $(MBGL_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1 adb push MapboxGLAndroidSDK/build/intermediates/intermediate-jars/$(buildtype)/jni/$2/libmapbox-gl.so $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1
adb push benchmark/fixtures $(MBGL_ANDROID_LOCAL_BENCHMARK_DIR)/benchmark > /dev/null 2>&1 adb push benchmark/fixtures $(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/benchmark > /dev/null 2>&1
adb push test/fixtures $(MBGL_ANDROID_LOCAL_BENCHMARK_DIR)/test > /dev/null 2>&1 adb push test/fixtures $(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/test > /dev/null 2>&1
adb push MapboxGLAndroidSDK/build/intermediates/cmake/$(buildtype)/obj/$2/mbgl-benchmark $(MBGL_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1 adb push MapboxGLAndroidSDK/build/intermediates/cmake/$(buildtype)/obj/$2/mbgl-benchmark $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1
# Run benchmark. Number of benchmark iterations can be set by run-android-benchmark-N parameter. # Run benchmark. Number of benchmark iterations can be set by run-android-benchmark-N parameter.
adb shell "export LD_LIBRARY_PATH=$(MBGL_ANDROID_LOCAL_BENCHMARK_DIR) && cd $(MBGL_ANDROID_LOCAL_BENCHMARK_DIR) && chmod +x mbgl-benchmark && ./mbgl-benchmark --class_path=$(MBGL_ANDROID_LOCAL_BENCHMARK_DIR)/classes.dex --benchmark_repetitions=$$* --benchmark_format=json --benchmark_out=results.json" adb shell "export LD_LIBRARY_PATH=$(MLN_ANDROID_LOCAL_BENCHMARK_DIR) && cd $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) && chmod +x mbgl-benchmark && ./mbgl-benchmark --class_path=$(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/classes.dex --benchmark_repetitions=$$* --benchmark_format=json --benchmark_out=results.json"
# Pull results.json from the device # Pull results.json from the device
rm -rf $(MBGL_ANDROID_BENCHMARK_DIR)/results && mkdir -p $(MBGL_ANDROID_BENCHMARK_DIR)/results rm -rf $(MLN_ANDROID_BENCHMARK_DIR)/results && mkdir -p $(MLN_ANDROID_BENCHMARK_DIR)/results
adb pull $(MBGL_ANDROID_LOCAL_BENCHMARK_DIR)/results.json $(MBGL_ANDROID_BENCHMARK_DIR)/results > /dev/null 2>&1 adb pull $(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/results.json $(MLN_ANDROID_BENCHMARK_DIR)/results > /dev/null 2>&1
# Run the test app on connected android device with specified abi # Run the test app on connected android device with specified abi
.PHONY: run-android-$1 .PHONY: run-android-$1
run-android-$1: run-android-$1:
-adb uninstall com.mapbox.mapboxsdk.testapp 2> /dev/null -adb uninstall com.mapbox.mapboxsdk.testapp 2> /dev/null
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:install$(BUILDTYPE) && adb shell am start -n com.mapbox.mapboxsdk.testapp/.activity.FeatureOverviewActivity $(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:install$(BUILDTYPE) && adb shell am start -n com.mapbox.mapboxsdk.testapp/.activity.FeatureOverviewActivity
# Build test app instrumentation tests apk and test app apk for specified abi # Build test app instrumentation tests apk and test app apk for specified abi
.PHONY: android-ui-test-$1 .PHONY: android-ui-test-$1
android-ui-test-$1: android-ui-test-$1:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:assembleDebug :MapboxGLAndroidSDKTestApp:assembleAndroidTest $(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:assembleDebug :MapboxGLAndroidSDKTestApp:assembleAndroidTest
# Run test app instrumentation tests on a connected android device or emulator with specified abi # Run test app instrumentation tests on a connected android device or emulator with specified abi
.PHONY: run-android-ui-test-$1 .PHONY: run-android-ui-test-$1
run-android-ui-test-$1: run-android-ui-test-$1:
-adb uninstall com.mapbox.mapboxsdk.testapp 2> /dev/null -adb uninstall com.mapbox.mapboxsdk.testapp 2> /dev/null
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest $(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest
# Run Java Instrumentation tests on a connected android device or emulator with specified abi and test filter # Run Java Instrumentation tests on a connected android device or emulator with specified abi and test filter
run-android-ui-test-$1-%: run-android-ui-test-$1-%:
-adb uninstall com.mapbox.mapboxsdk.testapp 2> /dev/null -adb uninstall com.mapbox.mapboxsdk.testapp 2> /dev/null
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="$$*" $(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="$$*"
# Symbolicate native stack trace with the specified abi # Symbolicate native stack trace with the specified abi
.PHONY: android-ndk-stack-$1 .PHONY: android-ndk-stack-$1
@@ -174,7 +174,7 @@ run-android-render-test-$1: $(BUILD_DEPS)
cp -r metrics/integration MapboxGLAndroidSDKTestApp/src/main/assets cp -r metrics/integration MapboxGLAndroidSDKTestApp/src/main/assets
cp platform/node/test/ignores.json MapboxGLAndroidSDKTestApp/src/main/assets/integration/ignores.json cp platform/node/test/ignores.json MapboxGLAndroidSDKTestApp/src/main/assets/integration/ignores.json
# run RenderTest.java to generate static map images # run RenderTest.java to generate static map images
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="com.mapbox.mapboxsdk.testapp.render.RenderTest" $(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="com.mapbox.mapboxsdk.testapp.render.RenderTest"
# pull generated images from the device # pull generated images from the device
adb pull "`adb shell 'printenv EXTERNAL_STORAGE' | tr -d '\r'`/mapbox/render" build/render-test adb pull "`adb shell 'printenv EXTERNAL_STORAGE' | tr -d '\r'`/mapbox/render" build/render-test
# copy expected result and run pixelmatch # copy expected result and run pixelmatch
@@ -189,7 +189,7 @@ define ANDROID_RULES_INVOKER
$(call ANDROID_RULES,$(word 1,$1),$(word 2,$1)) $(call ANDROID_RULES,$(word 1,$1),$(word 2,$1))
endef endef
$(foreach abi,$(MBGL_ANDROID_ABIS),$(eval $(call ANDROID_RULES_INVOKER,$(subst ;, ,$(abi))))) $(foreach abi,$(MLN_ANDROID_ABIS),$(eval $(call ANDROID_RULES_INVOKER,$(subst ;, ,$(abi)))))
# Build the Android SDK and test app with abi set to arm-v7 # Build the Android SDK and test app with abi set to arm-v7
.PHONY: android .PHONY: android
@@ -211,20 +211,20 @@ run-android-ui-test-%: run-android-ui-test-arm-v7-%
# Run Java Unit tests on the JVM of the development machine executing this # Run Java Unit tests on the JVM of the development machine executing this
.PHONY: run-android-unit-test .PHONY: run-android-unit-test
run-android-unit-test: run-android-unit-test:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:testDebugUnitTest --info $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:testDebugUnitTest --info
run-android-unit-test-%: run-android-unit-test-%:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:testDebugUnitTest --info --tests "$*" $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:testDebugUnitTest --info --tests "$*"
# Builds a release package of the Android SDK # Builds a release package of the Android SDK
.PHONY: apackage .PHONY: apackage
apackage: apackage:
make android-lib-arm-v7 && make android-lib-arm-v8 && make android-lib-x86 && make android-lib-x86-64 make android-lib-arm-v7 && make android-lib-arm-v8 && make android-lib-x86 && make android-lib-x86-64
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=all assemble$(BUILDTYPE) $(MLN_ANDROID_GRADLE) -Pmapbox.abis=all assemble$(BUILDTYPE)
# Build test app instrumentation tests apk and test app apk for all abi's # Build test app instrumentation tests apk and test app apk for all abi's
.PHONY: android-ui-test .PHONY: android-ui-test
android-ui-test: android-ui-test:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=all :MapboxGLAndroidSDKTestApp:assembleDebug :MapboxGLAndroidSDKTestApp:assembleAndroidTest $(MLN_ANDROID_GRADLE) -Pmapbox.abis=all :MapboxGLAndroidSDKTestApp:assembleDebug :MapboxGLAndroidSDKTestApp:assembleAndroidTest
#Run instrumentations tests on MicroSoft App Center, ${devices} can be "xiaomi","huawei","OnePlus","htc" #Run instrumentations tests on MicroSoft App Center, ${devices} can be "xiaomi","huawei","OnePlus","htc"
.PHONY: run-android-test-app-center .PHONY: run-android-test-app-center
@@ -234,7 +234,7 @@ run-android-test-app-center:
# Uploads the compiled Android SDK to Maven Central Staging # Uploads the compiled Android SDK to Maven Central Staging
.PHONY: run-android-publish .PHONY: run-android-publish
run-android-publish: run-android-publish:
$(MBGL_ANDROID_GRADLE_SINGLE_JOB) -Pmapbox.abis=all :MapboxGLAndroidSDK:publishReleasePublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository $(MLN_ANDROID_GRADLE_SINGLE_JOB) -Pmapbox.abis=all :MapboxGLAndroidSDK:publishReleasePublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
# Dump system graphics information for the test app # Dump system graphics information for the test app
.PHONY: android-gfxinfo .PHONY: android-gfxinfo
@@ -248,32 +248,32 @@ android-check : android-ktlint android-checkstyle android-lint-sdk android-lint-
# Runs checkstyle on the java code # Runs checkstyle on the java code
.PHONY: android-checkstyle .PHONY: android-checkstyle
android-checkstyle: android-checkstyle:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:checkstyle :MapboxGLAndroidSDKTestApp:checkstyle $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:checkstyle :MapboxGLAndroidSDKTestApp:checkstyle
# Runs checkstyle on the kotlin code # Runs checkstyle on the kotlin code
.PHONY: android-ktlint .PHONY: android-ktlint
android-ktlint: android-ktlint:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none checkstyle $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none checkstyle
# Runs lint on the Android SDK java code # Runs lint on the Android SDK java code
.PHONY: android-lint-sdk .PHONY: android-lint-sdk
android-lint-sdk: android-lint-sdk:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:lint $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:lint
# Runs lint on the Android test app java code # Runs lint on the Android test app java code
.PHONY: android-lint-test-app .PHONY: android-lint-test-app
android-lint-test-app: android-lint-test-app:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDKTestApp:lint $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDKTestApp:lint
# Generates javadoc from the Android SDK # Generates javadoc from the Android SDK
.PHONY: android-javadoc .PHONY: android-javadoc
android-javadoc: android-javadoc:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:javadocrelease $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:javadocrelease
# Generates LICENSE.md file based on all Android project dependencies # Generates LICENSE.md file based on all Android project dependencies
.PHONY: android-license .PHONY: android-license
android-license: android-license:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:licenseReleaseReport $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:licenseReleaseReport
python scripts/generate-license.py python scripts/generate-license.py
# Symbolicate ndk stack traces for the arm-v7 abi # Symbolicate ndk stack traces for the arm-v7 abi
@@ -283,22 +283,22 @@ android-ndk-stack: android-ndk-stack-arm-v7
# Updates Android's vendor submodules # Updates Android's vendor submodules
.PHONY: android-update-vendor .PHONY: android-update-vendor
android-update-vendor: android-update-vendor:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none updateVendorSubmodules $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none updateVendorSubmodules
# Run android nitpick script # Run android nitpick script
.PHONY: run-android-nitpick .PHONY: run-android-nitpick
run-android-nitpick: android-update-vendor run-android-nitpick: android-update-vendor
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none androidNitpick $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none androidNitpick
# Creates a dependency graph using Graphviz # Creates a dependency graph using Graphviz
.PHONY: android-graph .PHONY: android-graph
android-graph: android-graph:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:generateDependencyGraphMapboxLibraries $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:generateDependencyGraphMapboxLibraries
# Lists tasks # Lists tasks
.PHONY: list-tasks .PHONY: list-tasks
list-tasks: list-tasks:
$(MBGL_ANDROID_GRADLE) -Pmapbox.abis=all tasks $(MLN_ANDROID_GRADLE) -Pmapbox.abis=all tasks
#### Miscellaneous targets ##################################################### #### Miscellaneous targets #####################################################

View File

@@ -1,8 +1,8 @@
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
if(WIN32) if(WIN32)
if(MBGL_WITH_OSMESA) if(MLN_WITH_OSMESA)
message(WARNING "mbgl-glfw does not work with -DMBGL_WITH_OSMESA=ON. If you want to build this target, don't use this option.") message(WARNING "mbgl-glfw does not work with -DMLN_WITH_OSMESA=ON. If you want to build this target, don't use this option.")
return() return()
endif() endif()
@@ -29,7 +29,7 @@ set_property(
PROPERTY COMPILE_DEFINITIONS MAPBOX_PUCK_ASSETS_PATH=\"${PROJECT_SOURCE_DIR}/platform/glfw/assets/\" PROPERTY COMPILE_DEFINITIONS MAPBOX_PUCK_ASSETS_PATH=\"${PROJECT_SOURCE_DIR}/platform/glfw/assets/\"
) )
if(MBGL_WITH_OPENGL) if(MLN_WITH_OPENGL)
target_sources( target_sources(
mbgl-glfw mbgl-glfw
PRIVATE ${PROJECT_SOURCE_DIR}/platform/glfw/glfw_gl_backend.cpp PRIVATE ${PROJECT_SOURCE_DIR}/platform/glfw/glfw_gl_backend.cpp
@@ -40,7 +40,7 @@ if(MBGL_WITH_OPENGL)
) )
endif() endif()
if(MBGL_WITH_EGL) if(MLN_WITH_EGL)
target_compile_definitions( target_compile_definitions(
mbgl-glfw mbgl-glfw
PRIVATE MBGL_WITH_EGL=1 PRIVATE MBGL_WITH_EGL=1
@@ -94,7 +94,7 @@ target_link_libraries(
Mapbox::Base::cheap-ruler-cpp Mapbox::Base::cheap-ruler-cpp
) )
if(NOT WIN32 AND MBGL_WITH_OPENGL) if(NOT WIN32 AND MLN_WITH_OPENGL)
target_link_libraries( target_link_libraries(
mbgl-glfw mbgl-glfw
PRIVATE OpenGL::GL PRIVATE OpenGL::GL

View File

@@ -1,8 +1,8 @@
if(MBGL_IOS_RENDER_TEST) if(MLN_IOS_RENDER_TEST)
include(${PROJECT_SOURCE_DIR}/vendor/zip-archive.cmake) include(${PROJECT_SOURCE_DIR}/vendor/zip-archive.cmake)
initialize_ios_target(mbgl-vendor-zip-archive) initialize_ios_target(mbgl-vendor-zip-archive)
if(MBGL_WITH_OPENGL) if(MLN_WITH_OPENGL)
message(STATUS "Setting up test data for iOS render test with OpenGL renderer") message(STATUS "Setting up test data for iOS render test with OpenGL renderer")
set(PREPARE_CMD "${PROJECT_SOURCE_DIR}/render-test/ios/setup_test_data.sh") set(PREPARE_CMD "${PROJECT_SOURCE_DIR}/render-test/ios/setup_test_data.sh")
endif() endif()
@@ -87,7 +87,7 @@ if(MBGL_IOS_RENDER_TEST)
set_target_properties(RenderTestAppTests PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set_target_properties(RenderTestAppTests PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
endif() endif()
if(MBGL_IOS_UNIT_TEST) if(MLN_IOS_UNIT_TEST)
execute_process(COMMAND ditto ${PROJECT_SOURCE_DIR}/test/fixtures ${CMAKE_CURRENT_BINARY_DIR}/test-data/test/fixtures) execute_process(COMMAND ditto ${PROJECT_SOURCE_DIR}/test/fixtures ${CMAKE_CURRENT_BINARY_DIR}/test-data/test/fixtures)
execute_process( execute_process(
COMMAND COMMAND
@@ -159,7 +159,7 @@ if(MBGL_IOS_UNIT_TEST)
set_target_properties(UnitTestsAppTests PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set_target_properties(UnitTestsAppTests PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
endif() endif()
if(MBGL_IOS_BENCHMARK) if(MLN_IOS_BENCHMARK)
execute_process(COMMAND ditto ${PROJECT_SOURCE_DIR}/benchmark/fixtures ${CMAKE_CURRENT_BINARY_DIR}/benchmark-data/benchmark/fixtures) execute_process(COMMAND ditto ${PROJECT_SOURCE_DIR}/benchmark/fixtures ${CMAKE_CURRENT_BINARY_DIR}/benchmark-data/benchmark/fixtures)
execute_process( execute_process(
COMMAND COMMAND

View File

@@ -1,5 +1,5 @@
option(MBGL_WITH_IOS_CCACHE "Enable ccache for iOS" OFF) option(MLN_WITH_IOS_CCACHE "Enable ccache for iOS" OFF)
option(MBGL_IOS_RENDER_TEST "Include render tests" ON) option(MLN_IOS_RENDER_TEST "Include render tests" ON)
if(NOT DEFINED IOS_DEPLOYMENT_TARGET) if(NOT DEFINED IOS_DEPLOYMENT_TARGET)
set(IOS_DEPLOYMENT_TARGET "12.0") set(IOS_DEPLOYMENT_TARGET "12.0")
@@ -22,7 +22,7 @@ endmacro()
set_target_properties(mbgl-core PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES) set_target_properties(mbgl-core PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
if(MBGL_WITH_OPENGL) if(MLN_WITH_OPENGL)
target_compile_definitions( target_compile_definitions(
mbgl-core mbgl-core
PUBLIC GLES_SILENCE_DEPRECATION GLES_SILENCE_DEPRECATION PUBLIC GLES_SILENCE_DEPRECATION GLES_SILENCE_DEPRECATION
@@ -91,10 +91,10 @@ target_include_directories(
) )
include(${PROJECT_SOURCE_DIR}/vendor/icu.cmake) include(${PROJECT_SOURCE_DIR}/vendor/icu.cmake)
if(MBGL_WITH_IOS_CCACHE) if(MLN_WITH_IOS_CCACHE)
include(${PROJECT_SOURCE_DIR}/platform/ios/ccache.cmake) include(${PROJECT_SOURCE_DIR}/platform/ios/ccache.cmake)
endif() endif()
if(MBGL_WITH_OPENGL) if(MLN_WITH_OPENGL)
include(${PROJECT_SOURCE_DIR}/platform/ios/ios-test-runners.cmake) include(${PROJECT_SOURCE_DIR}/platform/ios/ios-test-runners.cmake)
endif() endif()

View File

@@ -1,9 +1,9 @@
include(cmake/mason.cmake) include(cmake/mason.cmake)
# include once for every platform to get all dependency defines # include once for every platform to get all dependency defines
set(MBGL_PLATFORM "android") set(MLN_PLATFORM "android")
include(cmake/mason-dependencies.cmake) include(cmake/mason-dependencies.cmake)
set(MBGL_PLATFORM "ios") set(MLN_PLATFORM "ios")
include(cmake/mason-dependencies.cmake) include(cmake/mason-dependencies.cmake)
get_cmake_property(_VARS VARIABLES) get_cmake_property(_VARS VARIABLES)

View File

@@ -1,5 +1,5 @@
option(MBGL_WITH_X11 "Build with X11 Support" ON) option(MLN_WITH_X11 "Build with X11 Support" ON)
option(MBGL_WITH_WAYLAND "Build with Wayland Support" OFF) option(MLN_WITH_WAYLAND "Build with Wayland Support" OFF)
find_package(CURL REQUIRED) find_package(CURL REQUIRED)
find_package(ICU OPTIONAL_COMPONENTS i18n) find_package(ICU OPTIONAL_COMPONENTS i18n)
@@ -7,7 +7,7 @@ find_package(ICU OPTIONAL_COMPONENTS uc)
find_package(JPEG REQUIRED) find_package(JPEG REQUIRED)
find_package(PNG REQUIRED) find_package(PNG REQUIRED)
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
if (MBGL_WITH_X11) if (MLN_WITH_X11)
find_package(X11 REQUIRED) find_package(X11 REQUIRED)
endif () endif ()
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
@@ -57,7 +57,7 @@ target_sources(
${PROJECT_SOURCE_DIR}/platform/linux/src/gl_functions.cpp ${PROJECT_SOURCE_DIR}/platform/linux/src/gl_functions.cpp
) )
if(MBGL_WITH_EGL) if(MLN_WITH_EGL)
find_package(OpenGL REQUIRED EGL) find_package(OpenGL REQUIRED EGL)
target_sources( target_sources(
mbgl-core mbgl-core
@@ -69,7 +69,7 @@ if(MBGL_WITH_EGL)
PRIVATE PRIVATE
OpenGL::EGL OpenGL::EGL
) )
if (MBGL_WITH_WAYLAND) if (MLN_WITH_WAYLAND)
target_compile_definitions(mbgl-core PUBLIC target_compile_definitions(mbgl-core PUBLIC
EGL_NO_X11 EGL_NO_X11
MESA_EGL_NO_X11_HEADERS MESA_EGL_NO_X11_HEADERS
@@ -107,7 +107,7 @@ include(${PROJECT_SOURCE_DIR}/vendor/sqlite.cmake)
if(NOT ${ICU_FOUND} OR "${ICU_VERSION}" VERSION_LESS 62.0) if(NOT ${ICU_FOUND} OR "${ICU_VERSION}" VERSION_LESS 62.0)
message(STATUS "ICU not found or too old, using builtin.") message(STATUS "ICU not found or too old, using builtin.")
set(MBGL_USE_BUILTIN_ICU TRUE) set(MLN_USE_BUILTIN_ICU TRUE)
include(${PROJECT_SOURCE_DIR}/vendor/icu.cmake) include(${PROJECT_SOURCE_DIR}/vendor/icu.cmake)
set_source_files_properties( set_source_files_properties(
@@ -126,9 +126,9 @@ target_link_libraries(
${LIBUV_LIBRARIES} ${LIBUV_LIBRARIES}
${X11_LIBRARIES} ${X11_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
$<$<NOT:$<BOOL:${MBGL_USE_BUILTIN_ICU}>>:ICU::i18n> $<$<NOT:$<BOOL:${MLN_USE_BUILTIN_ICU}>>:ICU::i18n>
$<$<NOT:$<BOOL:${MBGL_USE_BUILTIN_ICU}>>:ICU::uc> $<$<NOT:$<BOOL:${MLN_USE_BUILTIN_ICU}>>:ICU::uc>
$<$<BOOL:${MBGL_USE_BUILTIN_ICU}>:mbgl-vendor-icu> $<$<BOOL:${MLN_USE_BUILTIN_ICU}>:mbgl-vendor-icu>
PNG::PNG PNG::PNG
mbgl-vendor-nunicode mbgl-vendor-nunicode
mbgl-vendor-sqlite mbgl-vendor-sqlite

View File

@@ -11,7 +11,7 @@ set_target_properties(mbgl-core PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH[vari
set_target_properties(mbgl-core PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES) set_target_properties(mbgl-core PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
if(MBGL_WITH_OPENGL) if(MLN_WITH_OPENGL)
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
target_compile_definitions( target_compile_definitions(

View File

@@ -71,7 +71,7 @@ target_link_libraries(
# FIXME: Node bindings only run fully on Linux now because it requires libuv RunLoop (which is the default on Linux). Also, Sanitizer will # FIXME: Node bindings only run fully on Linux now because it requires libuv RunLoop (which is the default on Linux). Also, Sanitizer will
# not work here because node will do a dlopen(), which is not currently supported. # not work here because node will do a dlopen(), which is not currently supported.
if(CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT MBGL_WITH_SANITIZER) if(CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT MLN_WITH_SANITIZER)
add_test(NAME mbgl-node-memory COMMAND npm run test-memory WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) add_test(NAME mbgl-node-memory COMMAND npm run test-memory WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
add_test(NAME mbgl-node-test COMMAND npm run test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) add_test(NAME mbgl-node-test COMMAND npm run test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
endif() endif()

View File

@@ -48,7 +48,7 @@ To compile the Node.js bindings and install module dependencies, from the reposi
#### MacOS #### MacOS
```bash ```bash
cmake . -B build -G Ninja -DMLN_WITH_NODE=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug -DMBGL_WITH_COVERAGE=ON cmake . -B build -G Ninja -DMLN_WITH_NODE=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug -DMLN_WITH_COVERAGE=ON
``` ```
#### Linux #### Linux

View File

@@ -211,7 +211,7 @@ function(add_node_module NAME)
) )
if(WIN32) if(WIN32)
if(MBGL_WITH_OSMESA) if(MLN_WITH_OSMESA)
get_filename_component(_OUTPUT_PATH "${_OUTPUT_PATH}" DIRECTORY "${CMAKE_CURRENT_SOURCE_PATH}") get_filename_component(_OUTPUT_PATH "${_OUTPUT_PATH}" DIRECTORY "${CMAKE_CURRENT_SOURCE_PATH}")
add_custom_command( add_custom_command(

View File

@@ -6,7 +6,7 @@ find_dependency(Qt@QT_VERSION_MAJOR@
find_dependency(Qt@QT_VERSION_MAJOR@ find_dependency(Qt@QT_VERSION_MAJOR@
COMPONENTS Network @REQUIRED_QT_VERSION@) COMPONENTS Network @REQUIRED_QT_VERSION@)
if(@MBGL_QT_STATIC@ AND NOT @MBGL_QT_INSIDE_PLUGIN@ AND NOT @MBGL_QT_WITH_INTERNAL_SQLITE@) if(@MLN_QT_STATIC@ AND NOT @MLN_QT_INSIDE_PLUGIN@ AND NOT @MLN_QT_WITH_INTERNAL_SQLITE@)
find_dependency(Qt@QT_VERSION_MAJOR@ find_dependency(Qt@QT_VERSION_MAJOR@
COMPONENTS Sql @REQUIRED_QT_VERSION@) COMPONENTS Sql @REQUIRED_QT_VERSION@)
endif() endif()

View File

@@ -33,7 +33,7 @@ cmake ../maplibre-gl-native/ \
-GNinja \ -GNinja \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=<installation_prefix> \ -DCMAKE_INSTALL_PREFIX=<installation_prefix> \
-DMBGL_WITH_QT=ON -DMLN_WITH_QT=ON
ninja ninja
ninja install ninja install
``` ```

View File

@@ -1,16 +1,16 @@
message(STATUS "Configuring GL-Native with Qt bindings") message(STATUS "Configuring GL-Native with Qt bindings")
file(READ "${PROJECT_SOURCE_DIR}/platform/qt/VERSION" MBGL_QT_VERSION) file(READ "${PROJECT_SOURCE_DIR}/platform/qt/VERSION" MLN_QT_VERSION)
string(REGEX REPLACE "\n" "" MBGL_QT_VERSION "${MBGL_QT_VERSION}") # get rid of the newline at the end string(REGEX REPLACE "\n" "" MLN_QT_VERSION "${MLN_QT_VERSION}") # get rid of the newline at the end
set(MBGL_QT_VERSION_COMPATIBILITY 2.0.0) set(MLN_QT_VERSION_COMPATIBILITY 2.0.0)
message(STATUS "Version ${MBGL_QT_VERSION}") message(STATUS "Version ${MLN_QT_VERSION}")
option(MBGL_QT_LIBRARY_ONLY "Build only libraries" OFF) option(MLN_QT_LIBRARY_ONLY "Build only libraries" OFF)
option(MBGL_QT_STATIC "Build MapLibre GL Qt bindings staticly" OFF) option(MLN_QT_STATIC "Build MapLibre GL Qt bindings staticly" OFF)
option(MBGL_QT_INSIDE_PLUGIN "Build QMapLibreGL as OBJECT library, so it can be bundled into separate single plugin lib." OFF) option(MLN_QT_INSIDE_PLUGIN "Build QMapLibreGL as OBJECT library, so it can be bundled into separate single plugin lib." OFF)
option(MBGL_QT_WITH_HEADLESS "Build MapLibre GL Qt with headless support" ON) option(MLN_QT_WITH_HEADLESS "Build MapLibre GL Qt with headless support" ON)
option(MBGL_QT_WITH_INTERNAL_SQLITE "Build MapLibre GL Qt bindings with internal sqlite" OFF) option(MLN_QT_WITH_INTERNAL_SQLITE "Build MapLibre GL Qt bindings with internal sqlite" OFF)
option(MBGL_QT_DEPLOYMENT "Autogenerate files necessary for deployment" OFF) option(MLN_QT_DEPLOYMENT "Autogenerate files necessary for deployment" OFF)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} find_package(Qt${QT_VERSION_MAJOR}
@@ -18,14 +18,14 @@ find_package(Qt${QT_VERSION_MAJOR}
Network Network
REQUIRED) REQUIRED)
if(NOT MBGL_QT_LIBRARY_ONLY) if(NOT MLN_QT_LIBRARY_ONLY)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
if (Qt6_FOUND) if (Qt6_FOUND)
find_package(Qt${QT_VERSION_MAJOR}OpenGLWidgets REQUIRED) find_package(Qt${QT_VERSION_MAJOR}OpenGLWidgets REQUIRED)
endif() endif()
endif() endif()
if(NOT MBGL_QT_WITH_INTERNAL_SQLITE) if(NOT MLN_QT_WITH_INTERNAL_SQLITE)
find_package(Qt${QT_VERSION_MAJOR}Sql REQUIRED) find_package(Qt${QT_VERSION_MAJOR}Sql REQUIRED)
else() else()
message(STATUS "Using internal sqlite") message(STATUS "Using internal sqlite")
@@ -33,8 +33,8 @@ else()
endif() endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(MBGL_QT_WITH_INTERNAL_ICU "Build MapLibre GL Qt bindings with internal ICU" OFF) option(MLN_QT_WITH_INTERNAL_ICU "Build MapLibre GL Qt bindings with internal ICU" OFF)
if(NOT MBGL_QT_WITH_INTERNAL_ICU) if(NOT MLN_QT_WITH_INTERNAL_ICU)
find_package(ICU COMPONENTS uc REQUIRED) find_package(ICU COMPONENTS uc REQUIRED)
else() else()
message(STATUS "Using internal ICU") message(STATUS "Using internal ICU")
@@ -87,10 +87,10 @@ target_sources(
${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/offline_database.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/offline_database.cpp
${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/offline_download.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/offline_download.cpp
${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/online_file_source.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/online_file_source.cpp
${PROJECT_SOURCE_DIR}/platform/$<IF:$<BOOL:${MBGL_QT_WITH_INTERNAL_SQLITE}>,default/src/mbgl/storage/sqlite3.cpp,qt/src/mbgl/sqlite3.cpp> ${PROJECT_SOURCE_DIR}/platform/$<IF:$<BOOL:${MLN_QT_WITH_INTERNAL_SQLITE}>,default/src/mbgl/storage/sqlite3.cpp,qt/src/mbgl/sqlite3.cpp>
${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/util/compression.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/util/compression.cpp
${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/util/monotonic_timer.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/util/monotonic_timer.cpp
$<$<BOOL:${MBGL_QT_WITH_HEADLESS}>:${PROJECT_SOURCE_DIR}/platform/qt/src/mbgl/headless_backend_qt.cpp> $<$<BOOL:${MLN_QT_WITH_HEADLESS}>:${PROJECT_SOURCE_DIR}/platform/qt/src/mbgl/headless_backend_qt.cpp>
${PROJECT_SOURCE_DIR}/platform/qt/src/mbgl/async_task.cpp ${PROJECT_SOURCE_DIR}/platform/qt/src/mbgl/async_task.cpp
${PROJECT_SOURCE_DIR}/platform/qt/src/mbgl/async_task_impl.hpp ${PROJECT_SOURCE_DIR}/platform/qt/src/mbgl/async_task_impl.hpp
${PROJECT_SOURCE_DIR}/platform/qt/src/mbgl/gl_functions.cpp ${PROJECT_SOURCE_DIR}/platform/qt/src/mbgl/gl_functions.cpp
@@ -138,8 +138,8 @@ target_link_libraries(
Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Network
$<IF:$<BOOL:${MBGL_QT_WITH_INTERNAL_SQLITE}>,mbgl-vendor-sqlite,Qt${QT_VERSION_MAJOR}::Sql> $<IF:$<BOOL:${MLN_QT_WITH_INTERNAL_SQLITE}>,mbgl-vendor-sqlite,Qt${QT_VERSION_MAJOR}::Sql>
$<$<PLATFORM_ID:Linux>:$<IF:$<BOOL:${MBGL_QT_WITH_INTERNAL_ICU}>,mbgl-vendor-icu,ICU::uc>> $<$<PLATFORM_ID:Linux>:$<IF:$<BOOL:${MLN_QT_WITH_INTERNAL_ICU}>,mbgl-vendor-icu,ICU::uc>>
mbgl-vendor-nunicode mbgl-vendor-nunicode
) )
@@ -156,9 +156,9 @@ set(qmaplibregl_headers
${PROJECT_SOURCE_DIR}/platform/qt/include/QMapLibreGL/Utils ${PROJECT_SOURCE_DIR}/platform/qt/include/QMapLibreGL/Utils
) )
if (MBGL_QT_INSIDE_PLUGIN) if (MLN_QT_INSIDE_PLUGIN)
add_library(qmaplibregl OBJECT) add_library(qmaplibregl OBJECT)
elseif(MBGL_QT_STATIC) elseif(MLN_QT_STATIC)
add_library(qmaplibregl STATIC) add_library(qmaplibregl STATIC)
else() else()
add_library(qmaplibregl SHARED) add_library(qmaplibregl SHARED)
@@ -193,21 +193,21 @@ set_target_properties(
AUTOMOC ON AUTOMOC ON
EXPORT_NAME QMapLibreGL EXPORT_NAME QMapLibreGL
OUTPUT_NAME QMapLibreGL OUTPUT_NAME QMapLibreGL
VERSION ${MBGL_QT_VERSION} VERSION ${MLN_QT_VERSION}
SOVERSION ${MBGL_QT_VERSION_COMPATIBILITY} SOVERSION ${MLN_QT_VERSION_COMPATIBILITY}
PUBLIC_HEADER "${qmaplibregl_headers}" PUBLIC_HEADER "${qmaplibregl_headers}"
) )
if (Qt6_FOUND AND COMMAND qt_enable_autogen_tool) if (Qt6_FOUND AND COMMAND qt_enable_autogen_tool)
qt_enable_autogen_tool(qmaplibregl "moc" ON) qt_enable_autogen_tool(qmaplibregl "moc" ON)
endif() endif()
if (APPLE AND NOT MBGL_QT_STATIC AND NOT MBGL_QT_INSIDE_PLUGIN) if (APPLE AND NOT MLN_QT_STATIC AND NOT MLN_QT_INSIDE_PLUGIN)
set_target_properties( set_target_properties(
qmaplibregl PROPERTIES qmaplibregl PROPERTIES
FRAMEWORK ON FRAMEWORK ON
FRAMEWORK_VERSION A FRAMEWORK_VERSION A
MACOSX_FRAMEWORK_IDENTIFIER org.maplibre.QMapLibreGL MACOSX_FRAMEWORK_IDENTIFIER org.maplibre.QMapLibreGL
MACOSX_FRAMEWORK_BUNDLE_VERSION ${MBGL_QT_VERSION} MACOSX_FRAMEWORK_BUNDLE_VERSION ${MLN_QT_VERSION}
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${MBGL_QT_VERSION} MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${MLN_QT_VERSION}
) )
target_include_directories( target_include_directories(
qmaplibregl qmaplibregl
@@ -227,7 +227,7 @@ configure_package_config_file(
CMAKE_INSTALL_LIBDIR NO_CHECK_REQUIRED_COMPONENTS_MACRO) CMAKE_INSTALL_LIBDIR NO_CHECK_REQUIRED_COMPONENTS_MACRO)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/QMapLibreGLConfigVersion.cmake write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/QMapLibreGLConfigVersion.cmake
VERSION ${MBGL_QT_VERSION} VERSION ${MLN_QT_VERSION}
COMPATIBILITY AnyNewerVersion) COMPATIBILITY AnyNewerVersion)
install(EXPORT QMapLibreGLTargets install(EXPORT QMapLibreGLTargets
@@ -248,7 +248,7 @@ install(
COMPONENT development COMPONENT development
) )
if(MBGL_QT_DEPLOYMENT) if(MLN_QT_DEPLOYMENT)
install(FILES ${PROJECT_SOURCE_DIR}/LICENSE.md install(FILES ${PROJECT_SOURCE_DIR}/LICENSE.md
DESTINATION .) DESTINATION .)
endif() endif()
@@ -281,18 +281,18 @@ target_link_libraries(
$<BUILD_INTERFACE:mbgl-vendor-csscolorparser> $<BUILD_INTERFACE:mbgl-vendor-csscolorparser>
) )
# Do not use generator expressions for cleaner output # Do not use generator expressions for cleaner output
if (MBGL_QT_STATIC AND NOT MBGL_QT_INSIDE_PLUGIN) if (MLN_QT_STATIC AND NOT MLN_QT_INSIDE_PLUGIN)
target_link_libraries( target_link_libraries(
qmaplibregl qmaplibregl
PUBLIC PUBLIC
$<$<NOT:$<BOOL:${MBGL_QT_WITH_INTERNAL_SQLITE}>>:Qt${QT_VERSION_MAJOR}::Sql> $<$<NOT:$<BOOL:${MLN_QT_WITH_INTERNAL_SQLITE}>>:Qt${QT_VERSION_MAJOR}::Sql>
$<$<NOT:$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Emscripten>>>:z> $<$<NOT:$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Emscripten>>>:z>
) )
endif() endif()
if (MBGL_QT_STATIC OR MBGL_QT_INSIDE_PLUGIN) if (MLN_QT_STATIC OR MLN_QT_INSIDE_PLUGIN)
# Don't add import/export into public header because we don't build shared library. # Don't add import/export into public header because we don't build shared library.
# In case on MBGL_QT_INSIDE_PLUGIN it's always OBJECT library and bundled into one # In case on MLN_QT_INSIDE_PLUGIN it's always OBJECT library and bundled into one
# single Qt plugin lib. # single Qt plugin lib.
target_compile_definitions( target_compile_definitions(
qmaplibregl qmaplibregl
@@ -312,7 +312,7 @@ install(TARGETS qmaplibregl
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/QMapLibreGL" PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/QMapLibreGL"
) )
if(NOT MBGL_QT_LIBRARY_ONLY) if(NOT MLN_QT_LIBRARY_ONLY)
add_executable( add_executable(
mbgl-qt mbgl-qt
${PROJECT_SOURCE_DIR}/platform/qt/app/main.cpp ${PROJECT_SOURCE_DIR}/platform/qt/app/main.cpp
@@ -396,21 +396,21 @@ if(NOT MBGL_QT_LIBRARY_ONLY)
endif() endif()
endif() endif()
find_program(MBGL_QDOC NAMES qdoc) find_program(MLN_QDOC NAMES qdoc)
if(MBGL_QDOC) if(MLN_QDOC)
add_custom_target(mbgl-qt-docs) add_custom_target(mbgl-qt-docs)
add_custom_command( add_custom_command(
TARGET mbgl-qt-docs PRE_BUILD TARGET mbgl-qt-docs PRE_BUILD
COMMAND COMMAND
${MBGL_QDOC} ${MLN_QDOC}
${PROJECT_SOURCE_DIR}/platform/qt/config.qdocconf ${PROJECT_SOURCE_DIR}/platform/qt/config.qdocconf
-outputdir -outputdir
${CMAKE_BINARY_DIR}/docs ${CMAKE_BINARY_DIR}/docs
) )
endif() endif()
if(NOT MBGL_QT_LIBRARY_ONLY) if(NOT MLN_QT_LIBRARY_ONLY)
add_test(NAME mbgl-test-runner COMMAND mbgl-test-runner WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) add_test(NAME mbgl-test-runner COMMAND mbgl-test-runner WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
endif() endif()

View File

@@ -25,9 +25,9 @@ cmake "$1" \
-DANDROID_ABI="$4" \ -DANDROID_ABI="$4" \
-DANDROID_NATIVE_API_LEVEL=21 \ -DANDROID_NATIVE_API_LEVEL=21 \
-G Ninja \ -G Ninja \
-DMBGL_WITH_QT=ON \ -DMLN_WITH_QT=ON \
-DMBGL_QT_STATIC=ON \ -DMLN_QT_STATIC=ON \
-DMBGL_QT_LIBRARY_ONLY=ON \ -DMLN_QT_LIBRARY_ONLY=ON \
-DCMAKE_CXX_FLAGS_RELEASE=-g0 \ -DCMAKE_CXX_FLAGS_RELEASE=-g0 \
-DCMAKE_INSTALL_PREFIX="$2" \ -DCMAKE_INSTALL_PREFIX="$2" \
-DCMAKE_FIND_ROOT_PATH="$3/android" \ -DCMAKE_FIND_ROOT_PATH="$3/android" \

View File

@@ -13,5 +13,5 @@ fi
cmake "$1" \ cmake "$1" \
-G Ninja \ -G Ninja \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DMBGL_WITH_QT=ON \ -DMLN_WITH_QT=ON \
-DCMAKE_INSTALL_PREFIX="$2" -DCMAKE_INSTALL_PREFIX="$2"

View File

@@ -5,4 +5,4 @@ cmake -S "$path" `
-GNinja ` -GNinja `
-DCMAKE_BUILD_TYPE="Release" ` -DCMAKE_BUILD_TYPE="Release" `
-DCMAKE_INSTALL_PREFIX="$install" ` -DCMAKE_INSTALL_PREFIX="$install" `
-DMBGL_WITH_QT=ON -DMLN_WITH_QT=ON

View File

@@ -5,6 +5,6 @@ cmake -S "$path" `
-GNinja ` -GNinja `
-DCMAKE_BUILD_TYPE="Release" ` -DCMAKE_BUILD_TYPE="Release" `
-DCMAKE_INSTALL_PREFIX="$install" ` -DCMAKE_INSTALL_PREFIX="$install" `
-DMBGL_WITH_QT=ON ` -DMLN_WITH_QT=ON `
-DMBGL_QT_STATIC=ON ` -DMLN_QT_STATIC=ON `
-DMBGL_QT_LIBRARY_ONLY=ON -DMLN_QT_LIBRARY_ONLY=ON

View File

@@ -21,9 +21,9 @@ cmake "$1" \
-DCMAKE_CONFIGURATION_TYPES="Release;Debug" \ -DCMAKE_CONFIGURATION_TYPES="Release;Debug" \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="12.0" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="12.0" \
-DMBGL_WITH_QT=ON \ -DMLN_WITH_QT=ON \
-DMBGL_QT_STATIC=ON \ -DMLN_QT_STATIC=ON \
-DMBGL_QT_LIBRARY_ONLY=ON \ -DMLN_QT_LIBRARY_ONLY=ON \
-DCMAKE_INSTALL_PREFIX="$2" \ -DCMAKE_INSTALL_PREFIX="$2" \
-DCMAKE_FIND_ROOT_PATH="$3/ios" \ -DCMAKE_FIND_ROOT_PATH="$3/ios" \
-DCMAKE_PREFIX_PATH="$3/ios" -DCMAKE_PREFIX_PATH="$3/ios"

View File

@@ -14,5 +14,5 @@ cmake "$1" \
-G Ninja \ -G Ninja \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" \
-DMBGL_WITH_QT=ON \ -DMLN_WITH_QT=ON \
-DCMAKE_INSTALL_PREFIX="$2" -DCMAKE_INSTALL_PREFIX="$2"

View File

@@ -14,7 +14,7 @@ cmake "$1" \
-G Ninja \ -G Ninja \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" \
-DMBGL_WITH_QT=ON \ -DMLN_WITH_QT=ON \
-DMBGL_QT_STATIC=ON \ -DMLN_QT_STATIC=ON \
-DMBGL_QT_LIBRARY_ONLY=ON \ -DMLN_QT_LIBRARY_ONLY=ON \
-DCMAKE_INSTALL_PREFIX="$2" -DCMAKE_INSTALL_PREFIX="$2"

View File

@@ -5,4 +5,4 @@ qt-cmake -S "$path" `
-GNinja ` -GNinja `
-DCMAKE_BUILD_TYPE="Release" ` -DCMAKE_BUILD_TYPE="Release" `
-DCMAKE_INSTALL_PREFIX="$install" ` -DCMAKE_INSTALL_PREFIX="$install" `
-DMBGL_WITH_QT=ON -DMLN_WITH_QT=ON

View File

@@ -15,5 +15,5 @@ qt-cmake "$1" \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" \
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
-DMBGL_WITH_QT=ON \ -DMLN_WITH_QT=ON \
-DCMAKE_INSTALL_PREFIX="$2" -DCMAKE_INSTALL_PREFIX="$2"

View File

@@ -15,7 +15,7 @@ qt-cmake "$1" \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" \
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
-DMBGL_WITH_QT=ON \ -DMLN_WITH_QT=ON \
-DMBGL_QT_STATIC=ON \ -DMLN_QT_STATIC=ON \
-DMBGL_QT_LIBRARY_ONLY=ON \ -DMLN_QT_LIBRARY_ONLY=ON \
-DCMAKE_INSTALL_PREFIX="$2" -DCMAKE_INSTALL_PREFIX="$2"

View File

@@ -34,13 +34,13 @@ It will take some time to build and install all components on which Maplibre dep
To configure build with EGL support (ANGLE libraries will be build), use the following command: To configure build with EGL support (ANGLE libraries will be build), use the following command:
```cmd ```cmd
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DMBGL_WITH_EGL=ON cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DMLN_WITH_EGL=ON
``` ```
To configure build with OSMesa (software rendering), use the following command: To configure build with OSMesa (software rendering), use the following command:
``` ```
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DMBGL_WITH_OSMESA=ON cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DMLN_WITH_OSMESA=ON
``` ```
**WARNING:** as OSMesa doesn't have static libraries, it's necessary to copy `libglapi.dll`, `libGLESv3.dll` and `osmesa.dll` from `platform\windows\vendor\mesa3d\<arch>` to executable/dll directory you want to use, otherwise it won't run. **WARNING:** as OSMesa doesn't have static libraries, it's necessary to copy `libglapi.dll`, `libGLESv3.dll` and `osmesa.dll` from `platform\windows\vendor\mesa3d\<arch>` to executable/dll directory you want to use, otherwise it won't run.
@@ -64,11 +64,11 @@ cmake . -B build
The same can be done with alternative configure commands: The same can be done with alternative configure commands:
```cmd ```cmd
cmake . -B build -DMBGL_WITH_EGL=ON cmake . -B build -DMLN_WITH_EGL=ON
``` ```
or or
```cmd ```cmd
cmake . -B build -DMBGL_WITH_OSMESA=ON cmake . -B build -DMLN_WITH_OSMESA=ON
``` ```
Once configure is done, open the file `build\Mapbox GL Native.sln`. Build the target `ALL_BUILD` to build all targets, or pick a specific target. Don't forget to pick a build configuration (`Release`, `RelWithDebInfo`, `MinSizeRel` or `Debug`), otherwise the project will be built with default configuration (`Debug`). Once configure is done, open the file `build\Mapbox GL Native.sln`. Build the target `ALL_BUILD` to build all targets, or pick a specific target. Don't forget to pick a build configuration (`Release`, `RelWithDebInfo`, `MinSizeRel` or `Debug`), otherwise the project will be built with default configuration (`Debug`).

View File

@@ -1,6 +1,6 @@
if(MBGL_WITH_EGL) if(MLN_WITH_EGL)
set(_RENDERER EGL) set(_RENDERER EGL)
elseif(MBGL_WITH_OSMESA) elseif(MLN_WITH_OSMESA)
set(_RENDERER OSMesa) set(_RENDERER OSMesa)
else() else()
set(_RENDERER OpenGL) set(_RENDERER OpenGL)
@@ -74,7 +74,7 @@ target_compile_definitions(
CURL_STATICLIB CURL_STATICLIB
) )
if(MBGL_WITH_EGL) if(MLN_WITH_EGL)
find_package(unofficial-angle CONFIG REQUIRED) find_package(unofficial-angle CONFIG REQUIRED)
target_sources( target_sources(
mbgl-core mbgl-core
@@ -93,7 +93,7 @@ if(MBGL_WITH_EGL)
unofficial::angle::libEGL unofficial::angle::libEGL
unofficial::angle::libGLESv3 unofficial::angle::libGLESv3
) )
elseif(MBGL_WITH_OSMESA) elseif(MLN_WITH_OSMESA)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR}/vendor/mesa3d) list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR}/vendor/mesa3d)
@@ -153,7 +153,7 @@ include(${PROJECT_SOURCE_DIR}/vendor/sqlite.cmake)
if(NOT ${ICU_FOUND} OR "${ICU_VERSION}" VERSION_LESS 62.0) if(NOT ${ICU_FOUND} OR "${ICU_VERSION}" VERSION_LESS 62.0)
message(STATUS "ICU not found or too old, using builtin.") message(STATUS "ICU not found or too old, using builtin.")
set(MBGL_USE_BUILTIN_ICU TRUE) set(MLN_USE_BUILTIN_ICU TRUE)
include(${PROJECT_SOURCE_DIR}/vendor/icu.cmake) include(${PROJECT_SOURCE_DIR}/vendor/icu.cmake)
set_source_files_properties( set_source_files_properties(
@@ -171,10 +171,10 @@ target_link_libraries(
${JPEG_LIBRARIES} ${JPEG_LIBRARIES}
${LIBUV_LIBRARIES} ${LIBUV_LIBRARIES}
dlfcn-win32::dl dlfcn-win32::dl
$<$<NOT:$<BOOL:${MBGL_USE_BUILTIN_ICU}>>:ICU::data> $<$<NOT:$<BOOL:${MLN_USE_BUILTIN_ICU}>>:ICU::data>
$<$<NOT:$<BOOL:${MBGL_USE_BUILTIN_ICU}>>:ICU::i18n> $<$<NOT:$<BOOL:${MLN_USE_BUILTIN_ICU}>>:ICU::i18n>
$<$<NOT:$<BOOL:${MBGL_USE_BUILTIN_ICU}>>:ICU::uc> $<$<NOT:$<BOOL:${MLN_USE_BUILTIN_ICU}>>:ICU::uc>
$<$<BOOL:${MBGL_USE_BUILTIN_ICU}>:mbgl-vendor-icu> $<$<BOOL:${MLN_USE_BUILTIN_ICU}>:mbgl-vendor-icu>
PNG::PNG PNG::PNG
mbgl-vendor-nunicode mbgl-vendor-nunicode
mbgl-vendor-sqlite mbgl-vendor-sqlite

View File

@@ -113,7 +113,7 @@ add_library(
# MapSnapshotter uses headless backend that is rendering image on a background thread. QT / macOS adaptation for headless backend creates # MapSnapshotter uses headless backend that is rendering image on a background thread. QT / macOS adaptation for headless backend creates
# new window and updates it's parameters, which is not allowed since macOS mohave 10.14. Following block disables snapshotter unit tests for # new window and updates it's parameters, which is not allowed since macOS mohave 10.14. Following block disables snapshotter unit tests for
# QT on macOS. https://github.com/mapbox/mapbox-gl-native/issues/16267 # QT on macOS. https://github.com/mapbox/mapbox-gl-native/issues/16267
if(NOT (MBGL_WITH_QT AND CMAKE_SYSTEM_NAME STREQUAL Darwin)) if(NOT (MLN_WITH_QT AND CMAKE_SYSTEM_NAME STREQUAL Darwin))
target_sources( target_sources(
mbgl-test mbgl-test
PRIVATE PRIVATE
@@ -121,7 +121,7 @@ if(NOT (MBGL_WITH_QT AND CMAKE_SYSTEM_NAME STREQUAL Darwin))
) )
endif() endif()
if(MBGL_WITH_OPENGL) if(MLN_WITH_OPENGL)
target_sources( target_sources(
mbgl-test mbgl-test
PRIVATE PRIVATE
@@ -142,9 +142,9 @@ endif()
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Android AND ANDROID_NATIVE_API_LEVEL VERSION_LESS 24) if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Android AND ANDROID_NATIVE_API_LEVEL VERSION_LESS 24)
message("Target platform does not support HTTP tests or dependencies not found.") message("Target platform does not support HTTP tests or dependencies not found.")
set(MBGL_TEST_HAS_TEST_SERVER 0) set(MLN_TEST_HAS_TEST_SERVER 0)
else() else()
set(MBGL_TEST_HAS_TEST_SERVER 1) set(MLN_TEST_HAS_TEST_SERVER 1)
target_sources( target_sources(
mbgl-test mbgl-test
PRIVATE ${PROJECT_SOURCE_DIR}/test/src/mbgl/test/http_server.cpp PRIVATE ${PROJECT_SOURCE_DIR}/test/src/mbgl/test/http_server.cpp
@@ -164,14 +164,14 @@ else()
endif() endif()
if(NOT DEFINED ENV{CI}) if(NOT DEFINED ENV{CI})
set(MBGL_TEST_BUILD_ON_CI 0) set(MLN_TEST_BUILD_ON_CI 0)
else() else()
set(MBGL_TEST_BUILD_ON_CI 1) set(MLN_TEST_BUILD_ON_CI 1)
endif() endif()
target_compile_definitions( target_compile_definitions(
mbgl-test mbgl-test
PRIVATE TEST_HAS_SERVER=${MBGL_TEST_HAS_TEST_SERVER} CI_BUILD=${MBGL_TEST_BUILD_ON_CI} PRIVATE TEST_HAS_SERVER=${MLN_TEST_HAS_TEST_SERVER} CI_BUILD=${MLN_TEST_BUILD_ON_CI}
) )
target_include_directories( target_include_directories(
@@ -210,12 +210,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
endif() endif()
# Needed for testing private classes # Needed for testing private classes
get_target_property(MBGL_CORE_PRIVATE_LIBRARIES mbgl-core LINK_LIBRARIES) get_target_property(MLN_CORE_PRIVATE_LIBRARIES mbgl-core LINK_LIBRARIES)
target_link_libraries( target_link_libraries(
mbgl-test mbgl-test
PRIVATE PRIVATE
${MBGL_CORE_PRIVATE_LIBRARIES} ${MLN_CORE_PRIVATE_LIBRARIES}
Mapbox::Base::Extras::args Mapbox::Base::Extras::args
Mapbox::Base::pixelmatch-cpp Mapbox::Base::pixelmatch-cpp
mbgl-compiler-options mbgl-compiler-options
@@ -238,6 +238,6 @@ endif()
set_property(TARGET mbgl-test PROPERTY FOLDER Core) set_property(TARGET mbgl-test PROPERTY FOLDER Core)
if (MBGL_WITH_CLANG_TIDY) if (MLN_WITH_CLANG_TIDY)
set_target_properties(mbgl-test PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}") set_target_properties(mbgl-test PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
endif() endif()

View File

@@ -2,7 +2,7 @@ if(TARGET mbgl-vendor-csscolorparser)
return() return()
endif() endif()
if(MBGL_WITH_QT AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0") if(MLN_WITH_QT AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
add_library(mbgl-vendor-csscolorparser OBJECT) add_library(mbgl-vendor-csscolorparser OBJECT)
else() else()
add_library(mbgl-vendor-csscolorparser STATIC) add_library(mbgl-vendor-csscolorparser STATIC)

View File

@@ -2,7 +2,7 @@ if(TARGET mbgl-vendor-nunicode)
return() return()
endif() endif()
if(MBGL_WITH_QT AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0") if(MLN_WITH_QT AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
add_library(mbgl-vendor-nunicode OBJECT) add_library(mbgl-vendor-nunicode OBJECT)
else() else()
add_library(mbgl-vendor-nunicode STATIC) add_library(mbgl-vendor-nunicode STATIC)

View File

@@ -2,7 +2,7 @@ if(TARGET mbgl-vendor-parsedate)
return() return()
endif() endif()
if(MBGL_WITH_QT AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0") if(MLN_WITH_QT AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
add_library(mbgl-vendor-parsedate OBJECT) add_library(mbgl-vendor-parsedate OBJECT)
else() else()
add_library(mbgl-vendor-parsedate STATIC) add_library(mbgl-vendor-parsedate STATIC)

4
vendor/sqlite.cmake vendored
View File

@@ -8,9 +8,9 @@ add_library(
) )
include(CheckSymbolExists) include(CheckSymbolExists)
check_symbol_exists("strerror_r" "string.h" MBGL_SQLITE3_HAVE_STRERROR_R) check_symbol_exists("strerror_r" "string.h" MLN_SQLITE3_HAVE_STRERROR_R)
if(MBGL_SQLITE3_HAVE_STRERROR_R) if(MLN_SQLITE3_HAVE_STRERROR_R)
target_compile_definitions( target_compile_definitions(
mbgl-vendor-sqlite mbgl-vendor-sqlite
PRIVATE HAVE_STRERROR_R PRIVATE HAVE_STRERROR_R