summaryrefslogtreecommitdiffstats
path: root/Source/cmTryRunCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-12-12 15:16:54 (GMT)
committerBrad King <brad.king@kitware.com>2022-12-14 16:42:29 (GMT)
commitfdda4095a32dcbb9cc0e9b38067652c025447822 (patch)
tree6750f3820b8b930ae0c00bb9d92489f7af66d208 /Source/cmTryRunCommand.cxx
parentdcb1c9c080d9dc7231893baf8bd71713ed2fe021 (diff)
downloadCMake-fdda4095a32dcbb9cc0e9b38067652c025447822.zip
CMake-fdda4095a32dcbb9cc0e9b38067652c025447822.tar.gz
CMake-fdda4095a32dcbb9cc0e9b38067652c025447822.tar.bz2
cmCoreTryCompile: Return more semantic information from compile step
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.
Diffstat (limited to 'Source/cmTryRunCommand.cxx')
-rw-r--r--Source/cmTryRunCommand.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 1e81195..1b545d5 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -109,10 +109,11 @@ bool TryRunCommandImpl::TryRunCode(std::vector<std::string> const& argv)
}
// do the try compile
- bool compiled = this->TryCompileCode(arguments, cmStateEnums::EXECUTABLE);
+ cm::optional<cmTryCompileResult> compileResult =
+ this->TryCompileCode(arguments, cmStateEnums::EXECUTABLE);
// now try running the command if it compiled
- if (compiled) {
+ if (compileResult && compileResult->ExitCode == 0) {
if (this->OutputFile.empty()) {
cmSystemTools::Error(this->FindErrorMessage);
} else {