Skip to content

Commit 1d832ad

Browse files
authored
Create Windows CMake preset (#13257)
Create a CMake preset for Windows, based on what is currently buildable. Add to CI. A lot of things are currently broken, including portable kernels and XNNPACK. I've disabled these (and more) to allow setting up the initial preset and CI. These build issues will be resolved further in this stack. I've also disabled the pybind preset on Windows for now, as it does not build yet.
1 parent 6ee6d7a commit 1d832ad

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

.github/workflows/build-presets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
strategy:
110110
fail-fast: false
111111
matrix:
112-
preset: [pybind]
112+
preset: [windows] # TODO (gjcomer) Re-enable pybind once functional
113113
with:
114114
job-name: build
115115
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}

CMakePresets.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,21 @@
150150
]
151151
}
152152
},
153+
{
154+
"name": "windows",
155+
"displayName": "Build ExecuTorch for Windows",
156+
"inherits": ["common"],
157+
"cacheVariables": {
158+
"CMAKE_SYSTEM_NAME": "Windows",
159+
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/windows.cmake"
160+
},
161+
"toolset": "ClangCL",
162+
"condition": {
163+
"lhs": "${hostSystemName}",
164+
"type": "equals",
165+
"rhs": "Windows"
166+
}
167+
},
153168
{
154169
"name": "zephyr",
155170
"displayName": "Build ExecuTorch for Zephyr RTOS",

tools/cmake/preset/windows.cmake

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
# keep sorted
8+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON)
9+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL ON)
10+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
11+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_MODULE ON)
12+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL ON)
13+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
14+
15+
# Below options are not yet buildable on Windows, but should be.
16+
set(EXECUTORCH_BUILD_PORTABLE_OPS
17+
OFF
18+
CACHE BOOL ""
19+
)
20+
# set_overridable_option(EXECUTORCH_BUILD_EXECUTOR_RUNNER ON)
21+
# set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
22+
# set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON)
23+
# set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON)

0 commit comments

Comments
 (0)