add other macos compiler

This commit is contained in:
coco875
2025-08-06 09:16:54 -06:00
committed by Lywx
parent ee47ca0212
commit 95e7d360c1
5 changed files with 16 additions and 16 deletions
+11
View File
@@ -13,10 +13,21 @@ jobs:
matrix:
config: [Release, Debug]
standalone: [OFF, ON]
toolchain: [cmake/toolchain/macos-clang.cmake, cmake/toolchain/macos-clang-llvm.cmake, cmake/toolchain/macos-gnu.cmake]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install cmake ninja xcodes
- name: Download llvm
if: ${{ matrix.toolchain == 'cmake/toolchain/macos-clang-llvm.cmake' }}
run: |
brew install llvm lld
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
- name: Download gnu
if: ${{ matrix.toolchain == 'cmake/toolchain/macos-gnu.cmake' }}
run: |
brew install gcc
echo "/opt/homebrew/opt/gcc/bin" >> $GITHUB_PATH
- name: Build
run: |
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }}
-16
View File
@@ -36,22 +36,6 @@ jobs:
run: |
cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="${{ matrix.toolchain }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }}
cmake --build ./build/${{ matrix.arch }}
# - name: Setup Ninja
# if: ${{ matrix.generate == 'Ninja' }}
# uses: ilammy/msvc-dev-cmd@v1
# with:
# arch: ${{ matrix.arch }}
# # only use default toolchain for Ninja
# - name: Build Ninja msvc
# if: ${{ matrix.generate == 'Ninja' && matrix.toolchain == 'torch/cmake/toolchain/windows-msvc.cmake' }}
# run: |
# cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }}
# cmake --build ./build/${{ matrix.arch }} --config ${{ matrix.config }} --parallel 10
# - name: Build Ninja clang-cl
# if: ${{ matrix.generate == 'Ninja' && matrix.toolchain == 'cmake/toolchain/windows-clang-cl.cmake' }}
# run: |
# cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DCMAKE_CXX_COMPILER=clang-cl.exe -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_LINKER=lld-link.exe -DUSE_STANDALONE=${{ matrix.standalone }}
# cmake --build ./build/${{ matrix.arch }} --config ${{ matrix.config }} --parallel 10
- name: Publish packaged artifacts
if: ${{ matrix.config == 'Release' && matrix.generate == 'Visual Studio 17 2022' && matrix.standalone == 'ON' }}
uses: actions/upload-artifact@v4
+3
View File
@@ -0,0 +1,3 @@
set(CMAKE_C_COMPILER /opt/homebrew/opt/llvm/bin/clang)
set(CMAKE_CXX_COMPILER /opt/homebrew/opt/llvm/bin/clang++)
set(CMAKE_LINKER /opt/homebrew/opt/lld/bin/lld-link)
View File
+2
View File
@@ -0,0 +1,2 @@
set(CMAKE_C_COMPILER /opt/homebrew/opt/gcc/bin/gcc)
set(CMAKE_CXX_COMPILER /opt/homebrew/opt/gcc/bin/g++)