diff options
author | Brad King <brad.king@kitware.com> | 2024-05-09 17:38:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-05-21 13:22:51 (GMT) |
commit | b9ee79b8a13abb957a176ff0b5eab1e5d33efc50 (patch) | |
tree | b3cb6301b38f03f953dcea719fa1dec800022ada /Help/manual/cmake-generator-expressions.7.rst | |
parent | 633afa0b2e27a6eca3a4b1e123a80cf4338fe509 (diff) | |
download | CMake-b9ee79b8a13abb957a176ff0b5eab1e5d33efc50.zip CMake-b9ee79b8a13abb957a176ff0b5eab1e5d33efc50.tar.gz CMake-b9ee79b8a13abb957a176ff0b5eab1e5d33efc50.tar.bz2 |
GenEx: Add support for custom transitive compile properties
Teach the `$<TARGET_PROPERTY:...>` generator expression to check for a
new `TRANSITIVE_COMPILE_PROPERTIES` property in the target's link
closure to enable transitive evaluation of named properties through
the link closure, excluding entries guarded by `$<LINK_ONLY:...>`.
Issue: #20416
Diffstat (limited to 'Help/manual/cmake-generator-expressions.7.rst')
-rw-r--r-- | Help/manual/cmake-generator-expressions.7.rst | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index d9b10b8..d0d751b 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -1810,6 +1810,49 @@ The expressions have special evaluation rules for some properties: Evaluation of :prop_tgt:`INTERFACE_LINK_LIBRARIES` itself is not transitive. +:ref:`Custom Transitive Properties` + .. versionadded:: 3.30 + + These are processed during evaluation as follows: + + * Evaluation of :genex:`$<TARGET_PROPERTY:tgt,PROP>` for some property + ``PROP``, named without an ``INTERFACE_`` prefix, + checks the :prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES` + property on target ``tgt``, + on targets named by its :prop_tgt:`LINK_LIBRARIES`, and on the + transitive closure of targets named by the linked targets' + :prop_tgt:`INTERFACE_LINK_LIBRARIES`. + + If ``PROP`` is listed by one of those properties, then it evaluates as + a :ref:`semicolon-separated list <CMake Language Lists>` representing + the union of the value on the target itself with the values of the + corresponding ``INTERFACE_PROP`` on targets named by the target's + :prop_tgt:`LINK_LIBRARIES`: + + * If ``PROP`` is named by :prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES`, + evaluation of the corresponding ``INTERFACE_PROP`` is transitive over + the closure of the linked targets' :prop_tgt:`INTERFACE_LINK_LIBRARIES`, + excluding entries guarded by the :genex:`LINK_ONLY` generator expression. + + * Evaluation of :genex:`$<TARGET_PROPERTY:tgt,INTERFACE_PROP>` for some + property ``INTERFACE_PROP``, named with an ``INTERFACE_`` prefix, + checks the :prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES` + property on target ``tgt``, + and on the transitive closure of targets named by its + :prop_tgt:`INTERFACE_LINK_LIBRARIES`. + + If the corresponding ``PROP`` is listed by one of those properties, + then ``INTERFACE_PROP`` evaluates as a + :ref:`semicolon-separated list <CMake Language Lists>` representing the + union of the value on the target itself with the value of the same + property on targets named by the target's + :prop_tgt:`INTERFACE_LINK_LIBRARIES`: + + * If ``PROP`` is named by :prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES`, + evaluation of the corresponding ``INTERFACE_PROP`` is transitive over + the closure of the target's :prop_tgt:`INTERFACE_LINK_LIBRARIES`, + excluding entries guarded by the :genex:`LINK_ONLY` generator expression. + :ref:`Compatible Interface Properties` These evaluate as a single value combined from the target itself, from targets named by the target's :prop_tgt:`LINK_LIBRARIES`, and |