Don't install nlohmann_json_schema_validator for samples (#11446)
* Try to improve gflags * Try to improve gflags: part 2 * Tried to use dependencies on system * Use nlohmann_jsonConfig from system * Enabled nlohmann_json from system * Improvements * handle system gflags in developer package * Simplifications * Simplify dependency management * Corrected package names * Fixed subgraphsDumper configure stage * Try to fix rhel8 * Try to fix macosx * Fixed VPUX build * Fixed aliasing issues * Suppress some wanrings * export gflags when build it * Fixed some LTO * Try to fix Mac * revert * use gflags as private dependency * Aligned targets in developer package * Fixed frontends tests build on U20 with LTO * PAssed * Don't use pkg_search_module(zlib ..) during cross-compilation * Removed unused variables * Fixed finding of zlib during cross-compilation * CVS-83529 * Use nothreads_static * Fixed python
This commit is contained in:
@@ -113,7 +113,10 @@ endif()
|
||||
####################################
|
||||
|
||||
if(NOT TARGET gflags)
|
||||
find_package(gflags QUIET COMPONENTS nothreads_shared)
|
||||
if(NOT APPLE)
|
||||
# on Apple only dynamic libraries are available
|
||||
find_package(gflags QUIET COMPONENTS nothreads_static)
|
||||
endif()
|
||||
|
||||
if(gflags_FOUND)
|
||||
message(STATUS "gflags (${gflags_VERSION}) is found at ${gflags_DIR}")
|
||||
@@ -151,8 +154,10 @@ if(NOT TARGET nlohmann_json::nlohmann_json)
|
||||
find_package(nlohmann_json QUIET)
|
||||
if(nlohmann_json_FOUND)
|
||||
message(STATUS "nlohmann_json (${nlohmann_json_VERSION}) is found at ${nlohmann_json_DIR}")
|
||||
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/json")
|
||||
add_subdirectory(thirdparty/json EXCLUDE_FROM_ALL)
|
||||
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/nlohmann_json")
|
||||
# suppress shadowing names warning
|
||||
set(JSON_SystemInclude ON CACHE BOOL "" FORCE)
|
||||
add_subdirectory(thirdparty/nlohmann_json EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -18,9 +18,14 @@ set(LIBRARY_OUTPUT_DIRECTORY_BIN ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
set(PYTHON_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
set(PYTHON_BINDINGS_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# Remove this condition as 76672 will be fixed
|
||||
if (CMAKE_CROSSCOMPILING AND DEFINED ENV{OE_CMAKE_TOOLCHAIN_FILE})
|
||||
# TODO: Remove this condition as 76672 will be fixed
|
||||
if(CMAKE_CROSSCOMPILING AND DEFINED ENV{OE_CMAKE_TOOLCHAIN_FILE})
|
||||
set(DISABLE_PYOPENVINO ON)
|
||||
endif()
|
||||
|
||||
if(DISABLE_PYOPENVINO)
|
||||
add_subdirectory(src/compatibility/openvino)
|
||||
message(WARNING "NOTE: Python API for OpenVINO 2.0 is disabled")
|
||||
else()
|
||||
add_subdirectory(src/compatibility/openvino)
|
||||
|
||||
@@ -34,7 +39,7 @@ if(ENABLE_WHEEL)
|
||||
add_subdirectory(wheel)
|
||||
endif()
|
||||
|
||||
if(ENABLE_OV_CORE_UNIT_TESTS)
|
||||
if(ENABLE_OV_CORE_UNIT_TESTS AND NOT DISABLE_PYOPENVINO)
|
||||
add_subdirectory(tests/mock/mock_py_frontend)
|
||||
add_dependencies(pyopenvino openvino_mock_py_frontend)
|
||||
set_target_properties(openvino_mock_py_frontend PROPERTIES
|
||||
@@ -42,7 +47,6 @@ if(ENABLE_OV_CORE_UNIT_TESTS)
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_DIRECTORY_BIN}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_DIRECTORY_BIN}
|
||||
PDB_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_DIRECTORY_BIN})
|
||||
|
||||
add_subdirectory(tests/mock/pyngraph_fe_mock_api)
|
||||
add_dependencies(pyopenvino pybind_mock_frontend)
|
||||
endif()
|
||||
|
||||
@@ -697,7 +697,7 @@ TEST_P(OVClassGetMetricTest_RANGE_FOR_ASYNC_INFER_REQUESTS, GetMetricAndPrintNoT
|
||||
|
||||
TEST_P(OVClassGetMetricTest_RANGE_FOR_STREAMS, GetMetricAndPrintNoThrow) {
|
||||
ov::Core ie = createCoreWithTemplate();
|
||||
unsigned int start, end;
|
||||
unsigned int start = 0, end = 0;
|
||||
|
||||
ASSERT_NO_THROW(std::tie(start, end) = ie.get_property(deviceName, ov::range_for_streams));
|
||||
|
||||
|
||||
10
thirdparty/CMakeLists.txt
vendored
10
thirdparty/CMakeLists.txt
vendored
@@ -84,7 +84,11 @@ ov_install_static_lib(fluid openvino_common)
|
||||
# Gflags
|
||||
#
|
||||
|
||||
find_package(gflags QUIET COMPONENTS nothreads_shared)
|
||||
if(NOT APPLE)
|
||||
# on Apple only dynamic libraries are available
|
||||
find_package(gflags QUIET COMPONENTS nothreads_static)
|
||||
endif()
|
||||
|
||||
if(gflags_FOUND)
|
||||
set_target_properties(gflags PROPERTIES IMPORTED_GLOBAL ON)
|
||||
message(STATUS "gflags (${gflags_VERSION}) is found at ${gflags_DIR}")
|
||||
@@ -175,7 +179,7 @@ if(CPACK_GENERATOR STREQUAL "DEB")
|
||||
# These libraries are dependencies for openvino-samples-2022.1 package
|
||||
|
||||
if(NOT gflags_FOUND)
|
||||
message(FATAL_ERROR "gflags must be used as a debian package. Install libflags-dev")
|
||||
message(FATAL_ERROR "gflags must be used as a debian package. Install libgflags-dev")
|
||||
endif()
|
||||
if(NOT zlib_FOUND)
|
||||
message(FATAL_ERROR "zlib must be used as a debian package. Install zlib1g-dev")
|
||||
@@ -191,7 +195,7 @@ else()
|
||||
COMPONENT cpp_samples
|
||||
USE_SOURCE_PERMISSIONS)
|
||||
|
||||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/json
|
||||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/json/nlohmann_json
|
||||
DESTINATION "samples/cpp/thirdparty"
|
||||
COMPONENT cpp_samples
|
||||
USE_SOURCE_PERMISSIONS)
|
||||
|
||||
4
thirdparty/json/CMakeLists.txt
vendored
4
thirdparty/json/CMakeLists.txt
vendored
@@ -4,10 +4,10 @@
|
||||
|
||||
# suppress shadowing names warning
|
||||
set(JSON_SystemInclude ON CACHE BOOL "" FORCE)
|
||||
# disabled due to compiler issues
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF)
|
||||
add_subdirectory(nlohmann_json EXCLUDE_FROM_ALL)
|
||||
|
||||
# disabled due to compiler issues
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
set(JSON_VALIDATOR_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(JSON_VALIDATOR_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
|
||||
Reference in New Issue
Block a user