summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorIgor Ivanov <artalus-mail@yandex.ru>2019-08-10 08:41:53 (GMT)
committerIgor Ivanov <artalus-mail@yandex.ru>2019-08-10 08:41:53 (GMT)
commit3c94069660112f841df3bae66891e05bfc7bad00 (patch)
treed173ed0adfdfddb1cf4da0f2230960b0165a8b7c /Source/cmMakefile.cxx
parent2327cc0e0575175e8dec4b7a6fa6cafd5d0f7ca9 (diff)
downloadCMake-3c94069660112f841df3bae66891e05bfc7bad00.zip
CMake-3c94069660112f841df3bae66891e05bfc7bad00.tar.gz
CMake-3c94069660112f841df3bae66891e05bfc7bad00.tar.bz2
Add --trace-redirect parameter to redirect trace output to a file
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 015453a..ea42289 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -23,6 +23,7 @@
#include "cmExpandedCommandArgument.h" // IWYU pragma: keep
#include "cmFileLockPool.h"
#include "cmFunctionBlocker.h"
+#include "cmGeneratedFileStream.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorExpressionEvaluationFile.h"
#include "cmGlobalGenerator.h"
@@ -321,7 +322,13 @@ void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const
msg << " ";
}
msg << ")";
- cmSystemTools::Message(msg.str());
+
+ auto& f = this->GetCMakeInstance()->GetTraceFile();
+ if (f) {
+ f << msg.str() << '\n';
+ } else {
+ cmSystemTools::Message(msg.str());
+ }
}
// Helper class to make sure the call stack is valid.