From 02530c270fd0d556583318fcbfd2367fe9ae467c Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 6 Dec 2023 22:02:06 +0800 Subject: [PATCH] Fixed build: attemp 2 --- cmake/developer_package/frontends/frontends.cmake | 3 ++- src/core/tests/frontend/CMakeLists.txt | 2 +- src/frontends/common/CMakeLists.txt | 9 +++++---- .../common/include/openvino/frontend/visibility.hpp | 6 +++--- src/plugins/intel_cpu/tests/unit/CMakeLists.txt | 1 + 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake index 6517901c12a7e3..fada615c843ec9 100644 --- a/cmake/developer_package/frontends/frontends.cmake +++ b/cmake/developer_package/frontends/frontends.cmake @@ -220,13 +220,14 @@ macro(ov_add_frontend) PUBLIC $ PRIVATE + $ ${frontend_root_dir}/src ${CMAKE_CURRENT_BINARY_DIR}) ov_add_vs_version_file(NAME ${TARGET_NAME} FILEDESCRIPTION ${OV_FRONTEND_FILEDESCRIPTION}) - target_link_libraries(${TARGET_NAME} PRIVATE ${OV_FRONTEND_LINK_LIBRARIES} openvino::frontend::common PUBLIC openvino::runtime) + target_link_libraries(${TARGET_NAME} PRIVATE ${OV_FRONTEND_LINK_LIBRARIES} PUBLIC openvino::runtime) ov_add_library_version(${TARGET_NAME}) if(OV_FRONTEND_PROTOBUF_REQUIRED) diff --git a/src/core/tests/frontend/CMakeLists.txt b/src/core/tests/frontend/CMakeLists.txt index 16dcbaacf7fbc6..a03ed97cac9ca9 100644 --- a/src/core/tests/frontend/CMakeLists.txt +++ b/src/core/tests/frontend/CMakeLists.txt @@ -12,7 +12,7 @@ target_compile_definitions(${MOCK1_FE_NAME} PRIVATE "-DMOCK_VARIANT=\"1\"") target_include_directories(${MOCK1_FE_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(${MOCK1_FE_NAME} PRIVATE openvino_frontend_common) +target_link_libraries(${MOCK1_FE_NAME} PRIVATE openvino::frontend::common) add_dependencies(ov_core_unit_tests ${MOCK1_FE_NAME}) ov_add_clang_format_target(${MOCK1_FE_NAME}_clang FOR_TARGETS ${MOCK1_FE_NAME}) diff --git a/src/frontends/common/CMakeLists.txt b/src/frontends/common/CMakeLists.txt index 73e13b956fa3b4..53f52bdc258af7 100644 --- a/src/frontends/common/CMakeLists.txt +++ b/src/frontends/common/CMakeLists.txt @@ -21,8 +21,9 @@ add_library(${TARGET_NAME} INTERFACE) target_include_directories(${TARGET_NAME} INTERFACE $ - $ - $) + $) + +target_link_libraries(${TARGET_NAME} INTERFACE openvino::runtime) add_library(openvino::frontend::common ALIAS ${TARGET_NAME}) @@ -37,7 +38,7 @@ target_include_directories(${TARGET_NAME}_obj $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src - $ + $ # for ov_frontends.hpp in static build ${CMAKE_CURRENT_BINARY_DIR}/src) @@ -47,7 +48,7 @@ if(NOT BUILD_SHARED_LIBS) target_compile_definitions(${TARGET_NAME}_obj PUBLIC OPENVINO_STATIC_LIBRARY) endif() -target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::util openvino::core::dev openvino::frontend::common) +target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::util openvino::core::dev) # TODO: fix lto set_target_properties(${TARGET_NAME}_obj PROPERTIES diff --git a/src/frontends/common/include/openvino/frontend/visibility.hpp b/src/frontends/common/include/openvino/frontend/visibility.hpp index 4e07f3cedbbc17..ddc2d7eb6898e7 100644 --- a/src/frontends/common/include/openvino/frontend/visibility.hpp +++ b/src/frontends/common/include/openvino/frontend/visibility.hpp @@ -9,7 +9,7 @@ // Increment each time when FrontEnd/InputModel/Place interface is changed #define OV_FRONTEND_API_VERSION 1 -#if defined(USE_STATIC_FRONTEND_COMMON) || defined(OPENVINO_STATIC_LIBRARY) +#if defined(OPENVINO_STATIC_LIBRARY) # define FRONTEND_API # define FRONTEND_C_API #else @@ -20,5 +20,5 @@ # else # define FRONTEND_API OPENVINO_CORE_IMPORTS # define FRONTEND_C_API OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS -# endif // frontend_common_EXPORTS -#endif // USE_STATIC_FRONTEND_COMMON || OPENVINO_STATIC_LIBRARY +# endif // openvino_frontend_common_EXPORTS +#endif // OPENVINO_STATIC_LIBRARY diff --git a/src/plugins/intel_cpu/tests/unit/CMakeLists.txt b/src/plugins/intel_cpu/tests/unit/CMakeLists.txt index be9c4a1c5da408..f04ab5a7dd39ab 100644 --- a/src/plugins/intel_cpu/tests/unit/CMakeLists.txt +++ b/src/plugins/intel_cpu/tests/unit/CMakeLists.txt @@ -57,6 +57,7 @@ ov_add_test_target( inference_engine_lp_transformations openvino::shape_inference inference_engine_s + openvino_frontend_common_obj unit_test_utils ov_models ov_snippets_models