diff --git a/.github/workflows/build-presets.yml b/.github/workflows/build-presets.yml index 160c07af15e..8cb25c74691 100644 --- a/.github/workflows/build-presets.yml +++ b/.github/workflows/build-presets.yml @@ -109,7 +109,7 @@ jobs: strategy: fail-fast: false matrix: - preset: [pybind] + preset: [pybind, windows] with: job-name: build ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} diff --git a/CMakePresets.json b/CMakePresets.json index 9a3e9290d43..cc293730292 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -120,6 +120,21 @@ ] } }, + { + "name": "windows", + "displayName": "Build ExecuTorch for Windows", + "inherits": ["common"], + "cacheVariables": { + "CMAKE_SYSTEM_NAME": "Windows", + "EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/windows.cmake" + }, + "toolset": "ClangCL", + "condition": { + "lhs": "${hostSystemName}", + "type": "equals", + "rhs": "Windows" + } + }, { "name": "zephyr", "displayName": "Build ExecuTorch for Zephyr RTOS", diff --git a/tools/cmake/preset/windows.cmake b/tools/cmake/preset/windows.cmake new file mode 100644 index 00000000000..e6be8aa6c3b --- /dev/null +++ b/tools/cmake/preset/windows.cmake @@ -0,0 +1,21 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + + +# keep sorted +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL ON) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_MODULE ON) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL ON) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON) + +# Below options are not yet buildable on Windows, but should be. +set(EXECUTORCH_BUILD_PORTABLE_OPS OFF CACHE BOOL "") +#set_overridable_option(EXECUTORCH_BUILD_EXECUTOR_RUNNER ON) +#set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON) +#set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON) +#set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON)