diff --git a/.github/workflows/core-release.yml b/.github/workflows/core-release.yml index 36436ffa0..b63a2ce31 100644 --- a/.github/workflows/core-release.yml +++ b/.github/workflows/core-release.yml @@ -57,7 +57,7 @@ jobs: - name: Build mbgl-core for macOS run: | - cmake --preset macos-metal -DCMAKE_CXX_COMPILER_LAUNCHER="" -DMLN_WITH_GLFW=OFF + cmake --preset macos-metal -DCMAKE_CXX_COMPILER_LAUNCHER="" -DMLN_WITH_GLFW=OFF -DMLN_CREATE_AMALGAMATION=ON cmake --build build-macos-metal --target mbgl-core - name: Rename artifact @@ -110,7 +110,7 @@ jobs: - name: Build mbgl-core for Linux run: | - cmake --preset linux-${{ matrix.renderer }} -DCMAKE_CXX_COMPILER_LAUNCHER="" + cmake --preset linux-${{ matrix.renderer }} -DCMAKE_CXX_COMPILER_LAUNCHER="" -DMLN_CREATE_AMALGAMATION=ON cmake --build build-linux-${{ matrix.renderer }} --target mbgl-core - name: Rename artifact @@ -153,7 +153,7 @@ jobs: - name: Build mbgl-core for Windows run: | - cmake --preset windows-${{ matrix.renderer }}-core -DCMAKE_CXX_COMPILER_LAUNCHER="" + cmake --preset windows-${{ matrix.renderer }} -DCMAKE_CXX_COMPILER_LAUNCHER="" cmake --build --preset windows-${{ matrix.renderer }}-core - name: Rename artifact diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index 2a51187bc..087b56e2a 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -79,14 +79,9 @@ jobs: - name: Install dependencies run: .github/scripts/install-linux-deps - - run: cargo install armerge@2.2.0 - # TODO: use below once - # https://github.com/tux3/armerge/issues/14 - # is fixed - - # - uses: taiki-e/install-action@020705266844b275b711684191e11281be48860c # v2 - # with: - # tool: armerge@2 + - uses: taiki-e/install-action@020705266844b275b711684191e11281be48860c # v2 + with: + tool: armerge@2 - if: matrix.variant.rust run: cargo install cxxbridge-cmd --version 1.0.157 --locked diff --git a/CMakeLists.txt b/CMakeLists.txt index 329c66e62..2959da094 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,8 +19,8 @@ option(MLN_USE_UNORDERED_DENSE "Use ankerl dense containers for performance" ON) option(MLN_USE_TRACY "Enable Tracy instrumentation" OFF) option(MLN_USE_RUST "Use components in Rust" OFF) option(MLN_TEXT_SHAPING_HARFBUZZ "Use haffbuzz to shape complex text" ON) -option(MLN_CORE_INCLUDE_DEPS "Include depdendencies in static build of core" OFF) option(MLN_CREATE_AUTORELEASEPOOL "Create autoreleasepool in render loop" OFF) +option(MLN_CREATE_AMALGAMATION "Create static amalgamation of core (requires amerge)" OFF) include(cmake/validate-backend-options.cmake) include(cmake/clang-tidy.cmake) diff --git a/CMakePresets.json b/CMakePresets.json index 7f98bcd1e..5210c1dee 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -219,14 +219,6 @@ "MLN_WITH_OPENGL": "ON" } }, - { - "name": "windows-opengl-core", - "inherits": "windows-opengl", - "cacheVariables": { - "MLN_CORE_INCLUDE_DEPS": "ON", - "MLN_USE_BUILTIN_ICU": "ON" - } - }, { "name": "windows-opengl-node", "inherits": "windows", @@ -249,14 +241,6 @@ "MLN_WITH_EGL": "ON" } }, - { - "name": "windows-egl-core", - "inherits": "windows-egl", - "cacheVariables": { - "MLN_CORE_INCLUDE_DEPS": "ON", - "MLN_USE_BUILTIN_ICU": "ON" - } - }, { "name": "windows-vulkan", "binaryDir": "${sourceDir}/build-windows-vulkan", @@ -267,14 +251,6 @@ "MLN_WITH_VULKAN": "ON" } }, - { - "name": "windows-vulkan-core", - "inherits": "windows-vulkan", - "cacheVariables": { - "MLN_CORE_INCLUDE_DEPS": "ON", - "MLN_USE_BUILTIN_ICU": "ON" - } - }, { "name": "windows-arm64", "hidden": true, diff --git a/cmake/clang-tidy.cmake b/cmake/clang-tidy.cmake index 6b4768921..9e6588988 100644 --- a/cmake/clang-tidy.cmake +++ b/cmake/clang-tidy.cmake @@ -1,6 +1,6 @@ if (MLN_WITH_CLANG_TIDY OR MLN_CLANG_TIDY_COMMAND) if(MLN_CLANG_TIDY_COMMAND) - set(CLANG_TIDY_COMMAND MLN_CLANG_TIDY_COMMAND) + set(CLANG_TIDY_COMMAND "${MLN_CLANG_TIDY_COMMAND}") message(STATUS "Using clang-tidy at ${CLANG_TIDY_COMMAND}") else() find_program(CLANG_TIDY_COMMAND NAMES clang-tidy) diff --git a/platform/linux/linux.cmake b/platform/linux/linux.cmake index e7a7800c1..fe28abf00 100644 --- a/platform/linux/linux.cmake +++ b/platform/linux/linux.cmake @@ -181,8 +181,10 @@ target_link_libraries( mbgl-vendor-sqlite ) -# Bundle system provided libraries -if(NOT MLN_USE_BUILTIN_ICU AND NOT "${ARMERGE}" STREQUAL "ARMERGE-NOTFOUND") +if(MLN_CREATE_AMALGAMATION) + if ("${ARMERGE}" STREQUAL "MLN_CREATE_AMALGAMATION") + message(FATAL_ERROR "armerge required when MLN_CREATE_AMALGAMATION=ON") + endif() message(STATUS "Found armerge: ${ARMERGE}") include(${PROJECT_SOURCE_DIR}/cmake/find_static_library.cmake) set(STATIC_LIBS "") diff --git a/platform/macos/macos.cmake b/platform/macos/macos.cmake index 816108d2f..2c7395183 100644 --- a/platform/macos/macos.cmake +++ b/platform/macos/macos.cmake @@ -145,7 +145,10 @@ add_test( find_program(ARMERGE NAMES armerge) -if(NOT "${ARMERGE}" STREQUAL "ARMERGE-NOTFOUND") +if(MLN_CREATE_AMALGAMATION) + if ("${ARMERGE}" STREQUAL "ARMERGE-NOTFOUND") + message(FATAL_ERROR "armerge required when MLN_CREATE_AMALGAMATION=ON") + endif() message(STATUS "Found armerge: ${ARMERGE}") include(${PROJECT_SOURCE_DIR}/cmake/find_static_library.cmake) set(STATIC_LIBS "") diff --git a/platform/windows/windows.cmake b/platform/windows/windows.cmake index b4a3aba62..0473e0114 100644 --- a/platform/windows/windows.cmake +++ b/platform/windows/windows.cmake @@ -252,7 +252,7 @@ target_link_libraries( $<$>:ICU::i18n> $<$>:ICU::uc> $<$>:ICU::data> - $<$:$,$,mbgl-vendor-icu>> + $<$:mbgl-vendor-icu> PNG::PNG mbgl-vendor-nunicode mbgl-vendor-sqlite diff --git a/vendor/csscolorparser.cmake b/vendor/csscolorparser.cmake index 22d26ccfb..e5f15cc38 100644 --- a/vendor/csscolorparser.cmake +++ b/vendor/csscolorparser.cmake @@ -2,7 +2,7 @@ if(TARGET mbgl-vendor-csscolorparser) return() endif() -if(MLN_WITH_QT OR MLN_CORE_INCLUDE_DEPS) +if(MLN_WITH_QT) add_library(mbgl-vendor-csscolorparser OBJECT) else() add_library(mbgl-vendor-csscolorparser STATIC) diff --git a/vendor/icu.cmake b/vendor/icu.cmake index 5f1169e31..e43dc5ad0 100644 --- a/vendor/icu.cmake +++ b/vendor/icu.cmake @@ -2,7 +2,7 @@ if(TARGET mbgl-vendor-icu) return() endif() -if(MLN_WITH_QT OR MLN_CORE_INCLUDE_DEPS) +if(MLN_WITH_QT) add_library(mbgl-vendor-icu OBJECT) else() add_library(mbgl-vendor-icu STATIC) diff --git a/vendor/nunicode.cmake b/vendor/nunicode.cmake index 0ecda14dd..640539bb1 100644 --- a/vendor/nunicode.cmake +++ b/vendor/nunicode.cmake @@ -2,7 +2,7 @@ if(TARGET mbgl-vendor-nunicode) return() endif() -if(MLN_WITH_QT OR MLN_CORE_INCLUDE_DEPS) +if(MLN_WITH_QT) add_library(mbgl-vendor-nunicode OBJECT) else() add_library(mbgl-vendor-nunicode STATIC) diff --git a/vendor/parsedate.cmake b/vendor/parsedate.cmake index d16d496ca..9cdedf20e 100644 --- a/vendor/parsedate.cmake +++ b/vendor/parsedate.cmake @@ -2,7 +2,7 @@ if(TARGET mbgl-vendor-parsedate) return() endif() -if(MLN_WITH_QT OR MLN_CORE_INCLUDE_DEPS) +if(MLN_WITH_QT) add_library(mbgl-vendor-parsedate OBJECT) else() add_library(mbgl-vendor-parsedate STATIC) diff --git a/vendor/sqlite.cmake b/vendor/sqlite.cmake index be3083c90..f0efcf2a4 100644 --- a/vendor/sqlite.cmake +++ b/vendor/sqlite.cmake @@ -2,7 +2,7 @@ if(TARGET mbgl-vendor-sqlite) return() endif() -if(MLN_WITH_QT OR MLN_CORE_INCLUDE_DEPS) +if(MLN_WITH_QT) add_library(mbgl-vendor-sqlite OBJECT) else() add_library(mbgl-vendor-sqlite STATIC)