Update CMakePresets.json and docs for macOS (#3909)

This commit is contained in:
Bart Louwers
2025-10-28 20:21:44 +01:00
committed by GitHub
parent 512e02410b
commit a13472a410
4 changed files with 29 additions and 9 deletions

1
.github/labeler.yml vendored
View File

@@ -40,6 +40,7 @@ build:
- '**/*.cmake'
- '**/BUILD.bazel'
- '**/*.bzl'
- CMakePresets.json
OpenGL:
- changed-files:
- any-glob-to-any-file:

View File

@@ -57,13 +57,13 @@ jobs:
- name: Build mbgl-core for macOS
run: |
cmake --preset macos -DCMAKE_CXX_COMPILER_LAUNCHER="" -DMLN_WITH_GLFW=OFF
cmake --build build-macos --target mbgl-core
cmake --preset macos-metal -DCMAKE_CXX_COMPILER_LAUNCHER="" -DMLN_WITH_GLFW=OFF
cmake --build build-macos-metal --target mbgl-core
- name: Rename artifact
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
cp build-macos-metal/libmbgl-core.a libmaplibre-native-core-macos-arm64-metal.a
cp build-macos-metal/libmbgl-core-amalgam.a libmaplibre-native-core-amalgam-macos-arm64-metal.a
- name: Upload macOS artifacts
if: github.event_name == 'pull_request'

View File

@@ -19,19 +19,28 @@
"CMAKE_OSX_DEPLOYMENT_TARGET": "14.0",
"MLN_WITH_METAL": "ON",
"MLN_WITH_OPENGL": "OFF"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
},
{
"name": "macos",
"displayName": "macOS",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-macos",
"cacheVariables": {
"CMAKE_SYSTEM_NAME": "Darwin",
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
"CMAKE_OSX_DEPLOYMENT_TARGET": "14.3",
"CMAKE_BUILD_TYPE": "Debug",
"MLN_DARWIN_USE_LIBUV": "ON"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
},
{
@@ -122,6 +131,11 @@
"MLN_WITH_CLANG_TIDY": "OFF",
"MLN_WITH_WAYLAND": "ON",
"MLN_WITH_X11": "OFF"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
},
{
@@ -189,6 +203,11 @@
"MLN_WITH_EGL": "OFF",
"MLN_WITH_VULKAN": "OFF",
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{

View File

@@ -57,7 +57,7 @@ xed platform/macos/MapLibre.xcodeproj
Configure CMake:
```sh
cmake --preset macos
cmake --preset macos-metal
```
Build and run the render tests:
@@ -70,10 +70,10 @@ build-macos/mbgl-render-test-runner --manifestPath=metrics/macos-xcode11-release
Build and run the C++ Tests:
```sh
cmake --build build-macos --target mbgl-test-runner
cmake --build build-macos-metal --target mbgl-test-runner
npm install && node test/storage/server.js # required test server
# in another terminal
build-macos/mbgl-test-runner
build-macos-metal/mbgl-test-runner
```
Create and open an Xcode project with CMake: