forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
96 lines (78 loc) · 2.88 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
set(TARGET_NAME ov_core_unit_tests)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF)
ov_try_use_gold_linker()
add_definitions(-DSERIALIZED_ZOO=\"${TEST_MODEL_ZOO}/core/models\")
if(NOT ENABLE_OV_CORE_UNIT_TESTS)
message(STATUS "OpenVINO Core unit tests disabled")
return()
endif()
message(STATUS "OpenVINO Core unit tests enabled")
if(LINUX)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
endif()
# For type relaxed types
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/threading.cpp
PROPERTIES INCLUDE_DIRECTORIES $<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>)
if(SUGGEST_OVERRIDE_SUPPORTED)
set_source_files_properties(ov_tensor_test.cpp
type_prop/multiclass_nms.cpp
PROPERTIES COMPILE_OPTIONS -Wno-suggest-override)
endif()
list(APPEND UNIT_TESTS_DEPENDENCIES openvino_template_extension)
list(APPEND UNIT_TESTS_DEPENDENCIES template_extension)
list(APPEND EXCLUDE_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/frontend
${CMAKE_CURRENT_SOURCE_DIR}/dnnl.cpp)
if (ENABLE_TEMPLATE)
list(APPEND UNIT_TESTS_DEPENDENCIES openvino_template_plugin)
else()
list(APPEND EXCLUDE_TESTS
# It should be a part of template plugin
${CMAKE_CURRENT_SOURCE_DIR}/op_eval/memory.cpp)
endif()
ov_add_test_target(
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
EXCLUDED_SOURCE_PATHS
${EXCLUDE_TESTS}
DEPENDENCIES
${UNIT_TESTS_DEPENDENCIES}
# process models
test_model_zoo
LINK_LIBRARIES
engines_test_util
commonTestUtils
ngraph_reference
ngraph::builder
openvino::util
ov_shape_inference
${CMAKE_DL_LIBS}
Threads::Threads
openvino::conditional_compilation
openvino::runtime::dev
ADD_CLANG_FORMAT
LABELS
OV
IE
CORE
)
get_target_property(OV_CORE_SRC_DIR ngraph_obj SOURCE_DIR)
target_include_directories(${TARGET_NAME} PRIVATE ${OV_CORE_SRC_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(${TARGET_NAME}
PRIVATE
SHARED_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}"
SHARED_LIB_SUFFIX="${IE_BUILD_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}")
add_dependencies(${TARGET_NAME} ${UNIT_TESTS_DEPENDENCIES})
if (ENABLE_OV_ONNX_FRONTEND)
target_compile_definitions(${TARGET_NAME} PRIVATE ENABLE_OV_ONNX_FRONTEND)
endif()
if (OV_COMPILER_IS_CLANG)
target_compile_options(${TARGET_NAME} PRIVATE -Wno-undef -Wno-reserved-id-macro)
endif()
if(ENABLE_OV_IR_FRONTEND)
add_dependencies(${TARGET_NAME} openvino_ir_frontend)
endif()
add_subdirectory(frontend)