diff --git a/src/frontends/common/shutdown_protobuf/CMakeLists.txt b/src/frontends/common/shutdown_protobuf/CMakeLists.txt index 0667bbe5b9b92c..d0c945ed45b23b 100644 --- a/src/frontends/common/shutdown_protobuf/CMakeLists.txt +++ b/src/frontends/common/shutdown_protobuf/CMakeLists.txt @@ -4,7 +4,8 @@ set(TARGET_NAME openvino_protobuf_shutdown) -add_library(${TARGET_NAME} STATIC shutdown_protobuf.cpp) +# Use OBJECT instead of STATIC to ensure DLLMain is invoked when the shared library is unloaded +add_library(${TARGET_NAME} OBJECT shutdown_protobuf.cpp) add_library(openvino::protobuf_shutdown ALIAS ${TARGET_NAME}) set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME protobuf_shutdown)