Remove MLN_CORE_INCLUDE_DEPS add MLN_CREATE_AMALGAMATION (#4007)

This commit is contained in:
Bart Louwers
2025-12-11 23:37:39 +01:00
committed by GitHub
parent 797f2bb647
commit c18bbb35c6
13 changed files with 22 additions and 46 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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,

View File

@@ -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)

View File

@@ -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 "")

View File

@@ -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 "")

View File

@@ -252,7 +252,7 @@ target_link_libraries(
$<$<NOT:$<BOOL:${MLN_USE_BUILTIN_ICU}>>:ICU::i18n>
$<$<NOT:$<BOOL:${MLN_USE_BUILTIN_ICU}>>:ICU::uc>
$<$<NOT:$<BOOL:${MLN_USE_BUILTIN_ICU}>>:ICU::data>
$<$<BOOL:${MLN_USE_BUILTIN_ICU}>:$<IF:$<BOOL:${MLN_CORE_INCLUDE_DEPS}>,$<TARGET_OBJECTS:mbgl-vendor-icu>,mbgl-vendor-icu>>
$<$<BOOL:${MLN_USE_BUILTIN_ICU}>:mbgl-vendor-icu>
PNG::PNG
mbgl-vendor-nunicode
mbgl-vendor-sqlite

View File

@@ -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)

2
vendor/icu.cmake vendored
View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

2
vendor/sqlite.cmake vendored
View File

@@ -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)