diff --git a/.github/labeler.yml b/.github/labeler.yml index 2decbffef..488d96fbf 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -40,6 +40,7 @@ build: - '**/*.cmake' - '**/BUILD.bazel' - '**/*.bzl' + - CMakePresets.json OpenGL: - changed-files: - any-glob-to-any-file: diff --git a/.github/workflows/core-release.yml b/.github/workflows/core-release.yml index 2303ef1fb..0d80432aa 100644 --- a/.github/workflows/core-release.yml +++ b/.github/workflows/core-release.yml @@ -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' diff --git a/CMakePresets.json b/CMakePresets.json index 74569b967..7f98bcd1e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -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" } }, { diff --git a/docs/mdbook/src/platforms/macos/README.md b/docs/mdbook/src/platforms/macos/README.md index 2766e78df..6a8434fd0 100644 --- a/docs/mdbook/src/platforms/macos/README.md +++ b/docs/mdbook/src/platforms/macos/README.md @@ -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: