Explorar o código

Help: Note try_compile/try_run caching

scivision hai 1 ano
pai
achega
9be6e42499
Modificáronse 2 ficheiros con 16 adicións e 13 borrados
  1. 8 6
      Help/command/try_compile.rst
  2. 8 7
      Help/command/try_run.rst

+ 8 - 6
Help/command/try_compile.rst

@@ -92,10 +92,11 @@ Try Compiling Source Files
 
 .. versionadded:: 3.25
 
-Try building an executable or static library from one or more source files
-(which one is determined by the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE`
-variable). Build success returns ``TRUE`` and build failure returns ``FALSE``
-in ``<compileResultVar>``.
+Try building an executable or static library from one or more source files.
+The binary type is determined by variable
+:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE`.
+Build success returns boolean ``true`` and build failure returns boolean
+``false`` in ``<compileResultVar>`` (cached unless ``NO_CACHE`` is specified).
 
 In this form, one or more source files must be provided. Additionally, one of
 ``SOURCES`` and/or ``SOURCE_FROM_*`` must precede other keywords.
@@ -211,9 +212,10 @@ The options for the above signatures are:
 ``NO_CACHE``
   .. versionadded:: 3.25
 
-  The result will be stored in a normal variable rather than a cache entry.
+  ``<compileResultVar>`` will be stored in a normal variable rather than a
+  cache entry.
 
-  The result variable is normally cached so that a simple pattern can be used
+  ``<compileResultVar>`` is normally cached so that a simple pattern can be used
   to avoid repeating the test on subsequent executions of CMake:
 
   .. code-block:: cmake

+ 8 - 7
Help/command/try_run.rst

@@ -40,13 +40,14 @@ Try Compiling and Running Source Files
 .. versionadded:: 3.25
 
 Try building an executable from one or more source files.  Build success
-returns ``TRUE`` and build failure returns ``FALSE`` in ``<compileResultVar>``.
-If the build succeeds, this runs the executable and stores the exit code in
-``<runResultVar>``.  If the executable was built, but failed to run, then
-``<runResultVar>`` will be set to ``FAILED_TO_RUN``.  See command
-:command:`try_compile` for documentation of options common to both commands,
-and for information on how the test project is constructed to build the source
-file.
+returns boolean ``true`` and build failure returns boolean ``false`` in
+``<compileResultVar>`` (cached unless ``NO_CACHE`` is specified).
+If the build succeeds, this runs the executable and stores the exit code
+in ``<runResultVar>`` (cached unless ``NO_CACHE`` is specified).
+If the executable was built, but failed to run, then ``<runResultVar>``
+will be set to ``FAILED_TO_RUN``.  See command :command:`try_compile` for
+documentation of options common to both commands, and for information on
+how the test project is constructed to build the source file.
 
 One or more source files must be provided. Additionally, one of ``SOURCES``
 and/or ``SOURCE_FROM_*`` must precede other keywords.