Skip to content

Enforce clang for Windows builds #11159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions .github/workflows/build-presets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,17 @@ jobs:
strategy:
fail-fast: false
matrix:
preset: [pybind]
preset: [pybind, llm]
with:
job-name: build
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
submodules: recursive
timeout: 90
script: |
set -eux
conda init powershell
powershell -Command "& {
\$ErrorActionPreference = 'Stop'
Set-PSDebug -Trace 1
conda create --yes --quiet -n et python=3.12
conda activate et

conda create --yes --quiet -n et python=3.12
conda activate et

python install_requirements.py
cmake --preset ${{ matrix.preset }}
\$numCores = [System.Environment]::GetEnvironmentVariable('NUMBER_OF_PROCESSORS') - 1
cmake --build cmake-out -j \$numCores
}"
./install_requirements.sh
cmake -G "Visual Studio 17 2022" -T ClangCL --preset ${{ matrix.preset }}
cmake --build cmake-out -j$(( $(nproc) - 1 ))
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ if(NOT PYTHON_EXECUTABLE)
endif()
announce_configured_options(PYTHON_EXECUTABLE)

if(WIN32)
if(NOT "${CMAKE_GENERATOR_TOOLSET}" STREQUAL "" AND NOT CMAKE_GENERATOR_TOOLSET MATCHES "Clang")
message(FATAL_ERROR "Windows builds require Clang compiler. Current CMAKE_GENERATOR_TOOLSET: ${CMAKE_GENERATOR_TOOLSET}")
endif()
endif()

announce_configured_options(CMAKE_CXX_COMPILER_ID)
announce_configured_options(CMAKE_TOOLCHAIN_FILE)
announce_configured_options(BUCK2)
Expand Down
Loading