Skip to content

Commit 1656854

Browse files
authored
Kernels should depend on executorch_core
Differential Revision: D74290250 Pull Request resolved: #10738
1 parent 03a3f07 commit 1656854

File tree

8 files changed

+11
-23
lines changed

8 files changed

+11
-23
lines changed

configurations/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
5959
optimized_kernels
6060
${_optimized_native_cpu_ops_lib_portable_kernels_lib}
6161
DEPS
62-
executorch
62+
executorch_core
6363
)
6464

6565
install(TARGETS optimized_native_cpu_ops_lib DESTINATION lib)

examples/models/llama/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,12 @@ find_package(gflags REQUIRED)
8080
# find `executorch` libraries Same as for gflags
8181
set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/ExecuTorch)
8282
find_package(executorch CONFIG REQUIRED)
83-
if(CMAKE_TOOLCHAIN_IOS OR ANDROID)
84-
target_link_options_shared_lib(executorch)
85-
endif()
83+
target_link_options_shared_lib(executorch)
8684

8785
# llama_runner library
8886
add_subdirectory(runner)
8987

90-
set(link_libraries gflags)
88+
set(link_libraries executorch gflags)
9189
set(_srcs main.cpp)
9290

9391
if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
@@ -225,9 +223,5 @@ target_include_directories(
225223
target_link_libraries(llama_main PUBLIC llama_runner ${link_libraries})
226224
target_compile_options(llama_main PUBLIC ${_common_compile_options})
227225

228-
if(APPLE)
229-
target_link_options_shared_lib(executorch)
230-
endif()
231-
232226
# Print all summary
233227
executorch_print_configuration_summary()

examples/models/llama/runner/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ else()
5252
add_library(llama_runner SHARED ${_llama_runner__srcs})
5353
endif()
5454

55-
set(llama_runner_deps executorch extension_data_loader extension_module
55+
set(llama_runner_deps executorch_core extension_data_loader extension_module
5656
extension_tensor
5757
)
5858

examples/models/llava/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,12 @@ endif()
8989
# find `executorch` libraries Same as for gflags
9090
set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/ExecuTorch)
9191
find_package(executorch CONFIG REQUIRED)
92-
if(CMAKE_TOOLCHAIN_IOS OR ANDROID)
93-
target_link_options_shared_lib(executorch)
94-
endif()
92+
target_link_options_shared_lib(executorch)
9593

9694
# llava_runner library
9795
add_subdirectory(runner)
9896

99-
set(LINK_LIBS gflags)
97+
set(LINK_LIBS executorch gflags)
10098
if(NOT LLAVA_RUNNER_NO_TORCH_DUMMY_IMAGE)
10199
list(APPEND LINK_LIBS torch)
102100
endif()
@@ -212,9 +210,5 @@ target_include_directories(llava_main PUBLIC ${_common_include_directories})
212210
target_link_libraries(llava_main PUBLIC llava_runner ${link_libraries})
213211
target_compile_options(llava_main PUBLIC ${_common_compile_options})
214212

215-
if(APPLE)
216-
target_link_options_shared_lib(executorch)
217-
endif()
218-
219213
# Print all summary
220214
executorch_print_configuration_summary()

examples/models/llava/runner/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ add_subdirectory(
4040

4141
add_library(llava_runner STATIC ${_llava_runner__srcs})
4242

43-
set(llava_runner_deps executorch extension_data_loader extension_llm_runner
43+
set(llava_runner_deps executorch_core extension_data_loader extension_llm_runner
4444
extension_module extension_tensor
4545
)
4646

extension/flat_tensor/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ endif()
1818

1919
list(TRANSFORM _extension_flat_tensor__srcs PREPEND "${EXECUTORCH_ROOT}/")
2020
add_library(extension_flat_tensor ${_extension_flat_tensor__srcs})
21-
target_link_libraries(extension_flat_tensor executorch extension_data_loader)
21+
target_link_libraries(extension_flat_tensor executorch_core)
2222
target_include_directories(
2323
extension_flat_tensor
2424
PUBLIC ${EXECUTORCH_ROOT}/..

kernels/optimized/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ target_compile_options(optimized_kernels PUBLIC ${_common_compile_options})
7171
#
7272
# optimized_ops_lib: Register optimized ops kernels into Executorch runtime
7373
gen_operators_lib(
74-
LIB_NAME "optimized_ops_lib" KERNEL_LIBS optimized_kernels DEPS executorch
74+
LIB_NAME "optimized_ops_lib" KERNEL_LIBS optimized_kernels DEPS executorch_core
7575
)
7676

7777
install(

kernels/quantized/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@ if(NOT CMAKE_GENERATOR STREQUAL "Xcode"
142142
endif()
143143

144144
add_library(quantized_kernels ${_quantized_kernels__srcs})
145-
target_link_libraries(quantized_kernels PRIVATE executorch)
145+
target_link_libraries(quantized_kernels PRIVATE executorch_core)
146146
target_compile_options(quantized_kernels PUBLIC ${_common_compile_options})
147147
# Build a library for _quantized_kernels_srcs
148148
#
149149
# quantized_ops_lib: Register quantized ops kernels into Executorch runtime
150150
gen_operators_lib(
151-
LIB_NAME "quantized_ops_lib" KERNEL_LIBS quantized_kernels DEPS executorch
151+
LIB_NAME "quantized_ops_lib" KERNEL_LIBS quantized_kernels DEPS executorch_core
152152
)
153153

154154
install(

0 commit comments

Comments
 (0)