diff --git a/CMakeLists.txt b/CMakeLists.txt index e963f0aaadd..11877902b23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -562,6 +562,11 @@ if(EXECUTORCH_BUILD_PYBIND) list(APPEND _dep_libs custom_ops) endif() + if(EXECUTORCH_BUILD_QUANTIZED) + target_link_options_shared_lib(quantized_ops_lib) + list(APPEND _dep_libs quantized_kernels quantized_ops_lib) + endif() + # TODO(larryliu): Fix macOS 2 dylibs having 2 sets of static variables issue if(EXECUTORCH_BUILD_CUSTOM_OPS_AOT AND NOT APPLE) list(APPEND _dep_libs custom_ops_aot_lib) diff --git a/setup.py b/setup.py index 09d1a3a64ef..65f72a03519 100644 --- a/setup.py +++ b/setup.py @@ -376,6 +376,7 @@ def run(self): if ShouldBuild.pybindings: cmake_args += [ "-DEXECUTORCH_BUILD_PYBIND=ON", + "-DEXECUTORCH_BUILD_QUANTIZED=ON", # add quantized ops to pybindings. ] build_args += ["--target", "portable_lib"] if ShouldBuild.xnnpack: