mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-16 11:21:41 -05:00
cmake_file_api: New project command
Projects can use the new command to request file API replies for the current run. No query files are generated, the query is tracked internally. Replies are created in the file system at generation time in the usual way. Fixes: #24951
This commit is contained in:
@@ -41,6 +41,20 @@ public:
|
||||
/** Report file-api capabilities for cmake -E capabilities. */
|
||||
static Json::Value ReportCapabilities();
|
||||
|
||||
// Keep in sync with ObjectKindName.
|
||||
enum class ObjectKind
|
||||
{
|
||||
CodeModel,
|
||||
ConfigureLog,
|
||||
Cache,
|
||||
CMakeFiles,
|
||||
Toolchains,
|
||||
InternalTest
|
||||
};
|
||||
|
||||
bool AddProjectQuery(ObjectKind kind, unsigned majorVersion,
|
||||
unsigned minorVersion);
|
||||
|
||||
private:
|
||||
cmake* CMakeInstance;
|
||||
|
||||
@@ -53,17 +67,6 @@ private:
|
||||
static std::vector<std::string> LoadDir(std::string const& dir);
|
||||
void RemoveOldReplyFiles();
|
||||
|
||||
// Keep in sync with ObjectKindName.
|
||||
enum class ObjectKind
|
||||
{
|
||||
CodeModel,
|
||||
ConfigureLog,
|
||||
Cache,
|
||||
CMakeFiles,
|
||||
Toolchains,
|
||||
InternalTest
|
||||
};
|
||||
|
||||
/** Identify one object kind and major version. */
|
||||
struct Object
|
||||
{
|
||||
@@ -76,6 +79,14 @@ private:
|
||||
}
|
||||
return l.Version < r.Version;
|
||||
}
|
||||
friend bool operator==(Object const& l, Object const& r)
|
||||
{
|
||||
return l.Kind == r.Kind && l.Version == r.Version;
|
||||
}
|
||||
friend bool operator!=(Object const& l, Object const& r)
|
||||
{
|
||||
return !(l == r);
|
||||
}
|
||||
};
|
||||
|
||||
/** Represent content of a query directory. */
|
||||
|
||||
Reference in New Issue
Block a user