Skip to content

Commit e053442

Browse files
committed
wip ∫ MAY 20 2025 16:19:09
1 parent 1b063ca commit e053442

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

.github/workflows/build-presets.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,24 @@ jobs:
6666
./install_requirements.sh > /dev/null
6767
cmake --preset ${{ matrix.preset }}
6868
cmake --build cmake-out --parallel
69+
70+
windows:
71+
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
preset: [pybind]
76+
with:
77+
job-name: build
78+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
79+
submodules: recursive
80+
timeout: 90
81+
script: |
82+
set -eux
83+
84+
conda create --yes --quiet -n et python=3.12
85+
conda activate et
86+
87+
./install_requirements.sh > /dev/null
88+
cmake --preset ${{ matrix.preset }}
89+
cmake --build cmake-out --parallel

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,19 @@ if(NOT CMAKE_BUILD_TYPE)
6767
endif()
6868
announce_configured_options(CMAKE_BUILD_TYPE)
6969

70+
if(WIN32)
71+
if(CMAKE_CXX_COMPILER AND NOT CMAKE_CXX_COMPILER STREQUAL "clang-cl")
72+
message(WARNING "On Windows, only clang-cl is supported as the C++ compiler. Forcing clang-cl")
73+
endif()
74+
set(CMAKE_CXX_COMPILER "clang-cl")
75+
endif()
76+
announce_configured_options(CMAKE_CXX_COMPILER_ID)
77+
7078
if(NOT PYTHON_EXECUTABLE)
7179
resolve_python_executable()
7280
endif()
7381
announce_configured_options(PYTHON_EXECUTABLE)
7482

75-
announce_configured_options(CMAKE_CXX_COMPILER_ID)
7683
announce_configured_options(CMAKE_TOOLCHAIN_FILE)
7784
announce_configured_options(BUCK2)
7885

install_executorch.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,6 @@ def main(args):
221221
# latest PT commit otherwise
222222
use_pytorch_nightly = False
223223

224-
# Use ClangCL on Windows.
225-
# ClangCL is an alias to Clang that configures it to work in an MSVC-compatible
226-
# mode. Using it on Windows to avoid compiler compatibility issues for MSVC.
227-
if os.name == "nt":
228-
cmake_args.append("-T ClangCL")
229-
230224
#
231225
# Install executorch pip package. This also makes `flatc` available on the path.
232226
# The --extra-index-url may be necessary if pyproject.toml has a dependency on a

0 commit comments

Comments
 (0)