Skip to content

Commit

Permalink
fixed protobuf builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mryzhov committed Sep 23, 2024
1 parent d05eaf7 commit ae1a915
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmake/developer_package/compile_flags/sanitizer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 11 additions & 1 deletion thirdparty/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

#
Expand Down

0 comments on commit ae1a915

Please sign in to comment.