Skip to content

Commit f8c0a85

Browse files
committed
Create Windows CMake preset
ghstack-source-id: 2cd01b7 ghstack-comment-id: 3172042069 Pull-Request: #13257
1 parent dfffe92 commit f8c0a85

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
8+
# keep sorted
9+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON)
10+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL ON)
11+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
12+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_MODULE ON)
13+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL ON)
14+
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
15+
16+
# Below options are not yet buildable on Windows, but should be.
17+
set(EXECUTORCH_BUILD_PORTABLE_OPS OFF CACHE BOOL "")
18+
#set_overridable_option(EXECUTORCH_BUILD_EXECUTOR_RUNNER ON)
19+
#set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
20+
#set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON)
21+
#set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON)

0 commit comments

Comments
 (0)