From 6265cea0bf0ab369ae7fef13464f4320a47367c7 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 17 Nov 2021 23:19:15 +0300 Subject: [PATCH] Added apiValidator checks for frontends (#8655) --- ngraph/core/CMakeLists.txt | 19 ++++++------------- ngraph/core/builder/CMakeLists.txt | 9 +++------ ngraph/core/reference/CMakeLists.txt | 9 +++------ .../frontend/frontend_manager/CMakeLists.txt | 7 +++---- ngraph/frontend/ir/CMakeLists.txt | 8 ++++---- ngraph/frontend/onnx/frontend/CMakeLists.txt | 8 ++++---- ngraph/frontend/paddlepaddle/CMakeLists.txt | 8 ++++---- ngraph/frontend/tensorflow/CMakeLists.txt | 8 ++++---- ngraph/test/engines_util/CMakeLists.txt | 4 +--- ngraph/test/onnx_test_util/CMakeLists.txt | 4 +--- ngraph/test/runtime/CMakeLists.txt | 14 +++++--------- ngraph/test/runtime/ie/CMakeLists.txt | 14 +++++--------- .../test/runtime/interpreter/CMakeLists.txt | 17 ++++------------- ngraph/test/util/CMakeLists.txt | 4 +--- 14 files changed, 48 insertions(+), 85 deletions(-) diff --git a/ngraph/core/CMakeLists.txt b/ngraph/core/CMakeLists.txt index 0caa99e50c076a..3d566271bbecda 100644 --- a/ngraph/core/CMakeLists.txt +++ b/ngraph/core/CMakeLists.txt @@ -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) diff --git a/ngraph/core/builder/CMakeLists.txt b/ngraph/core/builder/CMakeLists.txt index b6c2fb0c0cc45d..118a0e79053d76 100644 --- a/ngraph/core/builder/CMakeLists.txt +++ b/ngraph/core/builder/CMakeLists.txt @@ -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 $ diff --git a/ngraph/core/reference/CMakeLists.txt b/ngraph/core/reference/CMakeLists.txt index e7b1d1bb20bb3f..860e7124787ff2 100644 --- a/ngraph/core/reference/CMakeLists.txt +++ b/ngraph/core/reference/CMakeLists.txt @@ -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) diff --git a/ngraph/frontend/frontend_manager/CMakeLists.txt b/ngraph/frontend/frontend_manager/CMakeLists.txt index cadaefceb59a74..7a1d64f7ba48ca 100644 --- a/ngraph/frontend/frontend_manager/CMakeLists.txt +++ b/ngraph/frontend/frontend_manager/CMakeLists.txt @@ -41,10 +41,9 @@ ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME} ADDITIONAL_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 diff --git a/ngraph/frontend/ir/CMakeLists.txt b/ngraph/frontend/ir/CMakeLists.txt index 922cc0bc2cdd2b..bb78ac8b83dbc9 100644 --- a/ngraph/frontend/ir/CMakeLists.txt +++ b/ngraph/frontend/ir/CMakeLists.txt @@ -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 diff --git a/ngraph/frontend/onnx/frontend/CMakeLists.txt b/ngraph/frontend/onnx/frontend/CMakeLists.txt index a1aabaccecd6c3..e51a8edf43111a 100644 --- a/ngraph/frontend/onnx/frontend/CMakeLists.txt +++ b/ngraph/frontend/onnx/frontend/CMakeLists.txt @@ -39,10 +39,10 @@ ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME} ADDITIONAL_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) diff --git a/ngraph/frontend/paddlepaddle/CMakeLists.txt b/ngraph/frontend/paddlepaddle/CMakeLists.txt index 421a65e53354a0..8fd750d58994cd 100644 --- a/ngraph/frontend/paddlepaddle/CMakeLists.txt +++ b/ngraph/frontend/paddlepaddle/CMakeLists.txt @@ -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}) diff --git a/ngraph/frontend/tensorflow/CMakeLists.txt b/ngraph/frontend/tensorflow/CMakeLists.txt index 28aacbfaf413c8..36b23ee2768ca7 100644 --- a/ngraph/frontend/tensorflow/CMakeLists.txt +++ b/ngraph/frontend/tensorflow/CMakeLists.txt @@ -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}) diff --git a/ngraph/test/engines_util/CMakeLists.txt b/ngraph/test/engines_util/CMakeLists.txt index 4f39565c210d23..4490b5aa259266 100644 --- a/ngraph/test/engines_util/CMakeLists.txt +++ b/ngraph/test/engines_util/CMakeLists.txt @@ -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_link_libraries(engines_test_util PUBLIC ngraph ngraph_backend inference_engine gtest gmock ngraph_test_util) diff --git a/ngraph/test/onnx_test_util/CMakeLists.txt b/ngraph/test/onnx_test_util/CMakeLists.txt index 4c8195f8b1eccd..f3711f7f3c6567 100644 --- a/ngraph/test/onnx_test_util/CMakeLists.txt +++ b/ngraph/test/onnx_test_util/CMakeLists.txt @@ -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}) diff --git a/ngraph/test/runtime/CMakeLists.txt b/ngraph/test/runtime/CMakeLists.txt index 3d26cd6b42535f..27bdecb40976b7 100644 --- a/ngraph/test/runtime/CMakeLists.txt +++ b/ngraph/test/runtime/CMakeLists.txt @@ -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 diff --git a/ngraph/test/runtime/ie/CMakeLists.txt b/ngraph/test/runtime/ie/CMakeLists.txt index fe0e79eab83c01..b46a608b6eb898 100644 --- a/ngraph/test/runtime/ie/CMakeLists.txt +++ b/ngraph/test/runtime/ie/CMakeLists.txt @@ -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) diff --git a/ngraph/test/runtime/interpreter/CMakeLists.txt b/ngraph/test/runtime/interpreter/CMakeLists.txt index dc39db0fc28ff0..492e205fc8c4b0 100644 --- a/ngraph/test/runtime/interpreter/CMakeLists.txt +++ b/ngraph/test/runtime/interpreter/CMakeLists.txt @@ -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) diff --git a/ngraph/test/util/CMakeLists.txt b/ngraph/test/util/CMakeLists.txt index 2c3ad2fe390662..de974ca2d72c0b 100644 --- a/ngraph/test/util/CMakeLists.txt +++ b/ngraph/test/util/CMakeLists.txt @@ -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})