Skip to content

Commit

Permalink
Added apiValidator checks for frontends (#8655)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Nov 17, 2021
1 parent 83b8099 commit df30694
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 85 deletions.
19 changes: 6 additions & 13 deletions ngraph/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,14 @@ source_group("include" FILES ${PUBLIC_HEADERS})
add_library(ngraph ${LIBRARY_SRC} ${PUBLIC_HEADERS} ${IE_SHARED_SRCS})


if(COMMAND ie_faster_build)
ie_faster_build(ngraph
UNITY
PCH PRIVATE "src/precomp.hpp"
)
endif()
ie_faster_build(ngraph
UNITY
PCH PRIVATE "src/precomp.hpp")

if(COMMAND ie_add_api_validator_post_build_step)
ie_add_api_validator_post_build_step(TARGET ngraph)
endif()
ie_add_api_validator_post_build_step(TARGET ngraph)

if(COMMAND ie_add_vs_version_file)
ie_add_vs_version_file(NAME ngraph
FILEDESCRIPTION "nGraph library")
endif()
ie_add_vs_version_file(NAME ngraph
FILEDESCRIPTION "nGraph library")

addVersionDefines(src/version.cpp CI_BUILD_NUMBER)

Expand Down
9 changes: 3 additions & 6 deletions ngraph/core/builder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ source_group("include" FILES ${PUBLIC_HEADERS})
# Create static library
add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS})

if(COMMAND ie_faster_build)
ie_faster_build(${TARGET_NAME}
UNITY
PCH PRIVATE "src/precomp.hpp"
)
endif()
ie_faster_build(${TARGET_NAME}
UNITY
PCH PRIVATE "src/precomp.hpp")

target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${BUILDER_INCLUDE_DIR}>
Expand Down
9 changes: 3 additions & 6 deletions ngraph/core/reference/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ source_group("include" FILES ${PUBLIC_HEADERS})
# Create static library
add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS})

if(COMMAND ie_faster_build)
ie_faster_build(${TARGET_NAME}
UNITY
PCH PRIVATE "src/precomp.hpp"
)
endif()
ie_faster_build(${TARGET_NAME}
UNITY
PCH PRIVATE "src/precomp.hpp")

if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(${TARGET_NAME} PUBLIC /wd4146)
Expand Down
7 changes: 3 additions & 4 deletions ngraph/frontend/frontend_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
ADDITIONAL_INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>)

if(COMMAND ie_add_vs_version_file)
ie_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION "Manager of OpenVINO nGraph Frontends")
endif()
ie_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION "Manager of OpenVINO Frontends")
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})

# create static library if needed

Expand Down
8 changes: 4 additions & 4 deletions ngraph/frontend/ir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ target_include_directories(${TARGET_NAME}

target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR})

if(COMMAND ie_add_vs_version_file)
ie_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION "FrontEnd to load and convert IR file format")
endif()
ie_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION "FrontEnd to load and convert OpenVINO IR file format")

ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})

target_link_libraries(${TARGET_NAME} PRIVATE frontend_manager::static
ngraph::builder inference_engine_transformations
Expand Down
8 changes: 4 additions & 4 deletions ngraph/frontend/onnx/frontend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
ADDITIONAL_INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:frontend_manager::static,INTERFACE_INCLUDE_DIRECTORIES>)

if(COMMAND ie_add_vs_version_file)
ie_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION "nGraph ONNX frontend library")
endif()
ie_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION "nGraph ONNX frontend library")

ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})

target_link_libraries(${TARGET_NAME} PUBLIC ngraph PRIVATE frontend_manager ngraph::builder openvino::util onnx_common inference_engine_transformations)

Expand Down
8 changes: 4 additions & 4 deletions ngraph/frontend/paddlepaddle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ target_include_directories(${TARGET_NAME}
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${Protobuf_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR})

if(COMMAND ie_add_vs_version_file)
ie_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION "FrontEnd to load and convert PaddlePaddle file format")
endif()
ie_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION "FrontEnd to load and convert PaddlePaddle file format")

ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})

link_system_libraries(${TARGET_NAME} PRIVATE ${Protobuf_LITE_LIBRARIES})

Expand Down
8 changes: 4 additions & 4 deletions ngraph/frontend/tensorflow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ target_include_directories(${TARGET_NAME}
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${Protobuf_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR})

if(COMMAND ie_add_vs_version_file)
ie_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION "FrontEnd to load and convert TensorFlow file format")
endif()
ie_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION "FrontEnd to load and convert TensorFlow file format")

ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})

