From 8d0f299d1c25482be7f69e6d36a3137b2fcd0f20 Mon Sep 17 00:00:00 2001 From: Tadej Novak Date: Sat, 22 Apr 2023 17:50:04 +0200 Subject: [PATCH] [cmake] Use MLN prefix instead of MBGL --- .github/actions/qt5-build/entrypoint.sh | 6 +- .github/actions/qt6-build/entrypoint.sh | 6 +- .github/workflows/android-ci-pull.yml | 2 +- .github/workflows/android-ci.yml | 2 +- .github/workflows/linux-ci.yml | 2 +- .github/workflows/qt-ci.yml | 12 +- BUILD.bazel | 2 +- CHANGELOG.md | 1 + CMakeLists.txt | 82 +++++------ CONTRIBUTING.md | 4 +- DEVELOPING.md | 2 +- benchmark/CMakeLists.txt | 4 +- expression-test/CMakeLists.txt | 4 +- platform/android/Makefile | 128 +++++++++--------- platform/glfw/CMakeLists.txt | 10 +- platform/ios/ios-test-runners.cmake | 8 +- platform/ios/ios.cmake | 10 +- platform/ios/scripts/standalone.cmake | 4 +- platform/linux/linux.cmake | 18 +-- platform/macos/macos.cmake | 2 +- platform/node/CMakeLists.txt | 2 +- platform/node/DEVELOPING.md | 2 +- platform/node/cmake/module.cmake | 2 +- platform/qt/QMapLibreGLConfig.cmake.in | 2 +- platform/qt/README.md | 2 +- platform/qt/qt.cmake | 74 +++++----- .../scripts/configure_Qt5_Android_static.sh | 6 +- platform/qt/scripts/configure_Qt5_Linux.sh | 2 +- platform/qt/scripts/configure_Qt5_Windows.ps1 | 2 +- .../scripts/configure_Qt5_Windows_static.ps1 | 6 +- .../qt/scripts/configure_Qt5_iOS_static.sh | 6 +- platform/qt/scripts/configure_Qt5_macOS.sh | 2 +- .../qt/scripts/configure_Qt5_macOS_static.sh | 6 +- platform/qt/scripts/configure_Qt6_Windows.ps1 | 2 +- platform/qt/scripts/configure_Qt6_macOS.sh | 2 +- .../qt/scripts/configure_Qt6_macOS_static.sh | 6 +- platform/windows/README.md | 8 +- platform/windows/windows.cmake | 18 +-- test/CMakeLists.txt | 22 +-- vendor/csscolorparser.cmake | 2 +- vendor/nunicode.cmake | 2 +- vendor/parsedate.cmake | 2 +- vendor/sqlite.cmake | 4 +- 43 files changed, 246 insertions(+), 245 deletions(-) diff --git a/.github/actions/qt5-build/entrypoint.sh b/.github/actions/qt5-build/entrypoint.sh index 5aa2f884e98..6add42fe807 100755 --- a/.github/actions/qt5-build/entrypoint.sh +++ b/.github/actions/qt5-build/entrypoint.sh @@ -15,8 +15,8 @@ cmake ../source/ \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_INSTALL_PREFIX=../install \ - -DMBGL_WITH_QT=ON \ - -DMBGL_QT_DEPLOYMENT=ON \ - -DMBGL_QT_LIBRARY_ONLY=ON + -DMLN_WITH_QT=ON \ + -DMLN_QT_DEPLOYMENT=ON \ + -DMLN_QT_LIBRARY_ONLY=ON ninja ninja install diff --git a/.github/actions/qt6-build/entrypoint.sh b/.github/actions/qt6-build/entrypoint.sh index 8dfd07c364e..8dce4ec6309 100755 --- a/.github/actions/qt6-build/entrypoint.sh +++ b/.github/actions/qt6-build/entrypoint.sh @@ -13,9 +13,9 @@ qt-cmake ../source/ \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_INSTALL_PREFIX=../install \ - -DMBGL_WITH_QT=ON \ - -DMBGL_QT_DEPLOYMENT=ON \ - -DMBGL_QT_LIBRARY_ONLY=ON + -DMLN_WITH_QT=ON \ + -DMLN_QT_DEPLOYMENT=ON \ + -DMLN_QT_LIBRARY_ONLY=ON ninja ninja install cd ../install diff --git a/.github/workflows/android-ci-pull.yml b/.github/workflows/android-ci-pull.yml index df1e127e1ea..f2c9d960a9d 100644 --- a/.github/workflows/android-ci-pull.yml +++ b/.github/workflows/android-ci-pull.yml @@ -37,7 +37,7 @@ jobs: JOBS: 8 BUILDTYPE: Debug IS_LOCAL_DEVELOPMENT: false - MBGL_ANDROID_STL: c++_static + MLN_ANDROID_STL: c++_static steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml index 4d97e693bc9..8d350a1aae1 100644 --- a/.github/workflows/android-ci.yml +++ b/.github/workflows/android-ci.yml @@ -34,7 +34,7 @@ jobs: JOBS: 8 BUILDTYPE: Debug IS_LOCAL_DEVELOPMENT: false - MBGL_ANDROID_STL: c++_static + MLN_ANDROID_STL: c++_static steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index 93fc6be3258..7d8a3ed1200 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -53,7 +53,7 @@ jobs: - name: Build Maplibre GL Core run: | 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 - name: Archive mbgl-test-runner diff --git a/.github/workflows/qt-ci.yml b/.github/workflows/qt-ci.yml index 5e3b7501d62..a377eaf91c1 100644 --- a/.github/workflows/qt-ci.yml +++ b/.github/workflows/qt-ci.yml @@ -194,9 +194,9 @@ jobs: -DCMAKE_INSTALL_PREFIX="../install" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="${DEPLOYMENT_TARGET}" \ -DCMAKE_OSX_ARCHITECTURES="${DEPLOYMENT_ARCH}" \ - -DMBGL_WITH_QT=ON \ - -DMBGL_QT_DEPLOYMENT=ON \ - -DMBGL_QT_LIBRARY_ONLY=ON + -DMLN_WITH_QT=ON \ + -DMLN_QT_DEPLOYMENT=ON \ + -DMLN_QT_LIBRARY_ONLY=ON ninja ninja install @@ -221,9 +221,9 @@ jobs: -DCMAKE_C_COMPILER_LAUNCHER="ccache.exe" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache.exe" \ -DCMAKE_INSTALL_PREFIX="../install" \ - -DMBGL_WITH_QT=ON \ - -DMBGL_QT_DEPLOYMENT=ON \ - -DMBGL_QT_LIBRARY_ONLY=ON + -DMLN_WITH_QT=ON \ + -DMLN_QT_DEPLOYMENT=ON \ + -DMLN_QT_LIBRARY_ONLY=ON ninja.exe ninja.exe install diff --git a/BUILD.bazel b/BUILD.bazel index dbb228827d9..ce601ad5ad1 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -26,7 +26,7 @@ cc_library( "src", ], local_defines = [ - r"MBGL_VERSION_REV=\"standalone\"", + r"MLN_VERSION_REV=\"standalone\"", ], visibility = ["//visibility:public"], deps = [ diff --git a/CHANGELOG.md b/CHANGELOG.md index bdb02f5827b..5c6633b0c47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### ✨ New features - *...Add new stuff here...* +- [core] All CMake properties are now prefixed `MLN_*` [1054](https://github.com/maplibre/maplibre-gl-native/pull/1054). - [windows] Added windows build support for core applications and node [#707](https://github.com/maplibre/maplibre-gl-native/pull/707) - [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). diff --git a/CMakeLists.txt b/CMakeLists.txt index e42e54da3f9..337d5023543 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,18 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR) -option(MBGL_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(MBGL_WITH_COVERAGE "Enable code coverage collection" OFF) -option(MBGL_WITH_QT "Build MapLibre Native Qt bindings" OFF) +option(MLN_WITH_CORE_ONLY "Build only the core bits, no platform code" OFF) +option(MLN_WITH_CLANG_TIDY "Build with clang-tidy checks enabled" OFF) +option(MLN_WITH_COVERAGE "Enable code coverage collection" OFF) +option(MLN_WITH_QT "Build MapLibre Native Qt bindings" OFF) option(MLN_WITH_NODE "Build MapLibre Native Node.js bindings" OFF) -option(MBGL_WITH_SANITIZER "Use [address|thread|undefined] here" OFF) -option(MBGL_WITH_RTTI "Compile with runtime type information" OFF) -option(MBGL_WITH_OPENGL "Build with OpenGL renderer" ON) -option(MBGL_WITH_EGL "Build with EGL renderer" OFF) -option(MBGL_WITH_OSMESA "Build with OSMesa (Software) renderer" OFF) -option(MBGL_WITH_WERROR "Make all compilation warnings errors" ON) +option(MLN_WITH_SANITIZER "Use [address|thread|undefined] here" OFF) +option(MLN_WITH_RTTI "Compile with runtime type information" OFF) +option(MLN_WITH_OPENGL "Build with OpenGL renderer" ON) +option(MLN_WITH_EGL "Build with EGL renderer" OFF) +option(MLN_WITH_OSMESA "Build with OSMesa (Software) renderer" OFF) +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) if(NOT CLANG_TIDY_COMMAND) 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") 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) 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) endif() @@ -58,35 +58,35 @@ set(UBSAN_BLACKLIST ${PROJECT_SOURCE_DIR}/scripts/ubsan.blacklist) target_compile_options( mbgl-compiler-options INTERFACE - $<$:--coverage> - $<$:-DSANITIZE> - $<$:-fno-omit-frame-pointer> - $<$:-fno-optimize-sibling-calls> - $<$:-fsanitize=address> - $<$:-fsanitize=thread> - $<$:-fsanitize=implicit-conversion, + $<$:--coverage> + $<$:-DSANITIZE> + $<$:-fno-omit-frame-pointer> + $<$:-fno-optimize-sibling-calls> + $<$:-fsanitize=address> + $<$:-fsanitize=thread> + $<$:-fsanitize=implicit-conversion, -fsanitize-blacklist=${UBSAN_BLACKLIST}> - $<$:-fsanitize=undefined, + $<$:-fsanitize=undefined, -fsanitize-blacklist=${UBSAN_BLACKLIST}> - $<$:-fsanitize=unsigned-integer-overflow, + $<$:-fsanitize=unsigned-integer-overflow, -fsanitize-blacklist=${UBSAN_BLACKLIST}> - $<$:-fsanitize=nullability, + $<$:-fsanitize=nullability, -fsanitize-blacklist=${UBSAN_BLACKLIST}> - $<$:-fsanitize=float-divide-by-zero, + $<$:-fsanitize=float-divide-by-zero, -fsanitize-blacklist=${UBSAN_BLACKLIST}> $<$:-fembed-bitcode> - $<$,$,$>>>:-fno-rtti> + $<$,$,$>>>:-fno-rtti> $<$,$>>:-Wall> $<$,$>>:-Wshadow> $<$,$>>:-Wextra> - $<$,$>,$>:-Werror> + $<$,$>,$>:-Werror> $<$,$>:-Wno-error=tautological-constant-compare> $<$:-Wno-error=maybe-uninitialized> $<$:-Wno-error=return-type> $<$:-Wno-error=unknown-pragmas> - $<$,$>>:-Wno-error=deprecated-declarations> - $<$,$>>:-Wno-error=unused-parameter> - $<$,$>>:-Wno-error=unused-property-ivar> + $<$,$>>:-Wno-error=deprecated-declarations> + $<$,$>>:-Wno-error=unused-parameter> + $<$,$>>:-Wno-error=unused-property-ivar> $<$:/utf-8> $<$:/WX> # all warnings as errors $<$:/EHsc> # exceptions @@ -100,10 +100,10 @@ target_compile_options( target_link_libraries( mbgl-compiler-options INTERFACE - $<$:--coverage> - $<$:-fsanitize=address> - $<$:-fsanitize=thread> - $<$:-fsanitize=undefined> + $<$:--coverage> + $<$:-fsanitize=address> + $<$:-fsanitize=thread> + $<$:-fsanitize=undefined> ) cmake_policy(SET CMP0063 NEW) @@ -124,7 +124,7 @@ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) 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) else() add_library(mbgl-core STATIC) @@ -870,7 +870,7 @@ list(APPEND SRC_FILES ${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") target_compile_definitions( mbgl-core @@ -983,7 +983,7 @@ target_sources( ${SRC_FILES} ) -if (MBGL_WITH_CLANG_TIDY) +if (MLN_WITH_CLANG_TIDY) set_target_properties(mbgl-core PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}") endif() @@ -998,18 +998,18 @@ if(EXISTS ${PROJECT_SOURCE_DIR}/.git/HEAD) --short=8 HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - OUTPUT_VARIABLE MBGL_VERSION_REV + OUTPUT_VARIABLE MLN_VERSION_REV OUTPUT_STRIP_TRAILING_WHITESPACE ) else() - set(MBGL_VERSION_REV 00000000) + set(MLN_VERSION_REV 00000000) endif() set_source_files_properties( ${PROJECT_SOURCE_DIR}/src/mbgl/util/version.cpp PROPERTIES COMPILE_DEFINITIONS - MBGL_VERSION_REV="${MBGL_VERSION_REV}" + MBGL_VERSION_REV="${MLN_VERSION_REV}" ) target_include_directories( @@ -1110,13 +1110,13 @@ add_library( Mapbox::Map ALIAS mbgl-core ) -if(MBGL_WITH_CORE_ONLY) +if(MLN_WITH_CORE_ONLY) return() endif() include(${PROJECT_SOURCE_DIR}/scripts/license.cmake) -if(MBGL_WITH_QT) +if(MLN_WITH_QT) include(${PROJECT_SOURCE_DIR}/platform/qt/qt.cmake) elseif(CMAKE_SYSTEM_NAME STREQUAL Android) include(${PROJECT_SOURCE_DIR}/platform/android/android.cmake) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1668b822902..1628d93cf81 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,11 +17,11 @@ MapLibre GL Native shares a single C++ core library with all platforms. To build To build, run the following from the root directory ```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. -`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. diff --git a/DEVELOPING.md b/DEVELOPING.md index 2d6ffed3e4c..a92594ba23a 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -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/). ## 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). ## Logging in C++ diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 8b6d28f5940..7ffb01cdb81 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -52,11 +52,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin) endif() # 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( 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 ) diff --git a/expression-test/CMakeLists.txt b/expression-test/CMakeLists.txt index 19597520586..c6a2f5b9195 100644 --- a/expression-test/CMakeLists.txt +++ b/expression-test/CMakeLists.txt @@ -34,10 +34,10 @@ target_link_libraries( 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( 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} ) diff --git a/platform/android/Makefile b/platform/android/Makefile index fd108eba1be..81bc2dc97b0 100644 --- a/platform/android/Makefile +++ b/platform/android/Makefile @@ -31,23 +31,23 @@ endif #### Android targets ########################################################### -MBGL_ANDROID_ABIS = arm-v7;armeabi-v7a -MBGL_ANDROID_ABIS += arm-v8;arm64-v8a -MBGL_ANDROID_ABIS += x86;x86 -MBGL_ANDROID_ABIS += x86-64;x86_64 - -MBGL_ANDROID_LOCAL_WORK_DIR = /data/local/tmp/core-tests -MBGL_ANDROID_LOCAL_BENCHMARK_DIR = /data/local/tmp/benchmark -MBGL_ANDROID_LIBDIR = lib$(if $(filter arm-v8 x86-64,$1),64) -MBGL_ANDROID_DALVIKVM = dalvikvm$(if $(filter arm-v8 x86-64,$1),64,32) -MBGL_ANDROID_APK_SUFFIX = $(if $(filter Release,$(BUILDTYPE)),release,debug) -MBGL_ANDROID_CORE_TEST_DIR = MapboxGLAndroidSDK/.externalNativeBuild/cmake/$(buildtype)/$2/core-tests -MBGL_ANDROID_BENCHMARK_DIR = MapboxGLAndroidSDK/.externalNativeBuild/cmake/$(buildtype)/$2/benchmark -MBGL_ANDROID_STL ?= c++_static +MLN_ANDROID_ABIS = arm-v7;armeabi-v7a +MLN_ANDROID_ABIS += arm-v8;arm64-v8a +MLN_ANDROID_ABIS += x86;x86 +MLN_ANDROID_ABIS += x86-64;x86_64 + +MLN_ANDROID_LOCAL_WORK_DIR = /data/local/tmp/core-tests +MLN_ANDROID_LOCAL_BENCHMARK_DIR = /data/local/tmp/benchmark +MLN_ANDROID_LIBDIR = lib$(if $(filter arm-v8 x86-64,$1),64) +MLN_ANDROID_DALVIKVM = dalvikvm$(if $(filter arm-v8 x86-64,$1),64,32) +MLN_ANDROID_APK_SUFFIX = $(if $(filter Release,$(BUILDTYPE)),release,debug) +MLN_ANDROID_CORE_TEST_DIR = MapboxGLAndroidSDK/.externalNativeBuild/cmake/$(buildtype)/$2/core-tests +MLN_ANDROID_BENCHMARK_DIR = MapboxGLAndroidSDK/.externalNativeBuild/cmake/$(buildtype)/$2/benchmark +MLN_ANDROID_STL ?= c++_static SOCKET_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) -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 = ./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) +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 .PHONY: android-style-code @@ -61,51 +61,51 @@ define ANDROID_RULES .PHONY: 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 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 .PHONY: 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 .PHONY: 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 .PHONY: android-core-test-$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) - mkdir -p $(MBGL_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) + mkdir -p $(MLN_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 # 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 - adb push $(MBGL_ANDROID_CORE_TEST_DIR)/classes.dex $(MBGL_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 test/fixtures $(MBGL_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 MapboxGLAndroidSDK/build/intermediates/cmake/$(buildtype)/obj/$2/mbgl-test $(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 $(MLN_ANDROID_LOCAL_WORK_DIR) > /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 $(MLN_ANDROID_LOCAL_WORK_DIR)/scripts/style-spec-reference > /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. $(eval SKIPPED_TESTS := -$(shell sed -n '/#\|^$$/!p' tests/skipped.txt | sed ':a;$!N;s/\n/:/g;ta')) # 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 - adb shell "cd $(MBGL_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 - rm -rf $(MBGL_ANDROID_CORE_TEST_DIR)/results && mkdir -p $(MBGL_ANDROID_CORE_TEST_DIR)/results - tar -xzf $(MBGL_ANDROID_CORE_TEST_DIR)/results.tgz --strip-components=2 -C $(MBGL_ANDROID_CORE_TEST_DIR)/results + adb shell "cd $(MLN_ANDROID_LOCAL_WORK_DIR) && tar -cvzf results.tgz test/fixtures/* > /dev/null 2>&1" + adb pull $(MLN_ANDROID_LOCAL_WORK_DIR)/results.tgz $(MLN_ANDROID_CORE_TEST_DIR)/ > /dev/null 2>&1 + rm -rf $(MLN_ANDROID_CORE_TEST_DIR)/results && mkdir -p $(MLN_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 .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-%: android-benchmark-$1 - mkdir -p $(MBGL_ANDROID_BENCHMARK_DIR) - unzip -o MapboxGLAndroidSDKTestApp/build/outputs/apk/$(buildtype)/MapboxGLAndroidSDKTestApp-$(MBGL_ANDROID_APK_SUFFIX).apk classes.dex -d $(MBGL_ANDROID_BENCHMARK_DIR) + mkdir -p $(MLN_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 - 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 - adb push $(MBGL_ANDROID_BENCHMARK_DIR)/classes.dex $(MBGL_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 benchmark/fixtures $(MBGL_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 MapboxGLAndroidSDK/build/intermediates/cmake/$(buildtype)/obj/$2/mbgl-benchmark $(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 $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1 + adb push benchmark/fixtures $(MLN_ANDROID_LOCAL_BENCHMARK_DIR)/benchmark > /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 $(MLN_ANDROID_LOCAL_BENCHMARK_DIR) > /dev/null 2>&1 # 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 - rm -rf $(MBGL_ANDROID_BENCHMARK_DIR)/results && mkdir -p $(MBGL_ANDROID_BENCHMARK_DIR)/results - adb pull $(MBGL_ANDROID_LOCAL_BENCHMARK_DIR)/results.json $(MBGL_ANDROID_BENCHMARK_DIR)/results > /dev/null 2>&1 + rm -rf $(MLN_ANDROID_BENCHMARK_DIR)/results && mkdir -p $(MLN_ANDROID_BENCHMARK_DIR)/results + 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 .PHONY: run-android-$1 run-android-$1: -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 .PHONY: 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 .PHONY: run-android-ui-test-$1 run-android-ui-test-$1: -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-android-ui-test-$1-%: -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 .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 platform/node/test/ignores.json MapboxGLAndroidSDKTestApp/src/main/assets/integration/ignores.json # 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 adb pull "`adb shell 'printenv EXTERNAL_STORAGE' | tr -d '\r'`/mapbox/render" build/render-test # copy expected result and run pixelmatch @@ -189,7 +189,7 @@ define ANDROID_RULES_INVOKER $(call ANDROID_RULES,$(word 1,$1),$(word 2,$1)) 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 .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 .PHONY: 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-%: - $(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 .PHONY: apackage apackage: 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 .PHONY: 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" .PHONY: run-android-test-app-center @@ -234,7 +234,7 @@ run-android-test-app-center: # Uploads the compiled Android SDK to Maven Central Staging .PHONY: 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 .PHONY: android-gfxinfo @@ -248,32 +248,32 @@ android-check : android-ktlint android-checkstyle android-lint-sdk android-lint- # Runs checkstyle on the java code .PHONY: 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 .PHONY: 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 .PHONY: 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 .PHONY: 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 .PHONY: 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 .PHONY: 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 # 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 .PHONY: android-update-vendor android-update-vendor: - $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none updateVendorSubmodules + $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none updateVendorSubmodules # Run android nitpick script .PHONY: run-android-nitpick 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 .PHONY: android-graph android-graph: - $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:generateDependencyGraphMapboxLibraries + $(MLN_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:generateDependencyGraphMapboxLibraries # Lists tasks .PHONY: list-tasks list-tasks: - $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=all tasks + $(MLN_ANDROID_GRADLE) -Pmapbox.abis=all tasks #### Miscellaneous targets ##################################################### diff --git a/platform/glfw/CMakeLists.txt b/platform/glfw/CMakeLists.txt index 721c727cf55..bbfb88afeb6 100644 --- a/platform/glfw/CMakeLists.txt +++ b/platform/glfw/CMakeLists.txt @@ -1,8 +1,8 @@ find_package(OpenGL REQUIRED) if(WIN32) - if(MBGL_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.") + if(MLN_WITH_OSMESA) + 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() endif() @@ -29,7 +29,7 @@ set_property( PROPERTY COMPILE_DEFINITIONS MAPBOX_PUCK_ASSETS_PATH=\"${PROJECT_SOURCE_DIR}/platform/glfw/assets/\" ) -if(MBGL_WITH_OPENGL) +if(MLN_WITH_OPENGL) target_sources( mbgl-glfw PRIVATE ${PROJECT_SOURCE_DIR}/platform/glfw/glfw_gl_backend.cpp @@ -40,7 +40,7 @@ if(MBGL_WITH_OPENGL) ) endif() -if(MBGL_WITH_EGL) +if(MLN_WITH_EGL) target_compile_definitions( mbgl-glfw PRIVATE MBGL_WITH_EGL=1 @@ -94,7 +94,7 @@ target_link_libraries( Mapbox::Base::cheap-ruler-cpp ) -if(NOT WIN32 AND MBGL_WITH_OPENGL) +if(NOT WIN32 AND MLN_WITH_OPENGL) target_link_libraries( mbgl-glfw PRIVATE OpenGL::GL diff --git a/platform/ios/ios-test-runners.cmake b/platform/ios/ios-test-runners.cmake index 6e94d25d6a5..94d2ad7bd3b 100644 --- a/platform/ios/ios-test-runners.cmake +++ b/platform/ios/ios-test-runners.cmake @@ -1,8 +1,8 @@ -if(MBGL_IOS_RENDER_TEST) +if(MLN_IOS_RENDER_TEST) include(${PROJECT_SOURCE_DIR}/vendor/zip-archive.cmake) 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") set(PREPARE_CMD "${PROJECT_SOURCE_DIR}/render-test/ios/setup_test_data.sh") endif() @@ -87,7 +87,7 @@ if(MBGL_IOS_RENDER_TEST) set_target_properties(RenderTestAppTests PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") 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 @@ -159,7 +159,7 @@ if(MBGL_IOS_UNIT_TEST) set_target_properties(UnitTestsAppTests PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") 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 diff --git a/platform/ios/ios.cmake b/platform/ios/ios.cmake index ecc97577894..2d6bcaa0c07 100644 --- a/platform/ios/ios.cmake +++ b/platform/ios/ios.cmake @@ -1,5 +1,5 @@ -option(MBGL_WITH_IOS_CCACHE "Enable ccache for iOS" OFF) -option(MBGL_IOS_RENDER_TEST "Include render tests" ON) +option(MLN_WITH_IOS_CCACHE "Enable ccache for iOS" OFF) +option(MLN_IOS_RENDER_TEST "Include render tests" ON) if(NOT DEFINED IOS_DEPLOYMENT_TARGET) set(IOS_DEPLOYMENT_TARGET "12.0") @@ -22,7 +22,7 @@ endmacro() set_target_properties(mbgl-core PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES) -if(MBGL_WITH_OPENGL) +if(MLN_WITH_OPENGL) target_compile_definitions( mbgl-core PUBLIC GLES_SILENCE_DEPRECATION GLES_SILENCE_DEPRECATION @@ -91,10 +91,10 @@ target_include_directories( ) 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) endif() -if(MBGL_WITH_OPENGL) +if(MLN_WITH_OPENGL) include(${PROJECT_SOURCE_DIR}/platform/ios/ios-test-runners.cmake) endif() diff --git a/platform/ios/scripts/standalone.cmake b/platform/ios/scripts/standalone.cmake index b8bcbfa03f3..fb0ae5e5959 100644 --- a/platform/ios/scripts/standalone.cmake +++ b/platform/ios/scripts/standalone.cmake @@ -1,9 +1,9 @@ include(cmake/mason.cmake) # include once for every platform to get all dependency defines -set(MBGL_PLATFORM "android") +set(MLN_PLATFORM "android") include(cmake/mason-dependencies.cmake) -set(MBGL_PLATFORM "ios") +set(MLN_PLATFORM "ios") include(cmake/mason-dependencies.cmake) get_cmake_property(_VARS VARIABLES) diff --git a/platform/linux/linux.cmake b/platform/linux/linux.cmake index 307948ac67c..800509a9eb9 100644 --- a/platform/linux/linux.cmake +++ b/platform/linux/linux.cmake @@ -1,5 +1,5 @@ -option(MBGL_WITH_X11 "Build with X11 Support" ON) -option(MBGL_WITH_WAYLAND "Build with Wayland Support" OFF) +option(MLN_WITH_X11 "Build with X11 Support" ON) +option(MLN_WITH_WAYLAND "Build with Wayland Support" OFF) find_package(CURL REQUIRED) find_package(ICU OPTIONAL_COMPONENTS i18n) @@ -7,7 +7,7 @@ find_package(ICU OPTIONAL_COMPONENTS uc) find_package(JPEG REQUIRED) find_package(PNG REQUIRED) find_package(PkgConfig REQUIRED) -if (MBGL_WITH_X11) +if (MLN_WITH_X11) find_package(X11 REQUIRED) endif () find_package(Threads REQUIRED) @@ -57,7 +57,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/platform/linux/src/gl_functions.cpp ) -if(MBGL_WITH_EGL) +if(MLN_WITH_EGL) find_package(OpenGL REQUIRED EGL) target_sources( mbgl-core @@ -69,7 +69,7 @@ if(MBGL_WITH_EGL) PRIVATE OpenGL::EGL ) - if (MBGL_WITH_WAYLAND) + if (MLN_WITH_WAYLAND) target_compile_definitions(mbgl-core PUBLIC EGL_NO_X11 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) 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) set_source_files_properties( @@ -126,9 +126,9 @@ target_link_libraries( ${LIBUV_LIBRARIES} ${X11_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} - $<$>:ICU::i18n> - $<$>:ICU::uc> - $<$:mbgl-vendor-icu> + $<$>:ICU::i18n> + $<$>:ICU::uc> + $<$:mbgl-vendor-icu> PNG::PNG mbgl-vendor-nunicode mbgl-vendor-sqlite diff --git a/platform/macos/macos.cmake b/platform/macos/macos.cmake index 105c60f7f24..a141bcddd3a 100644 --- a/platform/macos/macos.cmake +++ b/platform/macos/macos.cmake @@ -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) -if(MBGL_WITH_OPENGL) +if(MLN_WITH_OPENGL) find_package(OpenGL REQUIRED) target_compile_definitions( diff --git a/platform/node/CMakeLists.txt b/platform/node/CMakeLists.txt index ce58a72e3e4..68767b15b5a 100644 --- a/platform/node/CMakeLists.txt +++ b/platform/node/CMakeLists.txt @@ -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 # 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-test COMMAND npm run test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) endif() diff --git a/platform/node/DEVELOPING.md b/platform/node/DEVELOPING.md index b8919797b2d..fdbeb4c6734 100644 --- a/platform/node/DEVELOPING.md +++ b/platform/node/DEVELOPING.md @@ -48,7 +48,7 @@ To compile the Node.js bindings and install module dependencies, from the reposi #### MacOS ```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 diff --git a/platform/node/cmake/module.cmake b/platform/node/cmake/module.cmake index 2dca7d29456..23d609ab892 100644 --- a/platform/node/cmake/module.cmake +++ b/platform/node/cmake/module.cmake @@ -211,7 +211,7 @@ function(add_node_module NAME) ) if(WIN32) - if(MBGL_WITH_OSMESA) + if(MLN_WITH_OSMESA) get_filename_component(_OUTPUT_PATH "${_OUTPUT_PATH}" DIRECTORY "${CMAKE_CURRENT_SOURCE_PATH}") add_custom_command( diff --git a/platform/qt/QMapLibreGLConfig.cmake.in b/platform/qt/QMapLibreGLConfig.cmake.in index dc44d5c4a1b..d3ae5c80b9c 100644 --- a/platform/qt/QMapLibreGLConfig.cmake.in +++ b/platform/qt/QMapLibreGLConfig.cmake.in @@ -6,7 +6,7 @@ find_dependency(Qt@QT_VERSION_MAJOR@ find_dependency(Qt@QT_VERSION_MAJOR@ 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@ COMPONENTS Sql @REQUIRED_QT_VERSION@) endif() diff --git a/platform/qt/README.md b/platform/qt/README.md index 8817dc1253d..145d0ada5dd 100644 --- a/platform/qt/README.md +++ b/platform/qt/README.md @@ -33,7 +33,7 @@ cmake ../maplibre-gl-native/ \ -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX= \ - -DMBGL_WITH_QT=ON + -DMLN_WITH_QT=ON ninja ninja install ``` diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake index 35c6395e033..c00211562c8 100644 --- a/platform/qt/qt.cmake +++ b/platform/qt/qt.cmake @@ -1,16 +1,16 @@ message(STATUS "Configuring GL-Native with Qt bindings") -file(READ "${PROJECT_SOURCE_DIR}/platform/qt/VERSION" MBGL_QT_VERSION) -string(REGEX REPLACE "\n" "" MBGL_QT_VERSION "${MBGL_QT_VERSION}") # get rid of the newline at the end -set(MBGL_QT_VERSION_COMPATIBILITY 2.0.0) -message(STATUS "Version ${MBGL_QT_VERSION}") - -option(MBGL_QT_LIBRARY_ONLY "Build only libraries" OFF) -option(MBGL_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(MBGL_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(MBGL_QT_DEPLOYMENT "Autogenerate files necessary for deployment" OFF) +file(READ "${PROJECT_SOURCE_DIR}/platform/qt/VERSION" MLN_QT_VERSION) +string(REGEX REPLACE "\n" "" MLN_QT_VERSION "${MLN_QT_VERSION}") # get rid of the newline at the end +set(MLN_QT_VERSION_COMPATIBILITY 2.0.0) +message(STATUS "Version ${MLN_QT_VERSION}") + +option(MLN_QT_LIBRARY_ONLY "Build only libraries" OFF) +option(MLN_QT_STATIC "Build MapLibre GL Qt bindings staticly" OFF) +option(MLN_QT_INSIDE_PLUGIN "Build QMapLibreGL as OBJECT library, so it can be bundled into separate single plugin lib." OFF) +option(MLN_QT_WITH_HEADLESS "Build MapLibre GL Qt with headless support" ON) +option(MLN_QT_WITH_INTERNAL_SQLITE "Build MapLibre GL Qt bindings with internal sqlite" OFF) +option(MLN_QT_DEPLOYMENT "Autogenerate files necessary for deployment" OFF) find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) find_package(Qt${QT_VERSION_MAJOR} @@ -18,14 +18,14 @@ find_package(Qt${QT_VERSION_MAJOR} Network REQUIRED) -if(NOT MBGL_QT_LIBRARY_ONLY) +if(NOT MLN_QT_LIBRARY_ONLY) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) if (Qt6_FOUND) find_package(Qt${QT_VERSION_MAJOR}OpenGLWidgets REQUIRED) endif() endif() -if(NOT MBGL_QT_WITH_INTERNAL_SQLITE) +if(NOT MLN_QT_WITH_INTERNAL_SQLITE) find_package(Qt${QT_VERSION_MAJOR}Sql REQUIRED) else() message(STATUS "Using internal sqlite") @@ -33,8 +33,8 @@ else() endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - option(MBGL_QT_WITH_INTERNAL_ICU "Build MapLibre GL Qt bindings with internal ICU" OFF) - if(NOT MBGL_QT_WITH_INTERNAL_ICU) + option(MLN_QT_WITH_INTERNAL_ICU "Build MapLibre GL Qt bindings with internal ICU" OFF) + if(NOT MLN_QT_WITH_INTERNAL_ICU) find_package(ICU COMPONENTS uc REQUIRED) else() 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_download.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/online_file_source.cpp - ${PROJECT_SOURCE_DIR}/platform/$,default/src/mbgl/storage/sqlite3.cpp,qt/src/mbgl/sqlite3.cpp> + ${PROJECT_SOURCE_DIR}/platform/$,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/monotonic_timer.cpp - $<$:${PROJECT_SOURCE_DIR}/platform/qt/src/mbgl/headless_backend_qt.cpp> + $<$:${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_impl.hpp ${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}::Gui Qt${QT_VERSION_MAJOR}::Network - $,mbgl-vendor-sqlite,Qt${QT_VERSION_MAJOR}::Sql> - $<$:$,mbgl-vendor-icu,ICU::uc>> + $,mbgl-vendor-sqlite,Qt${QT_VERSION_MAJOR}::Sql> + $<$:$,mbgl-vendor-icu,ICU::uc>> mbgl-vendor-nunicode ) @@ -156,9 +156,9 @@ set(qmaplibregl_headers ${PROJECT_SOURCE_DIR}/platform/qt/include/QMapLibreGL/Utils ) -if (MBGL_QT_INSIDE_PLUGIN) +if (MLN_QT_INSIDE_PLUGIN) add_library(qmaplibregl OBJECT) -elseif(MBGL_QT_STATIC) +elseif(MLN_QT_STATIC) add_library(qmaplibregl STATIC) else() add_library(qmaplibregl SHARED) @@ -193,21 +193,21 @@ set_target_properties( AUTOMOC ON EXPORT_NAME QMapLibreGL OUTPUT_NAME QMapLibreGL - VERSION ${MBGL_QT_VERSION} - SOVERSION ${MBGL_QT_VERSION_COMPATIBILITY} + VERSION ${MLN_QT_VERSION} + SOVERSION ${MLN_QT_VERSION_COMPATIBILITY} PUBLIC_HEADER "${qmaplibregl_headers}" ) if (Qt6_FOUND AND COMMAND qt_enable_autogen_tool) qt_enable_autogen_tool(qmaplibregl "moc" ON) 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( qmaplibregl PROPERTIES FRAMEWORK ON FRAMEWORK_VERSION A MACOSX_FRAMEWORK_IDENTIFIER org.maplibre.QMapLibreGL - MACOSX_FRAMEWORK_BUNDLE_VERSION ${MBGL_QT_VERSION} - MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${MBGL_QT_VERSION} + MACOSX_FRAMEWORK_BUNDLE_VERSION ${MLN_QT_VERSION} + MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${MLN_QT_VERSION} ) target_include_directories( qmaplibregl @@ -227,7 +227,7 @@ configure_package_config_file( CMAKE_INSTALL_LIBDIR NO_CHECK_REQUIRED_COMPONENTS_MACRO) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/QMapLibreGLConfigVersion.cmake - VERSION ${MBGL_QT_VERSION} + VERSION ${MLN_QT_VERSION} COMPATIBILITY AnyNewerVersion) install(EXPORT QMapLibreGLTargets @@ -248,7 +248,7 @@ install( COMPONENT development ) -if(MBGL_QT_DEPLOYMENT) +if(MLN_QT_DEPLOYMENT) install(FILES ${PROJECT_SOURCE_DIR}/LICENSE.md DESTINATION .) endif() @@ -281,18 +281,18 @@ target_link_libraries( $ ) # 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( qmaplibregl PUBLIC - $<$>:Qt${QT_VERSION_MAJOR}::Sql> + $<$>:Qt${QT_VERSION_MAJOR}::Sql> $<$,$>>:z> ) 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. - # 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. target_compile_definitions( qmaplibregl @@ -312,7 +312,7 @@ install(TARGETS qmaplibregl PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/QMapLibreGL" ) -if(NOT MBGL_QT_LIBRARY_ONLY) +if(NOT MLN_QT_LIBRARY_ONLY) add_executable( mbgl-qt ${PROJECT_SOURCE_DIR}/platform/qt/app/main.cpp @@ -396,21 +396,21 @@ if(NOT MBGL_QT_LIBRARY_ONLY) 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_command( TARGET mbgl-qt-docs PRE_BUILD COMMAND - ${MBGL_QDOC} + ${MLN_QDOC} ${PROJECT_SOURCE_DIR}/platform/qt/config.qdocconf -outputdir ${CMAKE_BINARY_DIR}/docs ) 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}) endif() diff --git a/platform/qt/scripts/configure_Qt5_Android_static.sh b/platform/qt/scripts/configure_Qt5_Android_static.sh index f0692a0c52b..a9377addde6 100755 --- a/platform/qt/scripts/configure_Qt5_Android_static.sh +++ b/platform/qt/scripts/configure_Qt5_Android_static.sh @@ -25,9 +25,9 @@ cmake "$1" \ -DANDROID_ABI="$4" \ -DANDROID_NATIVE_API_LEVEL=21 \ -G Ninja \ --DMBGL_WITH_QT=ON \ --DMBGL_QT_STATIC=ON \ --DMBGL_QT_LIBRARY_ONLY=ON \ +-DMLN_WITH_QT=ON \ +-DMLN_QT_STATIC=ON \ +-DMLN_QT_LIBRARY_ONLY=ON \ -DCMAKE_CXX_FLAGS_RELEASE=-g0 \ -DCMAKE_INSTALL_PREFIX="$2" \ -DCMAKE_FIND_ROOT_PATH="$3/android" \ diff --git a/platform/qt/scripts/configure_Qt5_Linux.sh b/platform/qt/scripts/configure_Qt5_Linux.sh index 43d54a8eb85..a86a9560836 100755 --- a/platform/qt/scripts/configure_Qt5_Linux.sh +++ b/platform/qt/scripts/configure_Qt5_Linux.sh @@ -13,5 +13,5 @@ fi cmake "$1" \ -G Ninja \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DMBGL_WITH_QT=ON \ + -DMLN_WITH_QT=ON \ -DCMAKE_INSTALL_PREFIX="$2" diff --git a/platform/qt/scripts/configure_Qt5_Windows.ps1 b/platform/qt/scripts/configure_Qt5_Windows.ps1 index 62cf0b6ccc9..850a136b2bd 100644 --- a/platform/qt/scripts/configure_Qt5_Windows.ps1 +++ b/platform/qt/scripts/configure_Qt5_Windows.ps1 @@ -5,4 +5,4 @@ cmake -S "$path" ` -GNinja ` -DCMAKE_BUILD_TYPE="Release" ` -DCMAKE_INSTALL_PREFIX="$install" ` - -DMBGL_WITH_QT=ON + -DMLN_WITH_QT=ON diff --git a/platform/qt/scripts/configure_Qt5_Windows_static.ps1 b/platform/qt/scripts/configure_Qt5_Windows_static.ps1 index 060ca364450..75eae572053 100644 --- a/platform/qt/scripts/configure_Qt5_Windows_static.ps1 +++ b/platform/qt/scripts/configure_Qt5_Windows_static.ps1 @@ -5,6 +5,6 @@ cmake -S "$path" ` -GNinja ` -DCMAKE_BUILD_TYPE="Release" ` -DCMAKE_INSTALL_PREFIX="$install" ` - -DMBGL_WITH_QT=ON ` - -DMBGL_QT_STATIC=ON ` - -DMBGL_QT_LIBRARY_ONLY=ON + -DMLN_WITH_QT=ON ` + -DMLN_QT_STATIC=ON ` + -DMLN_QT_LIBRARY_ONLY=ON diff --git a/platform/qt/scripts/configure_Qt5_iOS_static.sh b/platform/qt/scripts/configure_Qt5_iOS_static.sh index 14b5f8b1eaa..3d113aea6d2 100755 --- a/platform/qt/scripts/configure_Qt5_iOS_static.sh +++ b/platform/qt/scripts/configure_Qt5_iOS_static.sh @@ -21,9 +21,9 @@ cmake "$1" \ -DCMAKE_CONFIGURATION_TYPES="Release;Debug" \ -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="12.0" \ - -DMBGL_WITH_QT=ON \ - -DMBGL_QT_STATIC=ON \ - -DMBGL_QT_LIBRARY_ONLY=ON \ + -DMLN_WITH_QT=ON \ + -DMLN_QT_STATIC=ON \ + -DMLN_QT_LIBRARY_ONLY=ON \ -DCMAKE_INSTALL_PREFIX="$2" \ -DCMAKE_FIND_ROOT_PATH="$3/ios" \ -DCMAKE_PREFIX_PATH="$3/ios" diff --git a/platform/qt/scripts/configure_Qt5_macOS.sh b/platform/qt/scripts/configure_Qt5_macOS.sh index abcdd805514..f079ed20200 100755 --- a/platform/qt/scripts/configure_Qt5_macOS.sh +++ b/platform/qt/scripts/configure_Qt5_macOS.sh @@ -14,5 +14,5 @@ cmake "$1" \ -G Ninja \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" \ - -DMBGL_WITH_QT=ON \ + -DMLN_WITH_QT=ON \ -DCMAKE_INSTALL_PREFIX="$2" diff --git a/platform/qt/scripts/configure_Qt5_macOS_static.sh b/platform/qt/scripts/configure_Qt5_macOS_static.sh index fd030309db1..bd014a8e35a 100755 --- a/platform/qt/scripts/configure_Qt5_macOS_static.sh +++ b/platform/qt/scripts/configure_Qt5_macOS_static.sh @@ -14,7 +14,7 @@ cmake "$1" \ -G Ninja \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" \ - -DMBGL_WITH_QT=ON \ - -DMBGL_QT_STATIC=ON \ - -DMBGL_QT_LIBRARY_ONLY=ON \ + -DMLN_WITH_QT=ON \ + -DMLN_QT_STATIC=ON \ + -DMLN_QT_LIBRARY_ONLY=ON \ -DCMAKE_INSTALL_PREFIX="$2" diff --git a/platform/qt/scripts/configure_Qt6_Windows.ps1 b/platform/qt/scripts/configure_Qt6_Windows.ps1 index d9653eba5e5..2190b1b7416 100644 --- a/platform/qt/scripts/configure_Qt6_Windows.ps1 +++ b/platform/qt/scripts/configure_Qt6_Windows.ps1 @@ -5,4 +5,4 @@ qt-cmake -S "$path" ` -GNinja ` -DCMAKE_BUILD_TYPE="Release" ` -DCMAKE_INSTALL_PREFIX="$install" ` - -DMBGL_WITH_QT=ON + -DMLN_WITH_QT=ON diff --git a/platform/qt/scripts/configure_Qt6_macOS.sh b/platform/qt/scripts/configure_Qt6_macOS.sh index 8b5feb04a75..b535ba127d7 100755 --- a/platform/qt/scripts/configure_Qt6_macOS.sh +++ b/platform/qt/scripts/configure_Qt6_macOS.sh @@ -15,5 +15,5 @@ qt-cmake "$1" \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" \ -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ - -DMBGL_WITH_QT=ON \ + -DMLN_WITH_QT=ON \ -DCMAKE_INSTALL_PREFIX="$2" diff --git a/platform/qt/scripts/configure_Qt6_macOS_static.sh b/platform/qt/scripts/configure_Qt6_macOS_static.sh index 714204fc21c..08a440eb896 100755 --- a/platform/qt/scripts/configure_Qt6_macOS_static.sh +++ b/platform/qt/scripts/configure_Qt6_macOS_static.sh @@ -15,7 +15,7 @@ qt-cmake "$1" \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" \ -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ - -DMBGL_WITH_QT=ON \ - -DMBGL_QT_STATIC=ON \ - -DMBGL_QT_LIBRARY_ONLY=ON \ + -DMLN_WITH_QT=ON \ + -DMLN_QT_STATIC=ON \ + -DMLN_QT_LIBRARY_ONLY=ON \ -DCMAKE_INSTALL_PREFIX="$2" diff --git a/platform/windows/README.md b/platform/windows/README.md index 48dec04e128..0415d37e834 100644 --- a/platform/windows/README.md +++ b/platform/windows/README.md @@ -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: ```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: ``` -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\` 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: ```cmd -cmake . -B build -DMBGL_WITH_EGL=ON +cmake . -B build -DMLN_WITH_EGL=ON ``` or ```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`). diff --git a/platform/windows/windows.cmake b/platform/windows/windows.cmake index 2db7de33c39..5357275d2f0 100644 --- a/platform/windows/windows.cmake +++ b/platform/windows/windows.cmake @@ -1,6 +1,6 @@ -if(MBGL_WITH_EGL) +if(MLN_WITH_EGL) set(_RENDERER EGL) -elseif(MBGL_WITH_OSMESA) +elseif(MLN_WITH_OSMESA) set(_RENDERER OSMesa) else() set(_RENDERER OpenGL) @@ -74,7 +74,7 @@ target_compile_definitions( CURL_STATICLIB ) -if(MBGL_WITH_EGL) +if(MLN_WITH_EGL) find_package(unofficial-angle CONFIG REQUIRED) target_sources( mbgl-core @@ -93,7 +93,7 @@ if(MBGL_WITH_EGL) unofficial::angle::libEGL unofficial::angle::libGLESv3 ) -elseif(MBGL_WITH_OSMESA) +elseif(MLN_WITH_OSMESA) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) 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) 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) set_source_files_properties( @@ -171,10 +171,10 @@ target_link_libraries( ${JPEG_LIBRARIES} ${LIBUV_LIBRARIES} dlfcn-win32::dl - $<$>:ICU::data> - $<$>:ICU::i18n> - $<$>:ICU::uc> - $<$:mbgl-vendor-icu> + $<$>:ICU::data> + $<$>:ICU::i18n> + $<$>:ICU::uc> + $<$:mbgl-vendor-icu> PNG::PNG mbgl-vendor-nunicode mbgl-vendor-sqlite diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6407cb5299a..47c866a9ddd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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 # 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 -if(NOT (MBGL_WITH_QT AND CMAKE_SYSTEM_NAME STREQUAL Darwin)) +if(NOT (MLN_WITH_QT AND CMAKE_SYSTEM_NAME STREQUAL Darwin)) target_sources( mbgl-test PRIVATE @@ -121,7 +121,7 @@ if(NOT (MBGL_WITH_QT AND CMAKE_SYSTEM_NAME STREQUAL Darwin)) ) endif() -if(MBGL_WITH_OPENGL) +if(MLN_WITH_OPENGL) target_sources( mbgl-test PRIVATE @@ -142,9 +142,9 @@ endif() 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.") - set(MBGL_TEST_HAS_TEST_SERVER 0) + set(MLN_TEST_HAS_TEST_SERVER 0) else() - set(MBGL_TEST_HAS_TEST_SERVER 1) + set(MLN_TEST_HAS_TEST_SERVER 1) target_sources( mbgl-test PRIVATE ${PROJECT_SOURCE_DIR}/test/src/mbgl/test/http_server.cpp @@ -164,14 +164,14 @@ else() endif() if(NOT DEFINED ENV{CI}) - set(MBGL_TEST_BUILD_ON_CI 0) + set(MLN_TEST_BUILD_ON_CI 0) else() - set(MBGL_TEST_BUILD_ON_CI 1) + set(MLN_TEST_BUILD_ON_CI 1) endif() target_compile_definitions( 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( @@ -210,12 +210,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin) endif() # 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( mbgl-test PRIVATE - ${MBGL_CORE_PRIVATE_LIBRARIES} + ${MLN_CORE_PRIVATE_LIBRARIES} Mapbox::Base::Extras::args Mapbox::Base::pixelmatch-cpp mbgl-compiler-options @@ -238,6 +238,6 @@ endif() 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}") -endif() \ No newline at end of file +endif() diff --git a/vendor/csscolorparser.cmake b/vendor/csscolorparser.cmake index c8ce21719d0..c2c954fc4b9 100644 --- a/vendor/csscolorparser.cmake +++ b/vendor/csscolorparser.cmake @@ -2,7 +2,7 @@ if(TARGET mbgl-vendor-csscolorparser) return() 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) else() add_library(mbgl-vendor-csscolorparser STATIC) diff --git a/vendor/nunicode.cmake b/vendor/nunicode.cmake index 8940d60dbb1..60f63c188a6 100644 --- a/vendor/nunicode.cmake +++ b/vendor/nunicode.cmake @@ -2,7 +2,7 @@ if(TARGET mbgl-vendor-nunicode) return() 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) else() add_library(mbgl-vendor-nunicode STATIC) diff --git a/vendor/parsedate.cmake b/vendor/parsedate.cmake index c57c1f86945..d5565a4150b 100644 --- a/vendor/parsedate.cmake +++ b/vendor/parsedate.cmake @@ -2,7 +2,7 @@ if(TARGET mbgl-vendor-parsedate) return() 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) else() add_library(mbgl-vendor-parsedate STATIC) diff --git a/vendor/sqlite.cmake b/vendor/sqlite.cmake index 9c7e6128589..716b767e5c4 100644 --- a/vendor/sqlite.cmake +++ b/vendor/sqlite.cmake @@ -8,9 +8,9 @@ add_library( ) 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( mbgl-vendor-sqlite PRIVATE HAVE_STRERROR_R