Skip to content

Commit 6a26082

Browse files
committed
enforce clang on windows
1 parent d8ac866 commit 6a26082

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

.github/workflows/build-presets.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,17 @@ jobs:
7272
strategy:
7373
fail-fast: false
7474
matrix:
75-
preset: [pybind]
75+
preset: [pybind, llm]
7676
with:
7777
job-name: build
7878
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
7979
submodules: recursive
8080
timeout: 90
8181
script: |
8282
set -eux
83-
conda init powershell
84-
powershell -Command "& {
85-
\$ErrorActionPreference = 'Stop'
86-
Set-PSDebug -Trace 1
83+
conda create --yes --quiet -n et python=3.12
84+
conda activate et
8785
88-
conda create --yes --quiet -n et python=3.12
89-
conda activate et
90-
91-
python install_requirements.py
92-
cmake --preset ${{ matrix.preset }}
93-
\$numCores = [System.Environment]::GetEnvironmentVariable('NUMBER_OF_PROCESSORS') - 1
94-
cmake --build cmake-out -j \$numCores
95-
}"
86+
./install_requirements.sh
87+
cmake -G "Visual Studio 17 2022" -T ClangCL --preset ${{ matrix.preset }}
88+
cmake --build cmake-out -j$(( $(nproc) - 1 ))

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ if(NOT PYTHON_EXECUTABLE)
7272
endif()
7373
announce_configured_options(PYTHON_EXECUTABLE)
7474

75+
if(WIN32)
76+
if(NOT "${CMAKE_GENERATOR_TOOLSET}" STREQUAL "" AND NOT CMAKE_GENERATOR_TOOLSET MATCHES "Clang")
77+
message(FATAL_ERROR "Windows builds require Clang compiler. Current CMAKE_GENERATOR_TOOLSET: ${CMAKE_GENERATOR_TOOLSET}")
78+
endif()
79+
endif()
80+
7581
announce_configured_options(CMAKE_CXX_COMPILER_ID)
7682
announce_configured_options(CMAKE_TOOLCHAIN_FILE)
7783
announce_configured_options(BUCK2)

0 commit comments

Comments
 (0)