summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Genex: Add a test for the LINK_ONLY expression.Stephen Kelly2013-11-061-0/+1
| | | | | | | | | | | | | | Commit 239b0c6b (Don't add invalid content to static lib INTERFACE_LINK_LIBRARIES., 2013-10-20) extended a test which excercised the logic of the LINK_ONLY generator expression. Commit ef10b87c (CMP0022: Plain target_link_libraries must populate link interface, 2013-11-02) removed the instance of LINK_ONLY which was excercised by that test. Add a new test which excercises the other instance of LINK_ONLY by setting the CMP0022 policy to NEW and consuming the contents of the INTERFACE_LINK_LIBRARIES target property.
* CMP0022: Warn about a given target at most onceBrad King2013-11-031-0/+1
| | | | | | | | | | | Since cmTarget::ComputeLinkInterface is called separately for each "head" target that links a target, the warning we produce when CMP0022 is not set could be repeated. Add explicit logic to allow the warning to appear at most once. Multiple copies of the warning for the same target are almost always identical and therefore redundant. In the rare case that two copies of the warning are different, the second can appear in a future run after the first is fixed.
* Do not export INTERFACE_LINK_LIBRARIES from non-linkable targetsBrad King2013-11-021-0/+1
| | | | | | | | | | | | | | | | When cmExportFileGenerator::SetImportLinkInterface exports the old LINK_INTERFACE_LIBRARIES property values it skips doing so for non-linkable targets because target->GetLinkInterface returns NULL for such targets. Since cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty looks at the INTERFACE_LINK_LIBRARIES property directly instead of using the computed link interface, teach it to skip exporting the property if target->IsLinkable returns false. Extend the RunCMake.CMP0022 test with a case covering this. Simply export an executable target that links to a library that is not exported.
* CMP0022: Plain target_link_libraries must populate link interfaceBrad King2013-11-021-0/+1
| | | | | | | | | | | | | | | | | | The CMP0022 NEW behavior is that the INTERFACE_LINK_LIBRARIES property exactly defines the link interface. The plain target_link_libraries signature says linking is transitive by default, so it should populate the property. Teach the target_link_libraries plain signature to populate the INTERFACE_LINK_LIBRARIES regardless of the CMP0022 setting. Refactor the cmTarget::ComputeLinkInterface checks that warn when the policy is not set to compare the new property to either the explicitly set old link interface properties or the link implementation fallback for all linkable target types, not just static libraries. This fixes a regression in 2.8.12.0 that caused target_link_libraries to not implement transitive linking in the plain signature once the policy CMP0022 is set to NEW.
* CMP0022: Add unit test for null pointer check and message.Stephen Kelly2013-11-021-0/+1
|
* TLL: Don't populate old link interface if CMP0022 is NEW.Stephen Kelly2013-07-081-0/+2
| | | | | | | | | | | | | Always populate the INTERFACE_LINK_LIBRARIES for interface entries. Don't populate the old interface properties matching (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? if CMP0022 is NEW. Because the INTERFACE_LINK_LIBRARIES property is now populated by the target_link_libraries when operating on a static library, make an equivalent change which populates the property with the same value when the old link_libraries() command is used. This silences the policy warning in that case.
* Export: Generate INTERFACE_LINK_LIBRARIES property on targets.Stephen Kelly2013-07-081-0/+2
| | | | | | | | | | This property is generated only for targets which have recorded policy CMP0022 as NEW, and a compatibility mode is added to additionally export the old interfaces in that case too. If the old interfaces are not exported, the generated export files require CMake 2.8.12. Because the unit tests use a version which is not yet called 2.8.12, temporarily require a lower version.
* Introduce the INTERFACE_LINK_LIBRARIES property.Stephen Kelly2013-07-081-0/+5
This property replaces the properties which match (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?, and is enabled for IMPORTED targets, and for non-IMPORTED targets only with a policy. For static libraries, the INTERFACE_LINK_LIBRARIES property is also used as the source of transitive usage requirements content. Static libraries still require users to link to all entries in their LINK_LIBRARIES, but usage requirements such as INCLUDE_DIRECTORIES COMPILE_DEFINITIONS and COMPILE_OPTIONS can be restricted to only certain interface libraries. Because the INTERFACE_LINK_LIBRARIES property is populated unconditionally, we need to compare the evaluated result of it with the link implementation to determine whether to issue the policy warning for static libraries. For shared libraries, the policy warning is issued if the contents of the INTERFACE_LINK_LIBRARIES property differs from the contents of the relevant config-specific old LINK_INTERFACE_LIBRARIES property.