Sfoglia il codice sorgente

Merge topic 'doc-pch-genex' into release-3.16

f35df783b5 Help: Document target_precompile_headers genex with angle brackets

Acked-by: Kitware Robot <[email protected]>
Merge-request: !4015
Brad King 6 anni fa
parent
commit
11e425be9b
1 ha cambiato i file con 11 aggiunte e 0 eliminazioni
  1. 11 0
      Help/command/target_precompile_headers.rst

+ 11 - 0
Help/command/target_precompile_headers.rst

@@ -79,6 +79,17 @@ must be available for the compiler to find them.  Other header file names
 source directory (e.g. :variable:`CMAKE_CURRENT_SOURCE_DIR`) and will be
 included by absolute path.
 
+When specifying angle brackets inside a :manual:`generator expression
+<cmake-generator-expressions(7)>`, be sure to encode the closing ``>``
+as ``$<ANGLE-R>``.  For example:
+
+.. code-block:: cmake
+
+  target_precompile_headers(mylib PRIVATE
+    "$<$<COMPILE_LANGUAGE:C>:<stddef.h$<ANGLE-R>>"
+    "$<$<COMPILE_LANGUAGE:CXX>:<cstddef$<ANGLE-R>>"
+    )
+
 See Also
 ^^^^^^^^