summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.h
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/cmCoreTryCompile.h
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/cmCoreTryCompile.h')
-rw-r--r--Source/cmCoreTryCompile.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h
index 3e1e12c..d9649b9 100644
--- a/Source/cmCoreTryCompile.h
+++ b/Source/cmCoreTryCompile.h
@@ -18,6 +18,11 @@ class cmMakefile;
template <typename Iter>
class cmRange;
+struct cmTryCompileResult
+{
+ int ExitCode = 1;
+};
+
/** \class cmCoreTryCompile
* \brief Base class for cmTryCompileCommand and cmTryRunCommand
*
@@ -80,8 +85,8 @@ public:
* This function requires at least two \p arguments and will crash if given
* fewer.
*/
- bool TryCompileCode(Arguments& arguments,
- cmStateEnums::TargetType targetType);
+ cm::optional<cmTryCompileResult> TryCompileCode(
+ Arguments& arguments, cmStateEnums::TargetType targetType);
/**
* Returns \c true if \p path resides within a CMake temporary directory,