Skip to content

Commit

Permalink
Fix macOS CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe2933 committed Oct 2, 2024
1 parent 54e26dc commit 557028b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
build:
runs-on: macOS-15
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4

Expand All @@ -26,8 +26,8 @@ jobs:
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true

- name: Install Ninja
run: brew install ninja
- name: Install latest LLVM and Ninja
run: brew install llvm ninja

- name: Install vcpkg
run: |
Expand All @@ -42,6 +42,9 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Workaround for CMake issue that cannot find __CMAKE::CXX23 target
run: sed -i '' 's|libc++.modules.json|../../c++/libc++.modules.json|g' /opt/homebrew/opt/cmake/share/cmake/Modules/Compiler/Clang-CXX-CXXImportStd.cmake # https://gitlab.kitware.com/cmake/cmake/-/issues/25965#note_1523575

- name: Configure
run: |
mv .github/workflows/scripts/* .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scripts/CMakeUserPresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"configurePresets": [
{
"name": "linux-clang-18",
"displayName": "Linux + Clang 18",
"inherits": "default",
"cacheVariables": {
"CMAKE_C_COMPILER": "/usr/bin/clang-18",
"CMAKE_CXX_COMPILER": "/usr/bin/clang++-18",
"CMAKE_CXX_FLAGS": "-stdlib=libc++",
"CMAKE_EXE_LINKER_FLAGS": "-stdlib=libc++ -lc++abi",
Expand All @@ -15,9 +15,9 @@
},
{
"name": "macos-clang",
"displayName": "macOS + Clang",
"inherits": "default",
"cacheVariables": {
"CMAKE_C_COMPILER": "/opt/homebrew/opt/llvm/bin/clang",
"CMAKE_CXX_COMPILER": "/opt/homebrew/opt/llvm/bin/clang++",
"CMAKE_CXX_FLAGS": "-nostdinc++ -nostdlib++ -isystem /opt/homebrew/opt/llvm/include/c++/v1",
"CMAKE_EXE_LINKER_FLAGS": "-L /opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++ -lc++",
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/scripts/arm64-macos-clang-toolchain.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
set(CMAKE_C_COMPILER /opt/homebrew/opt/llvm/bin/clang)
set(CMAKE_CXX_COMPILER /opt/homebrew/opt/llvm/bin/clang++)
set(CMAKE_CXX_COMPILER /opt/homebrew/opt/llvm/bin/clang++)
set(CMAKE_CXX_FLAGS "-nostdinc++ -nostdlib++ -isystem /opt/homebrew/opt/llvm/include/c++/v1")
set(CMAKE_EXE_LINKER_FLAGS "-L /opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++ -lc++")
2 changes: 1 addition & 1 deletion .github/workflows/scripts/triplets/arm64-macos-clang.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/../arm64-macos-clang-toolchain.cmake)
2 changes: 1 addition & 1 deletion .github/workflows/scripts/triplets/x64-linux-clang.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/../x64-linux-clang-toolchain.cmake)

0 comments on commit 557028b

Please sign in to comment.