CMP0166

在 3.30 版被加入.

TARGET_PROPERTY evaluates link properties transitively over private dependencies of static libraries.

In CMake 3.29 and below, the TARGET_PROPERTY generator expression evaluates properties INTERFACE_LINK_OPTIONS, INTERFACE_LINK_DIRECTORIES, and INTERFACE_LINK_DEPENDS as if they were 傳遞編譯屬性 rather than 傳遞鏈接屬性, even when policy CMP0099 is set to NEW. Private dependencies of static libraries, which appear in their INTERFACE_LINK_LIBRARIES guarded by LINK_ONLY generator expressions, are not followed. This is inconsistent with evaluation of the same target properties during buildsystem generation.

CMake 3.30 and above prefer that TARGET_PROPERTY evaluates properties INTERFACE_LINK_OPTIONS, INTERFACE_LINK_DIRECTORIES, and INTERFACE_LINK_DEPENDS as 傳遞鏈接屬性 such that private dependencies of static libraries, which appear in their INTERFACE_LINK_LIBRARIES guarded by LINK_ONLY generator expressions, are followed. This policy provides compatibility for projects that have not been updated to expect the new behavior.

The OLD behavior for this policy is for TARGET_PROPERTY to evaluate properties INTERFACE_LINK_OPTIONS, INTERFACE_LINK_DIRECTORIES, and INTERFACE_LINK_DEPENDS as if they were 傳遞編譯屬性 by not following private dependencies of static libraries. The NEW behavior for this policy is to evaluate them as 傳遞鏈接屬性 by following private dependencies of static libraries.

This policy was introduced in CMake version 3.30. It may be set by cmake_policy() or cmake_minimum_required(). If it is not set, CMake does not warn, and uses OLD behavior.

備註

The OLD behavior of a policy is deprecated by definition and may be removed in a future version of CMake.