summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-13 12:18:22 (GMT)
committerBrad King <brad.king@kitware.com>2018-12-12 11:39:30 (GMT)
commiteb2ec41a0422e9acd4961e32f6f28c20846a292a (patch)
tree48257a71b127bb947f9bdaabaa1d2d1e605ec6fd /Source/cmake.cxx
parentc3635e502c9804fc0ab781b9f20e07449d4e6c23 (diff)
downloadCMake-eb2ec41a0422e9acd4961e32f6f28c20846a292a.zip
CMake-eb2ec41a0422e9acd4961e32f6f28c20846a292a.tar.gz
CMake-eb2ec41a0422e9acd4961e32f6f28c20846a292a.tar.bz2
fileapi: Add protocol v1 infrastructure with support for shared query files
Add a file-based API that clients may use to get semantic information about the buildsystem that CMake generates. Clients will write query files under a designated location in the build tree, and CMake will write reply files for clients to read. Start with support for shared stateless query files. These allow clients to share requests for major object versions and get all those recognized by CMake. Once any client has written a shared request to a build tree it will persist. Other clients will not need to overwrite the request (since it is stateless) and should not remove it either. For now we add only an undocumented object kind to use for testing the query and reply infrastructure. Object kinds providing real semantic information will be added later. Issue: #18398
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 2ac7f4d..e81d14b 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -30,6 +30,7 @@
#if defined(CMAKE_BUILD_WITH_CMAKE)
# include "cm_jsoncpp_writer.h"
+# include "cmFileAPI.h"
# include "cmGraphVizWriter.h"
# include "cmVariableWatch.h"
# include <unordered_map>
@@ -1443,6 +1444,11 @@ int cmake::ActualConfigure()
this->TruncateOutputLog("CMakeError.log");
}
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ this->FileAPI = cm::make_unique<cmFileAPI>(this);
+ this->FileAPI->ReadQueries();
+#endif
+
// actually do the configure
this->GlobalGenerator->Configure();
// Before saving the cache
@@ -1682,6 +1688,10 @@ int cmake::Generate()
// for the Visual Studio and Xcode generators.)
this->SaveCache(this->GetHomeOutputDirectory());
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ this->FileAPI->WriteReplies();
+#endif
+
return 0;
}