Skip to content

Commit a4b4115

Browse files
committed
Create Windows CMake preset
ghstack-source-id: 0855229 ghstack-comment-id: 3172042069 Pull-Request: #13257
1 parent b69c3c9 commit a4b4115

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: [pybind, windows]
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
@@ -120,6 +120,21 @@
120120
]
121121
}
122122
},
123+
{
124+
"name": "windows",
125+
"displayName": "Build ExecuTorch for Windows",
126+
"inherits": ["common"],
127+
"cacheVariables": {
128+
"CMAKE_SYSTEM_NAME": "Windows",
129+
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/windows.cmake"
130+
},
131+
"toolset": "ClangCL",
132+
"condition": {
133+
"lhs": "${hostSystemName}",
134+
"type": "equals",
135+
"rhs": "Windows"
136+
}
137+
},
123138
{
124139
"name": "zephyr",
125140
"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)