From ae1a915c175cb93412958e8b2b98f0bc4fb2d1b6 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 23 Sep 2024 20:33:24 +0200 Subject: [PATCH] fixed protobuf builds --- .../developer_package/compile_flags/sanitizer.cmake | 4 ++-- thirdparty/dependencies.cmake | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cmake/developer_package/compile_flags/sanitizer.cmake b/cmake/developer_package/compile_flags/sanitizer.cmake index 2fd773901c86a0..1e06dbfd4b0a42 100644 --- a/cmake/developer_package/compile_flags/sanitizer.cmake +++ b/cmake/developer_package/compile_flags/sanitizer.cmake @@ -84,8 +84,8 @@ if(ENABLE_THREAD_SANITIZER) if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") message(FATAL_ERROR "Thread sanitizer is not supported in Windows with MSVC compiler. Please, use clang-cl or mingw") elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG) - set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize=thread -fsanitize-blacklist=${OpenVINO_SOURCE_DIR}/tests/sanitizers/tsan/ignore.txt") - set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fsanitize=thread -fsanitize-blacklist=${OpenVINO_SOURCE_DIR}/tests/sanitizers/tsan/ignore.txt") + set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize=thread") + set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fsanitize=thread") else() message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}") endif() diff --git a/thirdparty/dependencies.cmake b/thirdparty/dependencies.cmake index 8313ca73178283..3455567b801a13 100644 --- a/thirdparty/dependencies.cmake +++ b/thirdparty/dependencies.cmake @@ -357,6 +357,12 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND endif() else() add_subdirectory(thirdparty/protobuf EXCLUDE_FROM_ALL) + + foreach(proto_target protoc libprotobuf) + target_compile_options(${proto_target} PUBLIC -fno-sanitize=thread) + target_link_options(${proto_target} PUBLIC -fno-sanitize=thread) + endforeach() + endif() # forward additional variables used in the other places @@ -497,7 +503,11 @@ if(ENABLE_OV_ONNX_FRONTEND) # conan and vcpkg create imported targets 'onnx' and 'onnx_proto' else() add_subdirectory(thirdparty/onnx) - endif() + foreach(onnx_target onnx onnx_proto) + target_compile_options(${onnx_target} PUBLIC -fno-sanitize=thread) + target_link_options(${onnx_target} PUBLIC -fno-sanitize=thread) + endforeach() + endif() endif() #