File tree Expand file tree Collapse file tree 5 files changed +21
-27
lines changed Expand file tree Collapse file tree 5 files changed +21
-27
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,21 @@ deps = [
5858 " executorch_core" ,
5959]
6060
61+ # HACK: prevent reduce_util from also showing up in custom_ops. The
62+ # actual medium-term fix is to stop using Buck to drive our CMake
63+ # builds.
64+ [targets .reduce_util ]
65+ buck_targets = [
66+ " //kernels/portable/cpu/util:reduce_util" ,
67+ ]
68+ filters = [
69+ " .cpp$" ,
70+ ]
71+ deps = [
72+ " executorch" ,
73+ " executorch_core" ,
74+ ]
75+
6176[targets .optimized_kernels ]
6277buck_targets = [
6378 " //kernels/optimized:generated_lib" ,
@@ -414,6 +429,7 @@ deps = [
414429 " optimized_kernels" ,
415430 " extension_parallel" ,
416431 " extension_threadpool" ,
432+ " reduce_util" ,
417433 " xnnpack_backend" ,
418434]
419435
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ set(lib_list
6565 neuron_backend
6666 qnn_executorch_backend
6767 portable_ops_lib
68+ custom_ops
6869 extension_module
6970 extension_module_static
7071 extension_parallel
Original file line number Diff line number Diff line change 1515# ~~~
1616# It should also be cmake-lint clean.
1717#
18- cmake_minimum_required (VERSION 3.19)
18+ cmake_minimum_required (VERSION 3.24) # 3.24 is required for WHOLE_ARCHIVE
1919project (llama_runner)
2020
2121# Duplicating options as root CMakeLists.txt
@@ -84,14 +84,6 @@ if(CMAKE_TOOLCHAIN_IOS OR ANDROID)
8484 target_link_options_shared_lib(executorch)
8585endif ()
8686
87- # custom ops library
88- if (EXECUTORCH_BUILD_KERNELS_CUSTOM)
89- add_subdirectory (
90- ${CMAKE_CURRENT_SOURCE_DIR} /../../../extension/llm/custom_ops
91- ${CMAKE_CURRENT_BINARY_DIR} /../../../extension/llm/custom_ops
92- )
93- endif ()
94-
9587# llama_runner library
9688add_subdirectory (runner)
9789
@@ -119,8 +111,7 @@ target_link_options_shared_lib(quantized_ops_lib)
119111list (APPEND link_libraries quantized_kernels quantized_ops_lib)
120112
121113if (EXECUTORCH_BUILD_KERNELS_CUSTOM)
122- target_link_options_shared_lib(custom_ops)
123- list (APPEND link_libraries custom_ops)
114+ list (APPEND link_libraries $<LINK_LIBRARY:WHOLE_ARCHIVE,custom_ops>)
124115endif ()
125116
126117if (EXECUTORCH_BUILD_TORCHAO)
Original file line number Diff line number Diff line change @@ -93,14 +93,6 @@ if(CMAKE_TOOLCHAIN_IOS OR ANDROID)
9393 target_link_options_shared_lib(executorch)
9494endif ()
9595
96- # custom ops library
97- if (EXECUTORCH_BUILD_KERNELS_CUSTOM)
98- add_subdirectory (
99- ${EXECUTORCH_ROOT} /extension/llm/custom_ops
100- ${CMAKE_CURRENT_BINARY_DIR} /../../../extension/llm/custom_ops
101- )
102- endif ()
103-
10496# llava_runner library
10597add_subdirectory (runner)
10698
@@ -132,7 +124,6 @@ target_link_options_shared_lib(quantized_ops_lib)
132124list (APPEND link_libraries quantized_kernels quantized_ops_lib)
133125
134126if (EXECUTORCH_BUILD_KERNELS_CUSTOM)
135- target_link_options_shared_lib(custom_ops)
136127 list (APPEND link_libraries custom_ops)
137128endif ()
138129
Original file line number Diff line number Diff line change 44# This source code is licensed under the BSD-style license found in the
55# LICENSE file in the root directory of this source tree.
66
7- cmake_minimum_required (VERSION 3.19)
7+ cmake_minimum_required (VERSION 3.24) # 3.24 is required for WHOLE_ARCHIVE
88
99project (executorch_jni)
1010
@@ -115,12 +115,7 @@ if(TARGET vulkan_backend)
115115endif ()
116116
117117if (EXECUTORCH_BUILD_KERNELS_CUSTOM)
118- add_subdirectory (
119- ${EXECUTORCH_ROOT} /extension/llm/custom_ops
120- ${CMAKE_CURRENT_BINARY_DIR} /../../extension/llm/custom_ops
121- )
122- list (APPEND link_libraries custom_ops)
123- target_link_options_shared_lib(custom_ops)
118+ list (APPEND link_libraries $<LINK_LIBRARY:WHOLE_ARCHIVE,custom_ops>)
124119endif ()
125120
126121if (TARGET pthreadpool)
You can’t perform that action at this time.
0 commit comments