Skip to content

Commit

Permalink
Set default visibility only for ONNX (#3798)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov authored Jan 12, 2021
1 parent f6c2f3c commit ba08abb
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 27 deletions.
7 changes: 0 additions & 7 deletions ngraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,6 @@ if (WIN32)
string(REPLACE "/W3" "/W0" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()

# Compiler-specific logic...
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_VISIBILITY_PRESET default)
set(CMAKE_C_VISIBILITY_PRESET default)
set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF)
endif()

if (NOT WIN32 AND NGRAPH_WARNINGS_AS_ERRORS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif()
Expand Down
5 changes: 5 additions & 0 deletions ngraph/cmake/external_onnx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ macro(onnx_set_target_properties)
else()
target_compile_options(onnx PRIVATE -Wno-error)
endif()

set_target_properties(onnx onnx_proto PROPERTIES
CXX_VISIBILITY_PRESET default
C_VISIBILITY_PRESET default
VISIBILITY_INLINES_HIDDEN OFF)
endmacro()

FetchContent_GetProperties(ext_onnx)
Expand Down
5 changes: 0 additions & 5 deletions ngraph/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ if(COMMAND ie_add_vs_version_file)
FILEDESCRIPTION "nGraph library")
endif()

set_target_properties(ngraph PROPERTIES
CXX_VISIBILITY_PRESET hidden
C_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON)

target_link_libraries(ngraph PRIVATE openvino::conditional_compilation openvino::itt ngraph::builder ngraph::reference)

if(NGRAPH_ADDRESS_SANITIZER)
Expand Down
5 changes: 0 additions & 5 deletions ngraph/core/builder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ source_group("include" FILES ${PUBLIC_HEADERS})
# Create shared library
add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS})

set_target_properties(${TARGET_NAME} PROPERTIES
CXX_VISIBILITY_PRESET hidden
C_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON)

if(COMMAND ie_faster_build)
ie_faster_build(${TARGET_NAME}
UNITY
Expand Down
5 changes: 0 additions & 5 deletions ngraph/core/reference/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ source_group("include" FILES ${PUBLIC_HEADERS})
# Create shared library
add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS})

set_target_properties(${TARGET_NAME} PROPERTIES
CXX_VISIBILITY_PRESET hidden
C_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON)

if(COMMAND ie_faster_build)
ie_faster_build(${TARGET_NAME}
UNITY
Expand Down
5 changes: 0 additions & 5 deletions ngraph/frontend/onnx_import/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ endif()
target_link_libraries(onnx_importer PRIVATE onnx onnx_proto ${Protobuf_LIBRARIES} ngraph::builder
PUBLIC ngraph)

set_target_properties(onnx_importer PROPERTIES
CXX_VISIBILITY_PRESET hidden
C_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON)

set(ONNX_INSTALL_INCLUDE "${NGRAPH_INSTALL_INCLUDE}/ngraph/frontend")
target_include_directories(onnx_importer SYSTEM PUBLIC $<BUILD_INTERFACE:${ONNX_IMPORT_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${ONNX_INSTALL_INCLUDE}>)
Expand Down

0 comments on commit ba08abb

Please sign in to comment.