cmTarget: Replace "perConfig" constructor boolean with enum
This commit is contained in:
parent
d7e82a11d5
commit
d6a88d2158
@ -71,7 +71,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
|
||||
|
||||
cmTarget dummyHead("try_compile_dummy_exe", cmStateEnums::EXECUTABLE,
|
||||
cmTarget::VisibilityNormal, tgt->Target->GetMakefile(),
|
||||
true);
|
||||
cmTarget::PerConfig::Yes);
|
||||
|
||||
cmGeneratorTarget gDummyHead(&dummyHead, tgt->GetLocalGenerator());
|
||||
|
||||
|
@ -2535,7 +2535,7 @@ void cmGlobalGenerator::AddGlobalTarget_EditCache(
|
||||
}
|
||||
GlobalTargetInfo gti;
|
||||
gti.Name = editCacheTargetName;
|
||||
gti.PerConfig = false;
|
||||
gti.PerConfig = cmTarget::PerConfig::No;
|
||||
cmCustomCommandLine singleLine;
|
||||
|
||||
// Use generator preference for the edit_cache rule if it is defined.
|
||||
@ -2571,7 +2571,7 @@ void cmGlobalGenerator::AddGlobalTarget_RebuildCache(
|
||||
gti.Name = rebuildCacheTargetName;
|
||||
gti.Message = "Running CMake to regenerate build system...";
|
||||
gti.UsesTerminal = true;
|
||||
gti.PerConfig = false;
|
||||
gti.PerConfig = cmTarget::PerConfig::No;
|
||||
cmCustomCommandLine singleLine;
|
||||
singleLine.push_back(cmSystemTools::GetCMakeCommand());
|
||||
singleLine.push_back("--regenerate-during-build");
|
||||
|
@ -553,7 +553,7 @@ protected:
|
||||
std::vector<std::string> Depends;
|
||||
std::string WorkingDir;
|
||||
bool UsesTerminal = false;
|
||||
bool PerConfig = true;
|
||||
cmTarget::PerConfig PerConfig = cmTarget::PerConfig::Yes;
|
||||
bool StdPipesUTF8 = false;
|
||||
};
|
||||
|
||||
|
@ -2081,11 +2081,11 @@ cmTarget* cmMakefile::AddExecutable(const std::string& exeName,
|
||||
cmTarget* cmMakefile::AddNewTarget(cmStateEnums::TargetType type,
|
||||
const std::string& name)
|
||||
{
|
||||
auto it =
|
||||
this->Targets
|
||||
.emplace(name,
|
||||
cmTarget(name, type, cmTarget::VisibilityNormal, this, true))
|
||||
.first;
|
||||
auto it = this->Targets
|
||||
.emplace(name,
|
||||
cmTarget(name, type, cmTarget::VisibilityNormal, this,
|
||||
cmTarget::PerConfig::Yes))
|
||||
.first;
|
||||
this->OrderedTargets.push_back(&it->second);
|
||||
this->GetGlobalGenerator()->IndexTarget(&it->second);
|
||||
this->GetStateSnapshot().GetDirectory().AddNormalTargetName(name);
|
||||
@ -4261,7 +4261,7 @@ cmTarget* cmMakefile::AddImportedTarget(const std::string& name,
|
||||
new cmTarget(name, type,
|
||||
global ? cmTarget::VisibilityImportedGlobally
|
||||
: cmTarget::VisibilityImported,
|
||||
this, true));
|
||||
this, cmTarget::PerConfig::Yes));
|
||||
|
||||
// Add to the set of available imported targets.
|
||||
this->ImportedTargets[name] = target.get();
|
||||
|
@ -215,7 +215,7 @@ public:
|
||||
};
|
||||
|
||||
cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
||||
Visibility vis, cmMakefile* mf, bool perConfig)
|
||||
Visibility vis, cmMakefile* mf, PerConfig perConfig)
|
||||
: impl(cm::make_unique<cmTargetInternals>())
|
||||
{
|
||||
assert(mf);
|
||||
@ -231,7 +231,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
||||
(vis == VisibilityImported || vis == VisibilityImportedGlobally);
|
||||
impl->ImportedGloballyVisible = vis == VisibilityImportedGlobally;
|
||||
impl->BuildInterfaceIncludesAppended = false;
|
||||
impl->PerConfig = perConfig;
|
||||
impl->PerConfig = (perConfig == PerConfig::Yes);
|
||||
|
||||
// Check whether this is a DLL platform.
|
||||
impl->IsDLLPlatform =
|
||||
|
@ -45,8 +45,14 @@ public:
|
||||
VisibilityImportedGlobally
|
||||
};
|
||||
|
||||
enum class PerConfig
|
||||
{
|
||||
Yes,
|
||||
No
|
||||
};
|
||||
|
||||
cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
||||
Visibility vis, cmMakefile* mf, bool perConfig);
|
||||
Visibility vis, cmMakefile* mf, PerConfig perConfig);
|
||||
|
||||
cmTarget(cmTarget const&) = delete;
|
||||
cmTarget(cmTarget&&) noexcept;
|
||||
|
Loading…
Reference in New Issue
Block a user