Skip to content

Commit 6c5ebd4

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 af1ab5f commit 6c5ebd4

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

kernels/quantized/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,10 @@ 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 quantized_ops_lib quantized_kernels
164+
executorch_shared
165+
)
166+
endif()

0 commit comments

Comments
 (0)