mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
cmake --build: Convert implementation to internal role
Previously it initialized as `PROJECT` to support reconfiguration with VS generators, but didn't actually add any commands until needed. Instead initialize as the `INTERNAL` role and update when adding commands.
This commit is contained in:
@@ -812,6 +812,11 @@ unsigned int cmState::GetCacheMinorVersion() const
|
|||||||
return this->CacheManager->GetCacheMinorVersion();
|
return this->CacheManager->GetCacheMinorVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmState::SetRoleToProjectForCMakeBuildVsReconfigure()
|
||||||
|
{
|
||||||
|
this->StateRole = Role::Project;
|
||||||
|
}
|
||||||
|
|
||||||
cmState::Role cmState::GetRole() const
|
cmState::Role cmState::GetRole() const
|
||||||
{
|
{
|
||||||
return this->StateRole;
|
return this->StateRole;
|
||||||
|
|||||||
@@ -231,6 +231,7 @@ public:
|
|||||||
unsigned int GetCacheMajorVersion() const;
|
unsigned int GetCacheMajorVersion() const;
|
||||||
unsigned int GetCacheMinorVersion() const;
|
unsigned int GetCacheMinorVersion() const;
|
||||||
|
|
||||||
|
void SetRoleToProjectForCMakeBuildVsReconfigure();
|
||||||
Role GetRole() const;
|
Role GetRole() const;
|
||||||
std::string GetRoleString() const;
|
std::string GetRoleString() const;
|
||||||
|
|
||||||
|
|||||||
@@ -4014,6 +4014,8 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
|
|||||||
// Note that the stampList file only exists for VS generators.
|
// Note that the stampList file only exists for VS generators.
|
||||||
if (cmSystemTools::FileExists(stampList) &&
|
if (cmSystemTools::FileExists(stampList) &&
|
||||||
!cmakeCheckStampList(stampList)) {
|
!cmakeCheckStampList(stampList)) {
|
||||||
|
// Upgrade cmake role from --build to reconfigure the project.
|
||||||
|
this->State->SetRoleToProjectForCMakeBuildVsReconfigure();
|
||||||
this->AddScriptingCommands();
|
this->AddScriptingCommands();
|
||||||
this->AddProjectCommands();
|
this->AddProjectCommands();
|
||||||
|
|
||||||
|
|||||||
@@ -680,7 +680,7 @@ int do_build(int ac, char const* const* av)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmake cm(cmake::CommandSet::None, cmState::Role::Project);
|
cmake cm(cmake::CommandSet::None, cmState::Role::Internal);
|
||||||
cmSystemTools::SetMessageCallback(
|
cmSystemTools::SetMessageCallback(
|
||||||
[&cm](std::string const& msg, cmMessageMetadata const& md) {
|
[&cm](std::string const& msg, cmMessageMetadata const& md) {
|
||||||
cmakemainMessageCallback(msg, md, &cm);
|
cmakemainMessageCallback(msg, md, &cm);
|
||||||
|
|||||||
Reference in New Issue
Block a user