File tree Expand file tree Collapse file tree 9 files changed +22
-60
lines changed Expand file tree Collapse file tree 9 files changed +22
-60
lines changed Original file line number Diff line number Diff line change @@ -76,16 +76,10 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
76
76
)
77
77
78
78
#
79
- # The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE} .
79
+ # The `_<target>_srcs` lists are defined by executorch_load_build_variables .
80
80
#
81
- set (EXECUTORCH_SRCS_FILE
82
- "${CMAKE_CURRENT_BINARY_DIR} /../../../executorch_srcs.cmake"
83
- )
84
-
85
- extract_sources (${EXECUTORCH_SRCS_FILE} )
86
-
81
+ executorch_load_build_variables ()
87
82
set (_mps_schema_headers ${CMAKE_BINARY_DIR} /../../../schema/include/ )
88
- include (${EXECUTORCH_SRCS_FILE} )
89
83
target_include_directories (
90
84
bundled_program
91
85
INTERFACE ${CMAKE_CURRENT_BINARY_DIR} /../../../devtools/include
Original file line number Diff line number Diff line change @@ -36,13 +36,9 @@ set(_common_include_directories
36
36
)
37
37
38
38
#
39
- # The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE} .
39
+ # The `_<target>_srcs` lists are defined by executorch_load_build_variables .
40
40
#
41
- set (EXECUTORCH_SRCS_FILE
42
- "${CMAKE_CURRENT_BINARY_DIR} /../../executorch_srcs.cmake"
43
- )
44
- extract_sources (${EXECUTORCH_SRCS_FILE} )
45
- include (${EXECUTORCH_SRCS_FILE} )
41
+ executorch_load_build_variables ()
46
42
47
43
# Find prebuilt libraries. executorch package should contain portable_ops_lib,
48
44
# etdump, bundled_program.
Original file line number Diff line number Diff line change @@ -59,15 +59,9 @@ option(
59
59
# ------------------------------- OPTIONS END --------------------------------
60
60
61
61
#
62
- # The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE} .
62
+ # The `_<target>_srcs` lists are defined by executorch_load_build_variables .
63
63
#
64
- set (EXECUTORCH_SRCS_FILE
65
- "${CMAKE_CURRENT_BINARY_DIR} /../../../executorch_srcs.cmake"
66
- )
67
-
68
- extract_sources (${EXECUTORCH_SRCS_FILE} )
69
-
70
- include (${EXECUTORCH_SRCS_FILE} )
64
+ executorch_load_build_variables ()
71
65
72
66
# Generate C++ bindings to register kernels into both PyTorch (for AOT) and
73
67
# Executorch (for runtime).
Original file line number Diff line number Diff line change @@ -35,13 +35,9 @@ find_package(gflags REQUIRED)
35
35
set (_common_compile_options -Wno-deprecated-declarations -fPIC )
36
36
37
37
#
38
- # The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE} .
38
+ # The `_<target>_srcs` lists are defined by executorch_load_build_variables .
39
39
#
40
- set (EXECUTORCH_SRCS_FILE
41
- "${CMAKE_CURRENT_BINARY_DIR} /../../executorch_srcs.cmake"
42
- )
43
- extract_sources (${EXECUTORCH_SRCS_FILE} )
44
- include (${EXECUTORCH_SRCS_FILE} )
40
+ executorch_load_build_variables ()
45
41
46
42
get_filename_component (
47
43
EXECUTORCH_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR} /../.." ABSOLUTE
Original file line number Diff line number Diff line change @@ -77,15 +77,9 @@ option(EXECUTORCH_DTYPE_SELECTIVE_BUILD "Enable dtype selective build." OFF)
77
77
# ------------------------------- OPTIONS END --------------------------------
78
78
79
79
#
80
- # The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE} .
80
+ # The `_<target>_srcs` lists are defined by executorch_load_build_variables .
81
81
#
82
- set (EXECUTORCH_SRCS_FILE
83
- "${CMAKE_CURRENT_BINARY_DIR} /../../executorch_srcs.cmake"
84
- )
85
-
86
- extract_sources (${EXECUTORCH_SRCS_FILE} )
87
-
88
- include (${EXECUTORCH_SRCS_FILE} )
82
+ executorch_load_build_variables ()
89
83
90
84
#
91
85
# select_build_lib: C++ library to register selected ops in custom kernel
Original file line number Diff line number Diff line change @@ -25,15 +25,9 @@ include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
25
25
include (${EXECUTORCH_ROOT} /tools/cmake/Codegen.cmake )
26
26
27
27
#
28
- # The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE} .
28
+ # The `_<target>_srcs` lists are defined by executorch_load_build_variables .
29
29
#
30
- set (EXECUTORCH_SRCS_FILE
31
- "${CMAKE_CURRENT_BINARY_DIR} /../../../executorch_srcs.cmake"
32
- )
33
-
34
- extract_sources (${EXECUTORCH_SRCS_FILE} )
35
-
36
- include (${EXECUTORCH_SRCS_FILE} )
30
+ executorch_load_build_variables ()
37
31
38
32
set (_common_include_directories
39
33
$< BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /..,${CMAKE_CURRENT_SOURCE_DIR} /runtime/core/portable_type/c10>
Original file line number Diff line number Diff line change @@ -24,15 +24,9 @@ include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
24
24
include (${EXECUTORCH_ROOT} /tools/cmake/Codegen.cmake )
25
25
26
26
#
27
- # The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE} .
27
+ # The `_<target>_srcs` lists are defined by executorch_load_build_variables .
28
28
#
29
- set (EXECUTORCH_SRCS_FILE
30
- "${CMAKE_CURRENT_BINARY_DIR} /../../../executorch_srcs.cmake"
31
- )
32
-
33
- extract_sources (${EXECUTORCH_SRCS_FILE} )
34
-
35
- include (${EXECUTORCH_SRCS_FILE} )
29
+ executorch_load_build_variables ()
36
30
37
31
# build llm runner library
38
32
list (TRANSFORM _extension_llm_runner__srcs PREPEND "${EXECUTORCH_ROOT} /" )
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ set(CMAKE_CXX_STANDARD 17)
23
23
24
24
set (EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR} /.. )
25
25
26
+ include (${EXECUTORCH_ROOT} /tools/cmake/Codegen.cmake )
26
27
include (${EXECUTORCH_ROOT} /tools/cmake/Utils.cmake )
27
28
28
29
# Find prebuilt executorch library
@@ -34,13 +35,9 @@ find_package(executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH)
34
35
set (_common_include_directories ${EXECUTORCH_ROOT} /.. )
35
36
36
37
#
37
- # The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE} .
38
+ # The `_<target>_srcs` lists are defined by executorch_load_build_variables .
38
39
#
39
- set (EXECUTORCH_SRCS_FILE "${CMAKE_CURRENT_BINARY_DIR} /../executorch_srcs.cmake" )
40
-
41
- extract_sources (${EXECUTORCH_SRCS_FILE} )
42
-
43
- include (${EXECUTORCH_SRCS_FILE} )
40
+ executorch_load_build_variables ()
44
41
45
42
# Since extract_sources.py is not returning absolute values, we need to patch
46
43
# the source paths.
Original file line number Diff line number Diff line change @@ -349,13 +349,16 @@ endfunction()
349
349
function (executorch_append_filelist name outputvar )
350
350
# configure_file adds its input to the list of CMAKE_RERUN dependencies
351
351
configure_file (
352
- ${PROJECT_SOURCE_DIR } /shim_et/xplat/executorch/build/build_variables.bzl
352
+ ${EXECUTORCH_ROOT } /shim_et/xplat/executorch/build/build_variables.bzl
353
353
${PROJECT_BINARY_DIR} /build_variables.bzl COPYONLY
354
354
)
355
+ if (NOT PYTHON_EXECUTABLE )
356
+ resolve_python_executable ()
357
+ endif ()
355
358
execute_process (
356
359
COMMAND
357
360
"${PYTHON_EXECUTABLE} " -c
358
- "exec(open('${PROJECT_SOURCE_DIR } /shim_et/xplat/executorch/build/build_variables.bzl').read());print(';'.join(${name} ))"
361
+ "exec(open('${EXECUTORCH_ROOT } /shim_et/xplat/executorch/build/build_variables.bzl').read());print(';'.join(${name} ))"
359
362
WORKING_DIRECTORY "${_rootdir} "
360
363
RESULT_VARIABLE _retval
361
364
OUTPUT_VARIABLE _tempvar
You can’t perform that action at this time.
0 commit comments