summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2022-11-23 22:02:22 (GMT)
committerBrad King <brad.king@kitware.com>2022-12-16 15:11:37 (GMT)
commit746c776caf1207049922edb3ea63586b94fca4c6 (patch)
treea846db4f6435b8d4f1c592af0a26209ba13b5a1f /Source/cmake.cxx
parente8b8d82cbf60e517ad4b9026ba24de1c59165af4 (diff)
downloadCMake-746c776caf1207049922edb3ea63586b94fca4c6.zip
CMake-746c776caf1207049922edb3ea63586b94fca4c6.tar.gz
CMake-746c776caf1207049922edb3ea63586b94fca4c6.tar.bz2
ConfigureLog: Add infrastructure for structured configure event logging
Add infrastructure for a "configure log". Use YAML for a balance of machine- and human-readability to records details of configure-time events in a structured format. Teach the RunCMake test framework to support matching the configure log. Issue: #23200
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index befcb55..17027bc 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -70,6 +70,7 @@
# include <cm3p/curl/curl.h>
# include <cm3p/json/writer.h>
+# include "cmConfigureLog.h"
# include "cmFileAPI.h"
# include "cmGraphVizWriter.h"
# include "cmVariableWatch.h"
@@ -2423,10 +2424,21 @@ int cmake::ActualConfigure()
#if !defined(CMAKE_BOOTSTRAP)
this->FileAPI = cm::make_unique<cmFileAPI>(this);
this->FileAPI->ReadQueries();
+
+ if (!this->GetIsInTryCompile()) {
+ this->TruncateOutputLog("CMakeConfigureLog.yaml");
+ this->ConfigureLog = cm::make_unique<cmConfigureLog>(
+ cmStrCat(this->GetHomeOutputDirectory(), "/CMakeFiles"_s));
+ }
#endif
// actually do the configure
this->GlobalGenerator->Configure();
+
+#if !defined(CMAKE_BOOTSTRAP)
+ this->ConfigureLog.reset();
+#endif
+
// Before saving the cache
// if the project did not define one of the entries below, add them now
// so users can edit the values in the cache: