Files
openvino/cmake/developer_package/whole_archive.cmake
Ilya Lavrenov c4eeecfec5 Remove myriad plugin (#15131)
* Removed Intel MYRIAD plugin

* Removed Intel MYIAD from CI files

* Removed Intel MYRIAD from cmake folder

* Removed MYRIAD, HDDL from samples

* Removed MYRIAD, HDDL from scripts folder

* Removed MYRIAD from bindings folder (C and Python API)

* Removed MYRIAD tests

* Removed MYRIAD from tests folder

* Removed MYRIAD from tools folder

* Removed HDDL (VAD), MYRIAD (NSC2) from documentation

* Fixed build for AUTO unit tests

* Fixed clang code style

* Fixed comments and issues

* removed MYRIAD from AUTO tests

* Disabled MULTI tests in CI

* Update docs/OV_Runtime_UG/auto_device_selection.md

Co-authored-by: Yuan Xu <yuan1.xu@intel.com>

* Update docs/get_started/get_started_demos.md

Co-authored-by: Yuan Xu <yuan1.xu@intel.com>

* Update docs/OV_Runtime_UG/deployment/local-distribution.md

Co-authored-by: Yuan Xu <yuan1.xu@intel.com>

Co-authored-by: Yuan Xu <yuan1.xu@intel.com>
2023-01-18 15:19:44 +04:00

54 lines
2.1 KiB
CMake

# Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
#[[
function links static library without removing any symbol from it.
ieTargetLinkWholeArchive(<target name> <lib1> [<lib2> ...])
Example:
ieTargetLinkWholeArchive("FunctionalTests" "CommonLib" "AnotherLib")
#]]
function(ieTargetLinkWholeArchive targetName)
set(libs)
foreach(staticLib ${ARGN})
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# CMake does not support generator expression in LINK_FLAGS, so we workaround it a little bit:
# passing same static library as normal link (to get build deps working, and includes too), than using WHOLEARCHIVE option
# it's important here to not use slash '/' for option !
if(CMAKE_GENERATOR MATCHES "Visual Studio")
# MSBuild is unhappy when parsing double quotes in combination with WHOLEARCHIVE flag.
# remove quotes from path - so build path with spaces not supported, but it's better than nothing.
list(APPEND libs ${staticLib}
"-WHOLEARCHIVE:$<TARGET_FILE:${staticLib}>"
)
if(CMAKE_CURRENT_BINARY_DIR MATCHES " ")
message(WARNING "Visual Studio CMake generator may cause problems if your build directory contains spaces. "
"Remove spaces from path or select different generator.")
endif()
else()
list(APPEND libs ${staticLib}
"-WHOLEARCHIVE:\"$<TARGET_FILE:${staticLib}>\""
)
endif()
elseif(OV_COMPILER_IS_APPLECLANG)
list(APPEND libs
"-Wl,-all_load"
${staticLib}
"-Wl,-noall_load"
)
else()
list(APPEND libs
"-Wl,--whole-archive"
${staticLib}
"-Wl,--no-whole-archive"
)
endif()
endforeach()
if(libs)
target_link_libraries(${targetName} PRIVATE ${libs})
endif()
endfunction()