forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (40 loc) · 1.7 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
# Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
if (NOT ENABLE_HETERO)
return()
endif()
set(TARGET_NAME openvino_hetero_plugin)
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp)
ov_add_plugin(NAME ${TARGET_NAME}
DEVICE_NAME "HETERO"
PSEUDO_DEVICE
SOURCES ${SOURCES} ${HEADERS}
VERSION_DEFINES_FOR src/version.cpp
ADD_CLANG_FORMAT)
ov_build_target_faster(${TARGET_NAME}
UNITY
)
target_link_libraries(${TARGET_NAME} PRIVATE openvino::pugixml)
# must be called after all target_link_libraries
ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
if(ENABLE_TESTS)
if(BUILD_SHARED_LIBS)
set(OBJ_NAME ${TARGET_NAME}_obj)
add_library(${OBJ_NAME} OBJECT ${SOURCES} ${HEADERS})
ov_link_system_libraries(${OBJ_NAME} PUBLIC openvino::pugixml)
ov_add_version_defines(src/version.cpp ${OBJ_NAME})
target_include_directories(${OBJ_NAME}
PRIVATE
$<TARGET_PROPERTY:openvino::runtime::dev,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:openvino::itt,INTERFACE_INCLUDE_DIRECTORIES>
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
$<TARGET_PROPERTY:openvino::conditional_compilation,INTERFACE_INCLUDE_DIRECTORIES>)
ov_set_threading_interface_for(${OBJ_NAME})
target_compile_definitions(${OBJ_NAME} PRIVATE USE_STATIC_IE IMPLEMENT_OPENVINO_RUNTIME_PLUGIN)
endif()
add_subdirectory(tests)
endif()