@@ -100,8 +100,8 @@ function(extract_sources sources_file)
100100 execute_process (
101101 COMMAND
102102 ${PYTHON_EXECUTABLE} ${executorch_root} /tools/cmake/extract_sources.py
103- --config=${executorch_root} /tools/cmake/cmake_deps.toml --out= ${sources_file}
104- --buck2=${BUCK2} ${target_platforms_arg}
103+ --config=${executorch_root} /tools/cmake/cmake_deps.toml
104+ --out= ${sources_file} -- buck2=${BUCK2} ${target_platforms_arg}
105105 OUTPUT_VARIABLE gen_srcs_output
106106 ERROR_VARIABLE gen_srcs_error
107107 RESULT_VARIABLE gen_srcs_exit_code
@@ -203,8 +203,8 @@ function(resolve_python_executable)
203203 )
204204 elseif (DEFINED ENV{VIRTUAL_ENV})
205205 set (PYTHON_EXECUTABLE
206- $ENV{VIRTUAL_ENV} /bin/python3
207- PARENT_SCOPE
206+ $ENV{VIRTUAL_ENV} /bin/python3
207+ PARENT_SCOPE
208208 )
209209 else ()
210210 set (PYTHON_EXECUTABLE
@@ -217,29 +217,29 @@ endfunction()
217217# find_package(Torch CONFIG REQUIRED) replacement for targets that have a
218218# header-only Torch dependency.
219219#
220- # Unlike find_package(Torch ...), this will only set
221- # TORCH_INCLUDE_DIRS in the parent scope. In particular, it will NOT
222- # set any of the following:
223- # - TORCH_FOUND
224- # - TORCH_LIBRARY
225- # - TORCH_CXX_FLAGS
220+ # Unlike find_package(Torch ...), this will only set TORCH_INCLUDE_DIRS in the
221+ # parent scope. In particular, it will NOT set any of the following: -
222+ # TORCH_FOUND - TORCH_LIBRARY - TORCH_CXX_FLAGS
226223function (find_package_torch_headers)
227224 # We implement this way rather than using find_package so that
228- # cross-compilation can still use the host's installed copy of
229- # torch, since the headers should be fine.
225+ # cross-compilation can still use the host's installed copy of torch, since
226+ # the headers should be fine.
230227 get_torch_base_path(TORCH_BASE_PATH)
231- set (TORCH_INCLUDE_DIRS "${TORCH_BASE_PATH} /include;${TORCH_BASE_PATH} /include/torch/csrc/api/include" PARENT_SCOPE)
228+ set (TORCH_INCLUDE_DIRS
229+ "${TORCH_BASE_PATH} /include;${TORCH_BASE_PATH} /include/torch/csrc/api/include"
230+ PARENT_SCOPE
231+ )
232232endfunction ()
233233
234- # Return the base path to the installed Torch Python library in
235- # outVar.
234+ # Return the base path to the installed Torch Python library in outVar.
236235function (get_torch_base_path outVar)
237236 if (NOT PYTHON_EXECUTABLE)
238237 resolve_python_executable()
239238 endif ()
240239 execute_process (
241- COMMAND "${PYTHON_EXECUTABLE} " -c
242- "import importlib.util; print(importlib.util.find_spec('torch').submodule_search_locations[0])"
240+ COMMAND
241+ "${PYTHON_EXECUTABLE} " -c
242+ "import importlib.util; print(importlib.util.find_spec('torch').submodule_search_locations[0])"
243243 OUTPUT_VARIABLE _tmp_torch_path
244244 ERROR_VARIABLE _tmp_torch_path_error
245245 RESULT_VARIABLE _tmp_torch_path_result COMMAND_ECHO STDERR
@@ -252,7 +252,10 @@ function(get_torch_base_path outVar)
252252 message ("Output:\n ${_tmp_torch_path} " )
253253 message (FATAL_ERROR "Error:\n ${_tmp_torch_path_error} " )
254254 endif ()
255- set (${outVar} ${_tmp_torch_path} PARENT_SCOPE)
255+ set (${outVar}
256+ ${_tmp_torch_path}
257+ PARENT_SCOPE
258+ )
256259endfunction ()
257260
258261# Add the Torch CMake configuration to CMAKE_PREFIX_PATH so that find_package
0 commit comments