File tree Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Expand file tree Collapse file tree 4 files changed +53
-0
lines changed 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 @@ -317,6 +317,11 @@ function(resolve_python_executable)
317317 python
318318 PARENT_SCOPE
319319 )
320+ elseif (DEFINED ENV{VIRTUAL_ENV})
321+ set (PYTHON_EXECUTABLE
322+ $ENV{VIRTUAL_ENV} /bin/python3
323+ PARENT_SCOPE
324+ )
320325 else ()
321326 set (PYTHON_EXECUTABLE
322327 python3
Original file line number Diff line number Diff line change @@ -91,3 +91,16 @@ 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 (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