summaryrefslogtreecommitdiffstats
path: root/Source/cmTryRunCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* AddCacheEntry: Suppress raw pointer usageMarc Chevrier2023-05-301-15/+12
|
* CMake code rely on cmList class for CMake lists management (part. 1)Marc Chevrier2023-04-241-1/+2
|
* ConfigureLog: De-duplicate event backtrace and check key generationBrad King2023-02-011-3/+1
| | | | All event kinds have these fields, so centralize their implementation.
* try_compile: Record stack of in-progess checks in configure logBrad King2023-01-161-0/+1
| | | | | | | | Many `try_compile` and `try_run` calls occur inside check modules between `message(CHECK_START)` and `message(CHECK_{PASS,FAIL})` pairs. Add a field to configure log entries to report this context. Issue: #23200
* try_compile: Add a NO_LOG option to skip recording in the configure logBrad King2023-01-161-1/+1
|
* Merge branch 'backport-try_run-cross-compile' into try_run-cross-compileBrad King2023-01-121-6/+8
|\
| * try_run: Avoid crash in keyword-dispatched signature when cross-compilingBrad King2023-01-121-6/+8
| | | | | | | | | | | | | | | | Since commit aa9220d3a0 (try_compile: Add keyword-dispatched signature, 2022-09-02, v3.25.0-rc1~178^2) the `DoNotRunExecutable` code path may be reached with no single source-file argument. Do not assume it exists. Fixes: #24295
* | try_run: Do not require unrequested stdout/stderr when cross-compilingBrad King2023-01-121-4/+10
| | | | | | | | | | | | | | Since commit 048a02d5bb (ConfigureLog: Log try_compile and try_run checks, 2022-11-23) we always capture the stdout/stderr for logging. When cross-compiling, do not require `__TRYRUN_OUTPUT_STD{OUT,ERR}` variables to be populated just for the logging.
* | FileAPI: Add "configureLog" object kindBrad King2022-12-171-0/+1
| | | | | | | | | | | | | | Provide clients with a way to get a known set of configure log event versions. Issue: #23200
* | ConfigureLog: Version individual events instead of the whole logBrad King2022-12-161-20/+24
| | | | | | | | | | | | | | | | In order to support multiple log versions without buffering the entire log, move versioning to the level of individual events. Multiple versions of an event may then be logged consecutively. Issue: #23200
* | ConfigureLog: Log try_compile and try_run checksMatthew Woehlke2022-12-161-11/+82
| | | | | | | | | | | | Add configure log events for `try_compile` and `try_run` results. Issue: #23200
* | cmTryRunCommand: Factor out stdout/stderr capture conditionsBrad King2022-12-141-14/+8
| |
* | cmCoreTryCompile: Return more semantic information from compile stepBrad King2022-12-141-2/+3
|/ | | | | | Update the `TryCompileCode` signature to allow callers to distinguish between administrative failures and a compilation failure. Return results in a structure to which more information can be added later.
* try_compile: Add NO_CACHE option (also try_run)Matthew Woehlke2022-09-281-3/+9
| | | | | | | Add NO_CACHE option to try_compile and try_run, which places the results in regular, rather than cache, variables. Issue: #22799
* try_compile: More useful error if insufficient argumentsMatthew Woehlke2022-09-151-2/+4
| | | | | Tweak try_compile and try_run to give a more informative error (rather than "unknown error") when given an insufficient number of arguments.
* cmCoreTryCompile: Port to cmArgumentParserBrad King2022-08-021-134/+58
|
* cmCoreTryCompile: Move target type selection logic to try_compileBrad King2022-08-021-1/+1
| | | | | This is specific to `try_compile` since `try_run` always needs an executable. Move the logic out of the common code path.
* cmCoreTryCompile: Simplify TryCompileCode return typeBrad King2022-08-021-2/+2
| | | | The return value is only used as a boolean, so use `bool`.
* cmTry{Compile,Run}Command: Port away from legacy cmCommandBrad King2022-07-261-21/+61
| | | | Convert the command entry points to free functions.
* try_run: Add RUN_OUTPUT_STDOUT_VARIABLE and RUN_OUTPUT_STDERR_VARIABLE.Patrick Northon2022-07-081-12/+159
|
* messages: remove screamake from comments and errorsBen Boeckel2022-04-251-10/+10
|
* Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-1/+1
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-4/+4
|
* try_run: Allow to set working directoryAsit Dhal2021-02-031-2/+19
| | | | Fixes: #17634
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-5/+5
|
* Single location for cmProp typedefVitaly Stakhovsky2020-06-011-0/+1
|
* cmState::GetCacheEntryValue: return cmPropVitaly Stakhovsky2020-03-171-3/+2
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-1/+2
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-2/+1
| | | | | | | | | | | | This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-29/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* avoid adding multiple consecutive string literals to std::stringRolf Eike Beer2019-08-181-2/+1
| | | | While at it change some single character additions to be of type char.
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-1/+2
|
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-3/+2
| | | | | | | | | | | | | | | | This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value argument instead of a `const char *`. Benefits are: - `std::string` can be passed to `cmMakefile::AddDefinition` directly without the `c_str()` plus string length recomputation fallback. - Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at compile time. In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid `std::string::c_str` calls and the `std::string` is passed directly. Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
* Source: std::string related cleanupVitaly Stakhovsky2019-05-151-9/+9
|
* Merge topic 'cmrange-improvements'Brad King2019-02-251-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | b8031308f3 cmRange: Add unit tests a8d51ef8b7 cmRange: Add functions filter and transform da4773e8b8 cmRange: Add functions all_of, any_of, none_of 17a367e77f cmRange: Stylistic cleanup 9eb0e73f46 cmRange: Move to dedicated header file Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Artur Ryt <artur.ryt@gmail.com> Merge-request: !2972
| * cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-1/+1
| |
* | cmSystemTools: More functions accept `std::string` paramsVitaly Stakhovsky2019-02-201-3/+2
|/
* Merge topic 'modernize-for-loops'Brad King2019-02-111-4/+3
|\ | | | | | | | | | | | | | | | | 01b2d6ab74 Modernize: Use ranged for-loops when possible 15bdbec017 cmAlgorithms: Make cmRange advance/retreat safe for rvalues Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Merge-request: !2901
| * Modernize: Use ranged for-loops when possibleArtur Ryt2019-02-071-4/+3
| | | | | | | | | | | | | | Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
* | cmSystemTools::RunSingleCommand: Accept std::string argumentVitaly Stakhovsky2019-02-061-2/+2
|/
* Merge topic 'cmake-files-directory'Brad King2019-01-251-1/+1
|\ | | | | | | | | | | | | | | 3e867ed400 cmake: inlined files dir constant and removed it from cmake.h Acked-by: Kitware Robot <kwrobot@kitware.com> Rejected-by: vvs31415 <vstakhovsky@fastmail.com> Merge-request: !2655
| * cmake: inlined files dir constant and removed it from cmake.hBruno Manganelli2019-01-211-1/+1
| |
* | cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-2/+2
| |
* | clang-tidy: Use emplaceRegina Pfeifer2019-01-171-2/+2
|/
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-1/+2
| | | | Reduce the number of files relying on `cmake.h`.
* try_compile/try_run: Add support for LINK_OPTIONS option.Marc Chevrier2018-12-011-1/+2
|
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-1/+1
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Make use of std::chrono throughout every componentWouter Klouwen2018-01-231-2/+2
| | | | | | | | This commit continues the changes made in CTest to support std::chrono by applying it throughout every component where a duration was used. No functional change intended.
* TryRun: do not call strcpy()Rolf Eike Beer2017-10-081-4/+5
|