-
- Downloads
Fix export of STATIC library PRIVATE non-target dependencies
In commit v3.5.0-rc1~43^2 (Fix export of STATIC library PRIVATE
dependencies with CMP0022 NEW, 2016-01-15) we taught
target_link_libraries to generate `$<LINK_ONLY:$<TARGET_NAME:dep>>` in
INTERFACE_LINK_LIBRARIES instead of `$<LINK_ONLY:dep>` so that `dep` can
be recognized as a target name and updated during export. However, this
approach does not work when `dep` is just a plain library name and not a
target because `$<TARGET_NAME:...>` requires the name of a reachable
target.
Since we do not know during target_link_libraries whether the name will
correspond to a reachable target or not, we cannot inject the
`$<TARGET_NAME:...>` expression. Revert this change and solve the
original problem instead by teaching the export logic to recognize and
update target names directly in `$<LINK_ONLY:...>` expressions.
Reported-by:
Ben Boeckel <ben.boeckel@kitware.com>
Showing
- Source/cmExportFileGenerator.cxx 21 additions, 0 deletionsSource/cmExportFileGenerator.cxx
- Source/cmTargetLinkLibrariesCommand.cxx 2 additions, 5 deletionsSource/cmTargetLinkLibrariesCommand.cxx
- Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake 2 additions, 0 deletionsTests/RunCMake/target_link_libraries/RunCMakeTest.cmake
- Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported-result.txt 1 addition, 0 deletions...get_link_libraries/StaticPrivateDepNotExported-result.txt
- Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported-stderr.txt 1 addition, 0 deletions...get_link_libraries/StaticPrivateDepNotExported-stderr.txt
- Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake 7 additions, 0 deletions...e/target_link_libraries/StaticPrivateDepNotExported.cmake
- Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake 6 additions, 0 deletions...ake/target_link_libraries/StaticPrivateDepNotTarget.cmake
Loading
Please register or sign in to comment