@@ -44,6 +44,8 @@ function(executorch_print_configuration_summary)
44
44
message (
45
45
STATUS
46
46
" EXECUTORCH_BUILD_COREML : ${EXECUTORCH_BUILD_COREML} " )
47
+ message (STATUS " EXECUTORCH_BUILD_CUSTOM : "
48
+ "${EXECUTORCH_BUILD_CUSTOM} " )
47
49
message (STATUS " EXECUTORCH_BUILD_EXECUTOR_RUNNER : "
48
50
"${EXECUTORCH_BUILD_EXECUTOR_RUNNER} " )
49
51
message (STATUS " EXECUTORCH_BUILD_EXTENSION_DATA_LOADER : "
@@ -135,9 +137,10 @@ function(extract_sources sources_file)
135
137
endif ()
136
138
137
139
execute_process (
138
- COMMAND ${PYTHON_EXECUTABLE} ${executorch_root} /build/extract_sources.py
139
- --config=${executorch_root}/build/cmake_deps.toml --out=${sources_file}
140
- --buck2=${BUCK2}
140
+ COMMAND
141
+ ${PYTHON_EXECUTABLE} ${executorch_root} /build/extract_sources.py
142
+ --config=${executorch_root}/build/cmake_deps.toml --out=${sources_file}
143
+ --buck2=${BUCK2}
141
144
OUTPUT_VARIABLE gen_srcs_output
142
145
ERROR_VARIABLE gen_srcs_error
143
146
RESULT_VARIABLE gen_srcs_exit_code
@@ -153,16 +156,14 @@ function(extract_sources sources_file)
153
156
endif ()
154
157
endfunction ()
155
158
156
- # Sets the value of the BUCK2 variable by searching for a buck2 binary
157
- # with the correct version.
159
+ # Sets the value of the BUCK2 variable by searching for a buck2 binary with the
160
+ # correct version.
158
161
#
159
- # The resolve_buck.py script uses the following logic to find buck2:
160
- # 1) If BUCK2 argument is set explicitly, use it. Warn if the version is
161
- # incorrect.
162
- # 2) Look for a binary named buck2 on the system path. Take it if it is
163
- # the correct version.
164
- # 3) Check for a previously downloaded buck2 binary (from step 4).
165
- # 4) Download and cache correct version of buck2.
162
+ # The resolve_buck.py script uses the following logic to find buck2: 1) If BUCK2
163
+ # argument is set explicitly, use it. Warn if the version is incorrect. 2) Look
164
+ # for a binary named buck2 on the system path. Take it if it is the correct
165
+ # version. 3) Check for a previously downloaded buck2 binary (from step 4). 4)
166
+ # Download and cache correct version of buck2.
166
167
function (resolve_buck2 )
167
168
if (EXECUTORCH_ROOT )
168
169
set (executorch_root ${EXECUTORCH_ROOT} )
@@ -171,8 +172,8 @@ function(resolve_buck2)
171
172
endif ()
172
173
173
174
set (resolve_buck2_command
174
- ${PYTHON_EXECUTABLE} ${executorch_root} /build/resolve_buck.py
175
- --cache_dir=${CMAKE_CURRENT_BINARY_DIR}/buck2-bin )
175
+ ${PYTHON_EXECUTABLE} ${executorch_root} /build/resolve_buck.py
176
+ --cache_dir=${CMAKE_CURRENT_BINARY_DIR}/buck2-bin )
176
177
177
178
if (NOT ${BUCK2} STREQUAL "" )
178
179
list (APPEND resolve_buck2_command --buck2=${BUCK2} )
@@ -186,35 +187,42 @@ function(resolve_buck2)
186
187
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
187
188
OUTPUT_STRIP_TRAILING_WHITESPACE )
188
189
189
- if (resolve_buck2_exit_code EQUAL 0 )
190
- set (BUCK2 ${resolve_buck2_output} PARENT_SCOPE )
191
- message (STATUS "Resolved buck2 as ${resolve_buck2_output} ." )
192
- elseif (resolve_buck2_exit_code EQUAL 2 )
193
- # Wrong buck version used. Stop here to ensure that the user sees
194
- # the error.
195
- message (FATAL_ERROR "Failed to resolve buck2.\n ${resolve_buck2_error} " )
196
- else ()
197
- # Unexpected failure of the script. Warn.
198
- message (WARNING "Failed to resolve buck2." )
199
- message (WARNING "${resolve_buck2_error} " )
190
+ if (resolve_buck2_exit_code EQUAL 0 )
191
+ set (BUCK2
192
+ ${resolve_buck2_output}
193
+ PARENT_SCOPE )
194
+ message (STATUS "Resolved buck2 as ${resolve_buck2_output} ." )
195
+ elseif (resolve_buck2_exit_code EQUAL 2 )
196
+ # Wrong buck version used. Stop here to ensure that the user sees the error.
197
+ message (FATAL_ERROR "Failed to resolve buck2.\n ${resolve_buck2_error} " )
198
+ else ()
199
+ # Unexpected failure of the script. Warn.
200
+ message (WARNING "Failed to resolve buck2." )
201
+ message (WARNING "${resolve_buck2_error} " )
200
202
201
- if ("${BUCK2} " STREQUAL "" )
202
- set (BUCK2 "buck2" PARENT_SCOPE )
203
- endif ()
203
+ if ("${BUCK2} " STREQUAL "" )
204
+ set (BUCK2
205
+ "buck2"
206
+ PARENT_SCOPE )
204
207
endif ()
208
+ endif ()
205
209
endfunction ()
206
210
207
- # Sets the value of the PYTHON_EXECUTABLE variable to 'python' if in
208
- # an active (non-base) conda environment, and 'python3' otherwise. This
209
- # maintains backwards compatibility for non-conda users and avoids conda
210
- # users needing to explicitly set PYTHON_EXECUTABLE=python.
211
+ # Sets the value of the PYTHON_EXECUTABLE variable to 'python' if in an active
212
+ # (non-base) conda environment, and 'python3' otherwise. This maintains
213
+ # backwards compatibility for non-conda users and avoids conda users needing to
214
+ # explicitly set PYTHON_EXECUTABLE=python.
211
215
function (resolve_python_executable )
212
- # Counter-intuitively, CONDA_DEFAULT_ENV contains the name of the
213
- # active environment.
214
- if (DEFINED ENV{CONDA_DEFAULT_ENV} AND
215
- NOT $ENV{CONDA_DEFAULT_ENV} STREQUAL "base" )
216
- set (PYTHON_EXECUTABLE python PARENT_SCOPE )
216
+ # Counter-intuitively, CONDA_DEFAULT_ENV contains the name of the active
217
+ # environment.
218
+ if (DEFINED ENV{CONDA_DEFAULT_ENV} AND NOT $ENV{CONDA_DEFAULT_ENV} STREQUAL
219
+ "base" )
220
+ set (PYTHON_EXECUTABLE
221
+ python
222
+ PARENT_SCOPE )
217
223
else ()
218
- set (PYTHON_EXECUTABLE python3 PARENT_SCOPE )
224
+ set (PYTHON_EXECUTABLE
225
+ python3
226
+ PARENT_SCOPE )
219
227
endif ()
220
228
endfunction ()
0 commit comments