Skip to content

Commit

Permalink
Using Ninja with ClangCL for CI builds (#351)
Browse files Browse the repository at this point in the history
* Using Ninja with ClangCL for CI builds

* Bringing back shell: bash

* Installing Ninja

* Trying to fix quotations

* Trying to fix arg quotes

* Skipping escape chars

* arg expansion

* Splitting up args

* Fixing typo

* Fixing warning flags
  • Loading branch information
jatinchowdhury18 authored Feb 26, 2024
1 parent dd6f2f2 commit bed2e3d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ jobs:
fail-fast: false # show all errors for each platform (vs. cancel jobs on error)
matrix:
include:
- os: ubuntu-latest
- os: ubuntu-22.04
cmake_args: "-DCMAKE_CXX_COMPILER=g++-11"
- os: windows-2022
cmake_args: "-TClangCL -A x64"
cmake_gen: -G"Ninja Multi-Config"
cmake_args: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
- os: macos-13
cmake_args: "-DCMAKE_BUILD_TYPE=Release"

steps:
- name: Install Linux Deps
if: runner.os == 'Linux'
Expand All @@ -43,6 +44,18 @@ jobs:
with:
xcode-version: '15.2'

- name: Install Ninja
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-ninja@master

- name: Add msbuild to PATH
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2

- name: Setup MSVC devcmd
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: Get latest CMake
uses: lukka/get-cmake@latest

Expand Down Expand Up @@ -70,11 +83,10 @@ jobs:
path: modules/jai

- name: Configure
shell: bash
env:
CMAKE_ARGS: ${{ matrix.cmake_args }}
CONFIGURE_ADD_ONS_FLAG: "${{ github.event_name != 'pull_request' && '-DBYOD_BUILD_ADD_ON_MODULES=ON' || '' }}"
run: cmake -Bbuild $CONFIGURE_ADD_ONS_FLAG $CMAKE_ARGS
shell: bash
run: cmake -Bbuild $CONFIGURE_ADD_ONS_FLAG ${{ matrix.cmake_args }} ${{ matrix.cmake_gen }}

- name: Build
shell: bash
Expand Down
1 change: 1 addition & 0 deletions modules/cmake/WarningFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ if(WIN32)
-Wno-sign-conversion
-Wno-implicit-int-float-conversion
-Wno-implicit-const-int-float-conversion
-Wno-unsafe-buffer-usage
-Wno-header-hygiene
)
elseif((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC"))
Expand Down

0 comments on commit bed2e3d

Please sign in to comment.