summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-16 16:49:35 (GMT)
committerBrad King <brad.king@kitware.com>2023-01-16 22:16:12 (GMT)
commitd4bf7d80c618930e6b88c35d271a5b0a0656bb7b (patch)
treefb9e5883e8fef2d96a3d1168946a9ad527658014 /Source
parent9d9e8450a872a4a9ec1a74cc7a73df100c32c7e8 (diff)
downloadCMake-d4bf7d80c618930e6b88c35d271a5b0a0656bb7b.zip
CMake-d4bf7d80c618930e6b88c35d271a5b0a0656bb7b.tar.gz
CMake-d4bf7d80c618930e6b88c35d271a5b0a0656bb7b.tar.bz2
try_compile: Add a NO_LOG option to skip recording in the configure log
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCoreTryCompile.cxx1
-rw-r--r--Source/cmCoreTryCompile.h1
-rw-r--r--Source/cmTryCompileCommand.cxx7
-rw-r--r--Source/cmTryRunCommand.cxx2
4 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 29f6a98..2084b33 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -153,6 +153,7 @@ auto const TryCompileBaseArgParser =
.Bind(0, &Arguments::CompileResultVariable)
.Bind("LOG_DESCRIPTION"_s, &Arguments::LogDescription)
.Bind("NO_CACHE"_s, &Arguments::NoCache)
+ .Bind("NO_LOG"_s, &Arguments::NoLog)
.Bind("CMAKE_FLAGS"_s, &Arguments::CMakeFlags)
.Bind("__CMAKE_INTERNAL"_s, &Arguments::CMakeInternal)
/* keep semicolon on own line */;
diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h
index efd58e5..1ec4405 100644
--- a/Source/cmCoreTryCompile.h
+++ b/Source/cmCoreTryCompile.h
@@ -75,6 +75,7 @@ public:
cm::optional<std::string> CopyFileError;
cm::optional<ArgumentParser::NonEmpty<std::string>> LogDescription;
bool NoCache = false;
+ bool NoLog = false;
// Argument for try_run only.
// Keep in sync with warnings in cmCoreTryCompile::ParseArgs.
diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx
index c70c03e..ebbb4f2 100644
--- a/Source/cmTryCompileCommand.cxx
+++ b/Source/cmTryCompileCommand.cxx
@@ -81,14 +81,15 @@ bool cmTryCompileCommand(std::vector<std::string> const& args,
return true;
}
- if (cm::optional<cmTryCompileResult> compileResult =
- tc.TryCompileCode(arguments, targetType)) {
+ cm::optional<cmTryCompileResult> compileResult =
+ tc.TryCompileCode(arguments, targetType);
#ifndef CMAKE_BOOTSTRAP
+ if (compileResult && !arguments.NoLog) {
if (cmConfigureLog* log = mf.GetCMakeInstance()->GetConfigureLog()) {
WriteTryCompileEvent(*log, mf, *compileResult);
}
-#endif
}
+#endif
// if They specified clean then we clean up what we can
if (tc.SrcFileSignature) {
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index ef59c32..a8e8b48 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -246,7 +246,7 @@ bool TryRunCommandImpl::TryRunCode(std::vector<std::string> const& argv)
}
#ifndef CMAKE_BOOTSTRAP
- if (compileResult) {
+ if (compileResult && !arguments.NoLog) {
cmMakefile const& mf = *(this->Makefile);
if (cmConfigureLog* log = mf.GetCMakeInstance()->GetConfigureLog()) {
WriteTryRunEvent(*log, mf, *compileResult, runResult);