summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCoreTryCompile.h')
-rw-r--r--Source/cmCoreTryCompile.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h
index 3e1e12c..6d29586 100644
--- a/Source/cmCoreTryCompile.h
+++ b/Source/cmCoreTryCompile.h
@@ -14,10 +14,23 @@
#include "cmArgumentParserTypes.h"
#include "cmStateTypes.h"
+class cmConfigureLog;
class cmMakefile;
template <typename Iter>
class cmRange;
+struct cmTryCompileResult
+{
+ std::string SourceDirectory;
+ std::string BinaryDirectory;
+
+ bool VariableCached = true;
+ std::string Variable;
+
+ std::string Output;
+ int ExitCode = 1;
+};
+
/** \class cmCoreTryCompile
* \brief Base class for cmTryCompileCommand and cmTryRunCommand
*
@@ -80,8 +93,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,
@@ -103,6 +116,9 @@ public:
*/
void FindOutputFile(const std::string& targetName);
+ static void WriteTryCompileEventFields(
+ cmConfigureLog& log, cmTryCompileResult const& compileResult);
+
std::string BinaryDirectory;
std::string OutputFile;
std::string FindErrorMessage;