Create macOS amalgamation for core releases (#3768)
This commit is contained in:
4
.github/scripts/install-linux-deps
vendored
4
.github/scripts/install-linux-deps
vendored
@@ -11,5 +11,5 @@ DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \
|
|||||||
libopengl0 \
|
libopengl0 \
|
||||||
mesa-vulkan-drivers \
|
mesa-vulkan-drivers \
|
||||||
llvm \
|
llvm \
|
||||||
glslang-dev
|
glslang-dev \
|
||||||
cargo install armerge@2.2.0
|
libbz2-dev
|
||||||
|
|||||||
60
.github/workflows/core-release.yml
vendored
60
.github/workflows/core-release.yml
vendored
@@ -6,6 +6,9 @@ permissions:
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- .github/workflows/core-release.yml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release:
|
create-release:
|
||||||
@@ -25,7 +28,9 @@ jobs:
|
|||||||
vendor/maplibre-native-base/deps/geojson.hpp/include \
|
vendor/maplibre-native-base/deps/geojson.hpp/include \
|
||||||
vendor/metal-cpp \
|
vendor/metal-cpp \
|
||||||
vendor/maplibre-native-base/extras/expected-lite/include
|
vendor/maplibre-native-base/extras/expected-lite/include
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
run: |
|
run: |
|
||||||
gh release create core-${{ github.sha }} \
|
gh release create core-${{ github.sha }} \
|
||||||
--draft=false \
|
--draft=false \
|
||||||
@@ -44,16 +49,36 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- run: brew install webp libuv
|
||||||
|
|
||||||
|
- uses: taiki-e/install-action@020705266844b275b711684191e11281be48860c # v2
|
||||||
|
with:
|
||||||
|
tool: armerge@2
|
||||||
|
|
||||||
- name: Build mbgl-core for macOS
|
- name: Build mbgl-core for macOS
|
||||||
run: |
|
run: |
|
||||||
cmake --preset macos-core -DCMAKE_CXX_COMPILER_LAUNCHER=""
|
cmake --preset macos -DCMAKE_CXX_COMPILER_LAUNCHER="" -DMLN_WITH_GLFW=OFF
|
||||||
cmake --build --preset macos-core
|
cmake --build build-macos --target mbgl-core
|
||||||
|
|
||||||
- name: Rename artifact
|
- name: Rename artifact
|
||||||
run: cp build-macos/libmbgl-core.a libmaplibre-native-core-macos-arm64-metal.a
|
run: |
|
||||||
|
cp build-macos/libmbgl-core.a libmaplibre-native-core-macos-arm64-metal.a
|
||||||
|
cp build-macos/libmbgl-core-amalgam.a libmaplibre-native-core-amalgam-macos-arm64-metal.a
|
||||||
|
|
||||||
- name: Upload macOS artifact
|
- name: Upload macOS artifacts
|
||||||
run: gh release upload core-${{ github.sha }} libmaplibre-native-core-macos-arm64-metal.a
|
if: github.event_name == 'pull_request'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: macos-metal-build
|
||||||
|
path: |
|
||||||
|
libmaplibre-native-core-macos-arm64-metal.a
|
||||||
|
libmaplibre-native-core-amalgam-macos-arm64-metal.a
|
||||||
|
|
||||||
|
- name: Upload macOS artifacts (release)
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
|
run: |
|
||||||
|
gh release upload core-${{ github.sha }} libmaplibre-native-core-macos-arm64-metal.a
|
||||||
|
gh release upload core-${{ github.sha }} libmaplibre-native-core-amalgam-macos-arm64-metal.a
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
@@ -79,6 +104,10 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: .github/scripts/install-linux-deps
|
run: .github/scripts/install-linux-deps
|
||||||
|
|
||||||
|
- uses: taiki-e/install-action@020705266844b275b711684191e11281be48860c # v2
|
||||||
|
with:
|
||||||
|
tool: armerge@2
|
||||||
|
|
||||||
- name: Build mbgl-core for Linux
|
- name: Build mbgl-core for Linux
|
||||||
run: |
|
run: |
|
||||||
cmake --preset linux-${{ matrix.renderer }} -DCMAKE_CXX_COMPILER_LAUNCHER=""
|
cmake --preset linux-${{ matrix.renderer }} -DCMAKE_CXX_COMPILER_LAUNCHER=""
|
||||||
@@ -89,7 +118,17 @@ jobs:
|
|||||||
cp build-linux-${{ matrix.renderer }}/libmbgl-core.a libmaplibre-native-core-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
cp build-linux-${{ matrix.renderer }}/libmbgl-core.a libmaplibre-native-core-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
||||||
cp build-linux-${{ matrix.renderer }}/libmbgl-core-amalgam.a libmaplibre-native-core-amalgam-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
cp build-linux-${{ matrix.renderer }}/libmbgl-core-amalgam.a libmaplibre-native-core-amalgam-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
||||||
|
|
||||||
- name: Upload Linux artifact
|
- name: Upload Linux artifacts
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}-build
|
||||||
|
path: |
|
||||||
|
libmaplibre-native-core-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
||||||
|
libmaplibre-native-core-amalgam-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
||||||
|
|
||||||
|
- name: Upload Linux artifacts (release)
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
run: |
|
run: |
|
||||||
gh release upload core-${{ github.sha }} libmaplibre-native-core-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
gh release upload core-${{ github.sha }} libmaplibre-native-core-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
||||||
gh release upload core-${{ github.sha }} libmaplibre-native-core-amalgam-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
gh release upload core-${{ github.sha }} libmaplibre-native-core-amalgam-linux-${{ matrix.runner.arch }}-${{ matrix.renderer }}.a
|
||||||
@@ -121,6 +160,15 @@ jobs:
|
|||||||
run: Copy-Item build-windows-${{ matrix.renderer }}/mbgl-core.lib maplibre-native-core-windows-x64-${{ matrix.renderer }}.lib
|
run: Copy-Item build-windows-${{ matrix.renderer }}/mbgl-core.lib maplibre-native-core-windows-x64-${{ matrix.renderer }}.lib
|
||||||
|
|
||||||
- name: Upload Windows artifact
|
- name: Upload Windows artifact
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: windows-${{ matrix.renderer }}-build
|
||||||
|
path: |
|
||||||
|
maplibre-native-core-windows-x64-${{ matrix.renderer }}.lib
|
||||||
|
|
||||||
|
- name: Upload Windows artifact (release)
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
run: gh release upload core-${{ github.sha }} maplibre-native-core-windows-x64-${{ matrix.renderer }}.lib
|
run: gh release upload core-${{ github.sha }} maplibre-native-core-windows-x64-${{ matrix.renderer }}.lib
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|||||||
9
.github/workflows/linux-ci.yml
vendored
9
.github/workflows/linux-ci.yml
vendored
@@ -78,6 +78,15 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: .github/scripts/install-linux-deps
|
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
|
||||||
|
|
||||||
- if: matrix.variant.rust
|
- if: matrix.variant.rust
|
||||||
run: cargo install cxxbridge-cmd --version 1.0.157 --locked
|
run: cargo install cxxbridge-cmd --version 1.0.157 --locked
|
||||||
|
|
||||||
|
|||||||
@@ -70,14 +70,6 @@
|
|||||||
"MLN_DARWIN_USE_LIBUV": "OFF"
|
"MLN_DARWIN_USE_LIBUV": "OFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "macos-core",
|
|
||||||
"inherits": "macos",
|
|
||||||
"cacheVariables": {
|
|
||||||
"MLN_CORE_INCLUDE_DEPS": "ON",
|
|
||||||
"MLN_WITH_GLFW": "OFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "linux",
|
"name": "linux",
|
||||||
"hidden": true,
|
"hidden": true,
|
||||||
@@ -185,7 +177,7 @@
|
|||||||
"buildPresets": [
|
"buildPresets": [
|
||||||
{
|
{
|
||||||
"name": "macos-core",
|
"name": "macos-core",
|
||||||
"configurePreset": "macos-core",
|
"configurePreset": "macos",
|
||||||
"targets": ["mbgl-core"]
|
"targets": ["mbgl-core"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ target_link_libraries(
|
|||||||
# Bundle system provided libraries
|
# Bundle system provided libraries
|
||||||
if(NOT MLN_USE_BUILTIN_ICU AND NOT "${ARMERGE}" STREQUAL "ARMERGE-NOTFOUND")
|
if(NOT MLN_USE_BUILTIN_ICU AND NOT "${ARMERGE}" STREQUAL "ARMERGE-NOTFOUND")
|
||||||
message(STATUS "Found armerge: ${ARMERGE}")
|
message(STATUS "Found armerge: ${ARMERGE}")
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/cmake/find_static_library.cmake)
|
include(${PROJECT_SOURCE_DIR}/cmake/find_static_library.cmake)
|
||||||
set(STATIC_LIBS "")
|
set(STATIC_LIBS "")
|
||||||
|
|
||||||
find_static_library(STATIC_LIBS NAMES png)
|
find_static_library(STATIC_LIBS NAMES png)
|
||||||
|
|||||||
@@ -142,3 +142,29 @@ add_test(
|
|||||||
${PROJECT_SOURCE_DIR}/test/storage/server.js
|
${PROJECT_SOURCE_DIR}/test/storage/server.js
|
||||||
$<TARGET_FILE:mbgl-test-runner>
|
$<TARGET_FILE:mbgl-test-runner>
|
||||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||||
|
|
||||||
|
find_program(ARMERGE NAMES armerge)
|
||||||
|
|
||||||
|
if(NOT "${ARMERGE}" STREQUAL "ARMERGE-NOTFOUND")
|
||||||
|
message(STATUS "Found armerge: ${ARMERGE}")
|
||||||
|
include(${PROJECT_SOURCE_DIR}/cmake/find_static_library.cmake)
|
||||||
|
set(STATIC_LIBS "")
|
||||||
|
|
||||||
|
find_static_library(STATIC_LIBS NAMES png)
|
||||||
|
find_static_library(STATIC_LIBS NAMES jpeg)
|
||||||
|
find_static_library(STATIC_LIBS NAMES webp)
|
||||||
|
find_static_library(STATIC_LIBS NAMES uv uv_a)
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
TARGET mbgl-core
|
||||||
|
POST_BUILD
|
||||||
|
COMMAND armerge --keep-symbols 'mbgl.*' --output libmbgl-core-amalgam.a
|
||||||
|
$<TARGET_FILE:mbgl-core>
|
||||||
|
$<TARGET_FILE:freetype>
|
||||||
|
$<TARGET_FILE:mbgl-vendor-csscolorparser>
|
||||||
|
$<TARGET_FILE:harfbuzz>
|
||||||
|
$<TARGET_FILE:mbgl-vendor-parsedate>
|
||||||
|
${STATIC_LIBS}
|
||||||
|
)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user