File tree Expand file tree Collapse file tree 5 files changed +68
-0
lines changed Expand file tree Collapse file tree 5 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 1111concurrency :
1212 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
1313 cancel-in-progress : true
14+
15+ jobs :
16+ apple :
17+ uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
18+ strategy :
19+ matrix :
20+ preset : [macos-arm64]
21+ with :
22+ job-name : build
23+ runner : macos-latest-xlarge
24+ python-version : 3.12
25+ submodules : recursive
26+ script : |
27+ set -eux
28+ ${CONDA_RUN} ./install_requirements.sh > /dev/null
29+ ${CONDA_RUN} cmake --preset ${{ matrix.preset }}
30+ ${CONDA_RUN} cmake --build cmake-out --parallel
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ project(executorch)
4848# MARK: - Start EXECUTORCH_H12025_BUILD_MIGRATION --------------------------------------------------
4949
5050include (${PROJECT_SOURCE_DIR} /tools/cmake/common/preset.cmake)
51+
52+ load_build_preset()
5153include (${PROJECT_SOURCE_DIR} /tools/cmake/preset/default.cmake)
5254
5355# Print all the configs that were called with announce_configured_options.
Original file line number Diff line number Diff line change 1+ {
2+ "version" : 10 ,
3+ "cmakeMinimumRequired" : {
4+ "major" : 3 ,
5+ "minor" : 31 ,
6+ "patch" : 0
7+ },
8+ "$comment" : " On-device AI across mobile, embedded and edge for PyTorch." ,
9+ "configurePresets" : [
10+ {
11+ "name" : " common" ,
12+ "hidden" : true ,
13+ "binaryDir" : " ${sourceDir}/cmake-out" ,
14+ "generator" : " Unix Makefiles"
15+ },
16+ {
17+ "name" : " macos-arm64" ,
18+ "inherits" : [" common" ],
19+ "generator" : " Xcode" ,
20+ "cacheVariables" : {
21+ "CMAKE_TOOLCHAIN_FILE" : " ${sourceDir}/third-party/ios-cmake/ios.toolchain.cmake" ,
22+ "EXECUTORCH_BUILD_PRESET_FILE" : " ${sourceDir}/tools/cmake/preset/macos-arm64.cmake" ,
23+ "PLATFORM" : " MAC_ARM64" ,
24+ "DEPLOYMENT_TARGET" : " 10.15"
25+ },
26+ "condition" : {
27+ "lhs" : " ${hostSystemName}" ,
28+ "type" : " equals" ,
29+ "rhs" : " Darwin"
30+ }
31+ }
32+ ]
33+ }
Original file line number Diff line number Diff line change @@ -313,6 +313,11 @@ function(resolve_python_executable)
313313 python
314314 PARENT_SCOPE
315315 )
316+ elseif (DEFINED ENV{VIRTUAL_ENV})
317+ set (PYTHON_EXECUTABLE
318+ $ENV{VIRTUAL_ENV} /bin/python3
319+ PARENT_SCOPE
320+ )
316321 else ()
317322 set (PYTHON_EXECUTABLE
318323 python3
Original file line number Diff line number Diff line change @@ -91,3 +91,14 @@ macro(set_overridable_option NAME VALUE)
9191
9292 set (${NAME} ${VALUE} CACHE STRING "" )
9393endmacro ()
94+
95+ # Detemine the build preset and load it.
96+ macro (load_build_preset)
97+ if (DEFINED EXECUTORCH_BUILD_PRESET_FILE)
98+ announce_configured_options(EXECUTORCH_BUILD_PRESET_FILE)
99+ message (STATUS "Loading build preset: ${EXECUTORCH_BUILD_PRESET_FILE} " )
100+ include (${EXECUTORCH_BUILD_PRESET_FILE} )
101+ endif ()
102+ # For now, just continue if the preset file is not set. In the future, we will
103+ # try to determine a preset file.
104+ endmacro ()
You can’t perform that action at this time.
0 commit comments