link_system_libraries(${TARGET_NAME} PRIVATE ${Protobuf_LITE_LIBRARIES})

Expand Down
4 changes: 1 addition & 3 deletions ngraph/test/engines_util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ file(GLOB_RECURSE ENGINES_UTIL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_

add_library(engines_test_util STATIC ${ENGINES_UTIL_SRC})

if(COMMAND ie_faster_build)
ie_faster_build(engines_test_util UNITY)
endif()
ie_faster_build(engines_test_util UNITY)

target_include_directories(engines_test_util PRIVATE $<TARGET_PROPERTY:inference_engine,INTERFACE_INCLUDE_DIRECTORIES>)
target_link_libraries(engines_test_util PUBLIC ngraph ngraph_backend inference_engine gtest gmock ngraph_test_util)
Expand Down
4 changes: 1 addition & 3 deletions ngraph/test/onnx_test_util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ file(GLOB_RECURSE ONNX_UTIL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CUR

add_library(onnx_test_util STATIC ${ONNX_UTIL_SRC})

if(COMMAND ie_faster_build)
ie_faster_build(onnx_test_util UNITY)
endif()
ie_faster_build(onnx_test_util UNITY)

target_link_libraries(onnx_test_util PRIVATE onnx_common)
target_include_directories(onnx_test_util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down
14 changes: 5 additions & 9 deletions ngraph/test/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ set (SRC

add_library(ngraph_backend SHARED ${SRC})

if(COMMAND ie_faster_build)
ie_faster_build(ngraph_backend
UNITY
)
endif()
ie_faster_build(ngraph_backend UNITY)

if(COMMAND ie_add_vs_version_file)
ie_add_vs_version_file(NAME ngraph_backend
FILEDESCRIPTION "nGraph backend library")
endif()
ie_add_vs_version_file(NAME ngraph_backend
FILEDESCRIPTION "nGraph backend library")

ie_add_api_validator_post_build_step(TARGET ngraph_backend)

target_compile_definitions(ngraph_backend
PRIVATE
Expand Down
14 changes: 5 additions & 9 deletions ngraph/test/runtime/ie/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ set(SRC

add_library(ie_backend SHARED ${SRC})

if(COMMAND ie_faster_build)
ie_faster_build(ie_backend
UNITY
)
endif()
ie_faster_build(ie_backend UNITY)

if(COMMAND ie_add_vs_version_file)
ie_add_vs_version_file(NAME ie_backend
FILEDESCRIPTION "nGraph IE backend library")
endif()
ie_add_vs_version_file(NAME ie_backend
FILEDESCRIPTION "nGraph IE backend library")

ie_add_api_validator_post_build_step(TARGET ie_backend)

add_dependencies(ie_backend inference_engine)
target_link_libraries(ie_backend PUBLIC ngraph_backend inference_engine)
Expand Down
17 changes: 4 additions & 13 deletions ngraph/test/runtime/interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,12 @@

add_library(interpreter_backend SHARED int_backend.cpp int_executable.cpp evaluates_map.cpp)

if(COMMAND ie_faster_build)
ie_faster_build(interpreter_backend
UNITY
)
endif()
ie_faster_build(interpreter_backend UNITY)

if(COMMAND ie_add_vs_version_file)
ie_add_vs_version_file(NAME interpreter_backend
FILEDESCRIPTION "nGraph interpreter backend library")
endif()
ie_add_vs_version_file(NAME interpreter_backend
FILEDESCRIPTION "nGraph interpreter backend library")

if(COMMAND ie_add_vs_version_file)
ie_add_vs_version_file(NAME interpreter_backend
FILEDESCRIPTION "nGraph interpreter backend library")
endif()
ie_add_api_validator_post_build_step(TARGET interpreter_backend)

target_compile_definitions(interpreter_backend PRIVATE INTERPRETER_BACKEND_EXPORTS)
target_link_libraries(interpreter_backend PUBLIC ngraph_backend PRIVATE ngraph_reference)
Expand Down
4 changes: 1 addition & 3 deletions ngraph/test/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ file(GLOB_RECURSE UTIL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_

add_library(ngraph_test_util STATIC ${UTIL_SRC})

if(COMMAND ie_faster_build)
ie_faster_build(ngraph_test_util UNITY)
endif()
ie_faster_build(ngraph_test_util UNITY)

target_link_libraries(ngraph_test_util PUBLIC ngraph gtest gmock)
target_include_directories(ngraph_test_util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down

0 comments on commit df30694

Please sign in to comment.