It uses CMake 3.16 built-in utilities to speed up build time: * Unity builds * Precompiled headers The feature is controlled via `ENABLE_FASTER_BUILD` CMake option (disabled by default). The option avaialble only on CMake >= 3.16. The feature is enabled per-target via `ie_faster_build` function. Some observations: * Don't have actual numbers for compile time, but subjectively can see speed up locally with VS 2019. * Unity builds gives much more effect, but has some restriction on source files, so are not used everywhere.
51 lines
1.1 KiB
CMake
51 lines
1.1 KiB
CMake
# Copyright (C) 2019 Intel Corporation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
set(TARGET_NAME funcSharedTests)
|
|
|
|
list(APPEND EXPORT_DEPENDENCIES
|
|
funcTestUtils
|
|
ngraphFunctions
|
|
)
|
|
|
|
set(PUBLIC_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
|
|
|
addIeTarget(
|
|
NAME ${TARGET_NAME}
|
|
TYPE STATIC
|
|
ROOT ${PUBLIC_HEADERS_DIR}
|
|
ADDITIONAL_SOURCE_DIRS
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
ADD_CPPLINT
|
|
DEVELOPER_PACKAGE
|
|
DEPENDENCIES
|
|
mock_engine
|
|
HeteroPlugin
|
|
MultiDevicePlugin
|
|
EXPORT_DEPENDENCIES
|
|
${EXPORT_DEPENDENCIES}
|
|
)
|
|
|
|
ie_faster_build(${TARGET_NAME}
|
|
PCH PRIVATE "src/precomp.hpp"
|
|
)
|
|
|
|
if (TARGET MKLDNNPlugin)
|
|
add_dependencies(${TARGET_NAME} MKLDNNPlugin)
|
|
endif()
|
|
|
|
target_include_directories(${TARGET_NAME} PUBLIC
|
|
${PUBLIC_HEADERS_DIR}
|
|
${IE_MAIN_SOURCE_DIR}/src/vpu/graph_transformer/include
|
|
)
|
|
|
|
target_link_libraries(${TARGET_NAME}
|
|
PUBLIC
|
|
${EXPORT_DEPENDENCIES}
|
|
|
|
PRIVATE
|
|
inference_engine_transformations
|
|
)
|