Skip to content

Commit

Permalink
FrontEnds.cmake: FEM include headers as public (openvinotoolkit#9792)
Browse files Browse the repository at this point in the history
ONNX/Paddle/TF frontends: added 'standalone_build' target to verify that frontends can be used standalone by applications
  • Loading branch information
nosovmik authored Jan 21, 2022
1 parent 101e762 commit d8e557b
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmake/developer_package/frontends/frontends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ macro(ov_add_frontend)

ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})

target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime ${OV_FRONTEND_LINK_LIBRARIES})
target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime)
target_link_libraries(${TARGET_NAME} PRIVATE ${OV_FRONTEND_LINK_LIBRARIES})

# WA for TF frontends which always requires protobuf (not protobuf-lite)
# if TF FE is built in static mode, use protobuf for all other FEs
Expand Down
4 changes: 4 additions & 0 deletions src/core/tests/frontend/onnx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
set(TARGET_NAME "onnx_frontend_tests")

file(GLOB_RECURSE SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
list(FILTER SRC EXCLUDE REGEX standalone_build)

add_executable(${TARGET_NAME} ${SRC})

Expand All @@ -24,3 +25,6 @@ target_compile_definitions(${TARGET_NAME} PRIVATE -D MANIFEST=\"${MANIFEST}\")

add_dependencies(${TARGET_NAME} ov_onnx_frontend)
add_dependencies(${TARGET_NAME} test_model_zoo)

add_subdirectory(standalone_build)
add_dependencies(${TARGET_NAME} onnx_fe_standalone_build_test)
13 changes: 13 additions & 0 deletions src/core/tests/frontend/onnx/standalone_build/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
set(TARGET_NAME "onnx_fe_standalone_build_test")

add_library(${TARGET_NAME} STATIC standalone_build_test.cpp)

# This test verifies that application can link to ONNX frontend only
# Other dependencies on core header files will be resolved automatically
target_link_libraries(${TARGET_NAME} PUBLIC openvino::frontend::onnx)

# Enable code style check
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (C) 2018-2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <openvino/frontend/onnx/frontend.hpp>

void test_load() {
ov::frontend::onnx::FrontEnd fe;
fe.get_name();
}
4 changes: 4 additions & 0 deletions src/core/tests/frontend/paddle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
set(TARGET_NAME "paddle_tests")

file(GLOB_RECURSE SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
list(FILTER SRC EXCLUDE REGEX standalone_build)

add_executable(${TARGET_NAME} ${SRC})

Expand Down Expand Up @@ -61,3 +62,6 @@ add_dependencies(${TARGET_NAME} ov_paddle_frontend)
if (ENABLE_INTEL_CPU)
add_dependencies(${TARGET_NAME} ov_intel_cpu_plugin)
endif()

add_subdirectory(standalone_build)
add_dependencies(${TARGET_NAME} paddle_fe_standalone_build_test)
13 changes: 13 additions & 0 deletions src/core/tests/frontend/paddle/standalone_build/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
set(TARGET_NAME "paddle_fe_standalone_build_test")

add_library(${TARGET_NAME} STATIC standalone_build_test.cpp)

# This test verifies that application can link to Paddle frontend only
# Other dependencies on core header files will be resolved automatically
target_link_libraries(${TARGET_NAME} PUBLIC openvino::frontend::paddle)

# Enable code style check
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (C) 2018-2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <openvino/frontend/paddle/frontend.hpp>

void test_load() {
ov::frontend::paddle::FrontEnd fe;
fe.get_name();
}
4 changes: 4 additions & 0 deletions src/core/tests/frontend/tensorflow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
set(TARGET_NAME "tensorflow_tests")

file(GLOB_RECURSE SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
list(FILTER SRC EXCLUDE REGEX standalone_build)

add_executable(${TARGET_NAME} ${SRC})

Expand Down Expand Up @@ -67,3 +68,6 @@ add_dependencies(${TARGET_NAME} ov_tensorflow_frontend)

get_target_property(TENSORFLOW_FRONTEND_SRC_DIR ov_tensorflow_frontend SOURCE_DIR)
target_include_directories(${TARGET_NAME} PRIVATE ${TENSORFLOW_FRONTEND_SRC_DIR}/src/pass/)

add_subdirectory(standalone_build)
add_dependencies(${TARGET_NAME} tensorflow_fe_standalone_build_test)
13 changes: 13 additions & 0 deletions src/core/tests/frontend/tensorflow/standalone_build/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
set(TARGET_NAME "tensorflow_fe_standalone_build_test")

add_library(${TARGET_NAME} STATIC standalone_build_test.cpp)

# This test verifies that application can link to TensorFlow frontend only
# Other dependencies on core header files will be resolved automatically
target_link_libraries(${TARGET_NAME} PUBLIC ov_tensorflow_frontend)

# Enable code style check
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (C) 2018-2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <openvino/frontend/tensorflow/frontend.hpp>

void test_load() {
ov::frontend::tensorflow::FrontEnd fe;
fe.get_name();
}

0 comments on commit d8e557b

Please sign in to comment.