Skip to content

Commit 4360125

Browse files
tomeuvclaude
andcommitted
cmake: build shared libexecutorch_quantized_ops when EXECUTORCH_BUILD_SHARED=ON
Create a single libexecutorch_quantized_ops.so that bundles quantized_ops_lib and quantized_kernels, allowing consumers to link quantized op implementations via a shared library. quantized_ops_lib already has --whole-archive as an INTERFACE link option from Codegen.cmake, so we do not wrap it in $<LINK_LIBRARY:WHOLE_ARCHIVE,...> to avoid pulling the registration constructor in twice. Link against executorch_shared (not executorch_core) to share a single operator registry. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6bcd2b4 commit 4360125

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

kernels/quantized/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,12 @@ install(
157157
PUBLIC_HEADER
158158
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/kernels/quantized/
159159
)
160+
161+
if(EXECUTORCH_BUILD_SHARED)
162+
executorch_add_shared_library(
163+
executorch_quantized_ops
164+
quantized_ops_lib
165+
quantized_kernels
166+
executorch_shared
167+
)
168+
endif()

0 commit comments

Comments
 (0)