summaryrefslogtreecommitdiffstats
path: root/Help/command/try_compile.rst
Commit message (Collapse)AuthorAgeFilesLines
* try_compile: Propagating top level includes into whole-project callsCraig Scott2024-05-301-0/+11
| | | | Fixes: #24151
* Help: try_compile how to pass compiler optionsscivision2024-05-121-2/+3
| | | | | | it wasn't obvious how to pass compiler options. Since the old add_definitions() is used we can workaround this by passing compiler options there.
* Help: Remove stray formatting for try_compile() LINKER_LANGUAGE keywordCraig Scott2024-03-221-1/+1
|
* Merge topic 'try_compile-alias-targets'Brad King2023-10-171-0/+3
|\ | | | | | | | | | | | | | | | | 8f9f371668 try_compile: Add support for using ALIAS targets 9f8aa94192 Add missing `OUTPUT` in ExportImport test Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8877
| * try_compile: Add support for using ALIAS targetsCristian Le2023-10-161-0/+3
| | | | | | | | | | Fixes: #25337 Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
* | try_{compile,run}: add LINKER_LANGUAGE optionscivision2023-10-161-0/+9
|/ | | | Fixes: #25326
* cmExperimental: remove the flag for C++ modulesBen Boeckel2023-10-021-5/+2
| | | | | | | All the major compilers now have scheduled releases with support for scanning, so remove the experimental gate. Fixes: #18355
* Help:try_compile: place options in their own sectionscivision2023-08-161-1/+6
| | | | | As try_compile interface was enhanced in 3.25, the Help got a lot longer. Make the options its own section for navigability.
* cmCoreTryCompile: parse `SOURCES_TYPE` argumentBen Boeckel2023-07-311-0/+22
| | | | | | This will serve to add context for the source listing in order to properly mark sources as `FILE_SET TYPE CXX_MODULES` in the generated code.
* Help:try_{compile,run}: clarify, encourage new syntaxscivision2023-02-281-20/+19
|
* Help: Document configure log behavior in try_compile and try_runBrad King2023-01-181-0/+5
|
* try_compile: Add a NO_LOG option to skip recording in the configure logBrad King2023-01-161-0/+9
|
* try_compile: Add optional LOG_DESCRIPTION to record in configure logBrad King2023-01-161-0/+10
| | | | Issue: #23200
* Help: remove links from pages to themselvesBen Boeckel2022-11-181-1/+1
| | | | | At least the top-reference links. Internal `:ref:` usages have been left intact.
* Help: Add _See Also_ sections to related CMake commandsAlex Turbov2022-11-091-0/+5
|
* Help: Use role `:program:`Alex Turbov2022-11-061-3/+3
| | | | | When mention execitable names use Sphinx semantic role `:program` instead of ``executable`` or **executable**.
* Help: Fix typo that crashes older pygments lexersBrad King2022-10-131-4/+4
| | | | | | | | In commit cb14ae2b87 (try_compile: Add SOURCE_FROM_{ARG,VAR}, 2022-09-21, v3.25.0-rc1~94^2~2) we accidentally added unbalanced closing `]` characters in the `try_compile` and `try_run` signatures. Fixes: #24053
* Help: Minor grammar, typo and formatting cleanupsCraig Scott2022-10-091-3/+4
|
* Merge topic 'improve-try_compile-debug-documentation'Brad King2022-10-041-3/+3
|\ | | | | | | | | | | | | | | 3801785cc3 Help: Improve try_compile debug documentation Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: alcroito <alexandru.croitor@qt.io> Merge-request: !7735
| * Help: Improve try_compile debug documentationMatthew Woehlke2022-10-031-3/+3
| | | | | | | | | | | | Update the --debug-trycompile documentation to account for recent changes to try_compile. Mention where in the build tree to find artifacts when using said option.
* | Merge topic 'fix-try_compile-doc-typo'Brad King2022-10-041-1/+1
|\ \ | | | | | | | | | | | | | | | | | | ef05a56387 Help: Fix typo in try_compile documentation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7736
| * | Help: Fix typo in try_compile documentationMatthew Woehlke2022-09-301-1/+1
| |/
* | try_compile: Rename SOURCE_FROM_ARG -> SOURCE_FROM_CONTENTMatthew Woehlke2022-09-301-10/+11
|/ | | | | | | | | Change the SOURCE_FROM_ARG keyword to try_compile to SOURCE_FROM_CONTENT (which we can do because it was recently added and hasn't been in a release yet). The new name should be clearer as to what it does, and also more consistent with the CONTENT arguments to some other commands. Also, fix a typo in an error message.
* try_compile: Add NO_CACHE option (also try_run)Matthew Woehlke2022-09-281-1/+26
| | | | | | | Add NO_CACHE option to try_compile and try_run, which places the results in regular, rather than cache, variables. Issue: #22799
* try_compile: Add SOURCE_FROM_FILEMatthew Woehlke2022-09-221-1/+12
| | | | | | | Add ability to copy try_compile (and try_run) source files from arbitrary locations into the operation directory. This is included for the sake of completion and consolidation, although use cases which actually require this may be rare.
* try_compile: Add SOURCE_FROM_{ARG,VAR}Matthew Woehlke2022-09-221-5/+31
| | | | | | | | Add ability to "feed" try_compile (and try_run) sources more directly, either from literal content, or from a CMake variable which contains literal content. This saves the user from needing a separate step to write the content to a file, and allows for the sources to only exist in the scratch directory.
* try_compile: Add PROJECT keyword-dispatched signatureMatthew Woehlke2022-09-141-2/+16
| | | | | | | Introduce a new signature for the project flavor of try_compile (and try_run) which removes the `bindir` argument and adds a required PROJECT tag. This is similar to the SOURCES flavor added by commit aa9220d3 (try_compile: Add keyword-dispatched signature, 2022-09-02).
* MSVC: Add abstraction for debug information formatGlen Chung2022-09-141-0/+5
| | | | | | | | | | | | | | | | Replace our hard-coded default for `/Zi` with a first-class abstraction to select the debug information format an enumeration of logical names. We've long hesitated to do this because the idea of "debug information format" touches on related concepts on several platforms. Avoid that scope creep by simply defining an abstraction that applies only when targeting the MSVC ABI on Windows. Removing the old default flag requires a policy because existing projects may rely on string processing to edit them and choose a runtime library under the old behavior. Add policy CMP0141 to provide compatibility. Fixes: #10189
* try_compile: Add keyword-dispatched signatureMatthew Woehlke2022-09-051-13/+36
| | | | | | | | | | | | | | | | Introduce a new signature for try_compile (and try_run) which removes the `bindir` argument and requires the SOURCES tag. This will eventually allow us to add other ways of providing sources, but also allows us to change the behavior without breaking compatibility. The old signature uses a special, but non-unique temporary location inside the specified `bindir`, which conventionally is just the project's build directory. The new signature unconditionally uses the a unique temporary directory which is unconditionally within the project's build directory (which is no longer separately specified). This ensures that successive runs do not overwrite previous runs, will simplify debugging, and should also, eventually, allow us to execute multiple trials in parallel.
* Help: Replace a bunch of more ``--option`` to `:option:` roleAlex Turbov2022-08-041-9/+10
|
* try_compile: Add option to skip passing platform variablesBrad King2022-05-161-0/+4
| | | | | | | Add a `CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable to tell `try_compile` not to pass platform variables to the test project. Issue: #23219
* try_compile: Propagate platform variables in project-mode tooBrad King2022-05-161-0/+11
| | | | | | | | | Add policy CMP0137 to propagate both our builtin variables and those listed by `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` to `try_compile` whole-project builds. Inspired-by: Alexander Neumann <Alexander.Neumann@hamburg.de> Fixes: #23219
* OpenWatcom: Allow specifying the runtime libraryCameron Cawley2022-05-061-0/+1
| | | | | | | | Add a `CMAKE_WATCOM_RUNTIME_LIBRARY` variable to control the runtime library selection. Add policy CMP0136 to switch to in place of the old hard-coded default flags. Fixes: #23178
* Help: Drop incorrect versionadded for try_compile result variablefriendlyanon2022-01-311-8/+0
| | | | | | | | | | | | In commit c705279bae (Help: Add `.. versionadded` directives to commands documentation, 2020-11-08, v3.20.0-rc1~508^2) we accidentally added ``versionadded`` markup suggesting that the first argument to `try_compile` was fixed as `RESULT_VAR` prior to CMake 3.14. This was probably due to misinterpreting the change from commit 7975edeac5 (Help: User-provided variable names for try_* commands, 2019-02-24, v3.14.0-rc3~16^2~3). The result variable has never been fixed. Drop the incorrect markup.
* Help: Replace some `versionadded` directives with `versionchanged`Nikita Nemkin2020-11-121-3/+3
| | | | | | | | `.. versionchanged` directive might be more appropriate when documentation refers to previous CMake version, old behavior or a policy, and there's no new parameter or a variable involved. Issue: #19715
* Help: Add `.. versionadded` directives to commands documentationNikita Nemkin2020-11-091-49/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change ony concerns directives that appear in the document body. The guidelines for inserting version directives: * Baseline version is CMake 3.0, i.e. directives start at 3.1. * Always use `.. versionadded::` directive, avoid ad-hoc version references. Exception: policy pages. * For new command signatures, put `versionadded` on a separate line after the signature. * For a group of new signatures in a new document section, a single version note at the beginning of the section is sufficient. * For new options, put `versionadded` on a separate line before option description. * If all the option descriptions in the list are short one-liners, it's fine to put `versionadded` on the same line as the description. * If multiple option descriptions in close proximity would have the same ..versionadded directive, consider adding a single directive after the list, mentioning all added options. * For compact value lists and sub-option lists, put a single `versionadded` directive after the list mentioning all additions. * When a change is described in a single paragraph, put `versionadded` into that paragraph. * When only part of the paragraph has changed, separate the changed part if it doesn't break the flow. Otherwise, write a follow-up clarification paragraph and apply version directive to that. * When multiple version directives are close by, order earlier additions before later additions. * Indent related lists and code blocks to include them in the scope of `versionadded` directive. Issue: #19715
* CUDA: Propagate CMAKE_CUDA_RUNTIME_LIBRARY state to try_compileRobert Maynard2020-05-201-0/+1
|
* ObjC: Document ObjC/ObjCXX standard properties / variablesCristian Adam2019-11-111-1/+10
| | | | Fixes: #19919
* MSVC: Add abstraction for runtime library selectionBrad King2019-04-171-0/+1
| | | | | | | | | | | | | | | | Replace our hard-coded defaults for `/MD` and `/MDd` with a first-class abstraction to select the runtime library from an enumeration of logical names. We've long hesitated to do this because the idea of "runtime library selection" touches on related concepts on several platforms. Avoid that scope creep by simply defining an abstraction that applies only when targeting the MSVC ABI on Windows. Removing the old default flags requires a policy because existing projects may rely on string processing to edit them and choose a runtime library under the old behavior. Add policy CMP0091 to provide compatibility. Fixes: #19108
* Help: Caveat for try_compile() and CMAKE_TRY_COMPILE_PLATFORM_VARIABLESCraig Scott2019-02-241-1/+3
|
* Help: Consistency in try_compile() docs for target typeCraig Scott2019-02-241-8/+14
|
* Help: try_compile() readability and grammar improvementsCraig Scott2019-02-241-6/+6
|
* Help: User-provided variable names for try_* commandsCraig Scott2019-02-241-5/+5
| | | | | All uppercase is typically used for command keywords. Non-keyword arguments should generally be shown as `<something>` according to the CMake documentation guide.
* GHS: try_compile() now uses GHS platform variablesFred Baksik2019-01-161-0/+3
| | | | | | | -- Forward GHS platform variables to try_compile() CMAKE_TRY_COMPILE_PLATFORM_VARIABLES only worked for source signature try_compile() -- Update tests to no longer add GHS platform variables to try_compile() -- Avoid linker error in GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt by building library
* PIE link options: Update strategy to fix performance regressionMarc Chevrier2018-12-191-0/+5
| | | | Fixes: #18700
* try_compile/try_run: Add support for LINK_OPTIONS option.Marc Chevrier2018-12-011-1/+8
|
* CMP0083: fix warning message on try_compileMarc Chevrier2018-11-191-1/+2
| | | | Fixes: #18593
* Help: Apply syntax highlighting to project commandsJoachim Wuttke (o)2018-10-251-3/+5
| | | | | | * Replace most "::" by ".. code-block:: cmake" * Header sentence in imperative voice, detailed command description in present tense.
* try_compile: extend CMP0067 to honor language standards for CUDA.Robert Maynard2016-12-121-6/+10
|
* try_compile: Add policy CMP0067 to honor language standardsBrad King2016-12-061-0/+14
| | | | | | | | | | | | | | Projects use `try_compile` to check if they will be able to compile some particular source code. When a language standard variable like `CMAKE_CXX_STANDARD` is set, then the project intends to compile source code using a compiler mode for that standard. Therefore it makes sense for `try_compile` to use that standard in the test project too. Unfortunately this was not done when support for the `CMAKE_CXX_STANDARD` variable was first implemented. Add a policy to introduce the improved behavior in a compatible way. Closes: #16456