File tree Expand file tree Collapse file tree 5 files changed +71
-0
lines changed Expand file tree Collapse file tree 5 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 11
11
concurrency :
12
12
group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
13
13
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
+ .ci/scripts/setup-conda.sh
29
+ ${CONDA_RUN} ./install_requirements.sh
30
+ ${CONDA_RUN} cmake --preset ${{ matrix.preset }}
31
+ ${CONDA_RUN} cmake --build cmake-out --parallel
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ project(executorch)
48
48
# MARK: - Start EXECUTORCH_H12025_BUILD_MIGRATION --------------------------------------------------
49
49
50
50
include (${PROJECT_SOURCE_DIR} /tools/cmake/common/preset.cmake )
51
+
52
+ load_build_preset ()
51
53
include (${PROJECT_SOURCE_DIR} /tools/cmake/preset/default.cmake )
52
54
53
55
# 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)
313
313
python
314
314
PARENT_SCOPE
315
315
)
316
+ elseif (DEFINED ENV{VIRTUAL_ENV} )
317
+ set (PYTHON_EXECUTABLE
318
+ $ENV{VIRTUAL_ENV} /bin/python3
319
+ PARENT_SCOPE
320
+ )
316
321
else ()
317
322
set (PYTHON_EXECUTABLE
318
323
python3
Original file line number Diff line number Diff line change @@ -91,3 +91,16 @@ macro(set_overridable_option NAME VALUE)
91
91
92
92
set (${NAME} ${VALUE} CACHE STRING "" )
93
93
endmacro ()
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
+ else ()
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
+ # message(WARNING "Unable to determine build preset with CMAKE_SYSTEM_NAME (${CMAKE_SYSTEM_NAME}) and CMAKE_SYSTEM_PROCESSOR (${CMAKE_SYSTEM_PROCESSOR}). Using default build settings.")
105
+ endif ()
106
+ endmacro ()
You can’t perform that action at this time.
0 commit comments