summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx38
1 files changed, 15 insertions, 23 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index ed0cba7..be5cfd4 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -7,6 +7,7 @@
#include <iostream>
#include <cm/iterator>
+#include <cm/memory>
#include <windows.h>
@@ -196,12 +197,12 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
if (!gen.empty()) {
// Use no actual command lines so that the target itself is not
// considered always out of date.
- cmTarget* allBuild = gen[0]->GetMakefile()->AddUtilityCommand(
- "ALL_BUILD", cmCommandOrigin::Generator, true, no_working_dir,
- no_byproducts, no_depends, no_commands, false, "Build all projects");
+ cmTarget* allBuild = gen[0]->AddUtilityCommand(
+ "ALL_BUILD", true, no_working_dir, no_byproducts, no_depends,
+ no_commands, false, "Build all projects");
- cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]);
- gen[0]->AddGeneratorTarget(gt);
+ gen[0]->AddGeneratorTarget(
+ cm::make_unique<cmGeneratorTarget>(allBuild, gen[0]));
//
// Organize in the "predefined targets" folder:
@@ -212,12 +213,12 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
// Now make all targets depend on the ALL_BUILD target
for (cmLocalGenerator const* i : gen) {
- for (cmGeneratorTarget* tgt : i->GetGeneratorTargets()) {
+ for (const auto& tgt : i->GetGeneratorTargets()) {
if (tgt->GetType() == cmStateEnums::GLOBAL_TARGET ||
tgt->IsImported()) {
continue;
}
- if (!this->IsExcluded(gen[0], tgt)) {
+ if (!this->IsExcluded(gen[0], tgt.get())) {
allBuild->AddUtility(tgt->GetName());
}
}
@@ -389,8 +390,8 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
}
for (auto const& it : this->ProjectMap) {
for (const cmLocalGenerator* i : it.second) {
- for (cmGeneratorTarget* ti : i->GetGeneratorTargets()) {
- this->ComputeVSTargetDepends(ti);
+ for (const auto& ti : i->GetGeneratorTargets()) {
+ this->ComputeVSTargetDepends(ti.get());
}
}
}
@@ -799,19 +800,9 @@ void RegisterVisualStudioMacros(const std::string& macrosFile,
bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
cmGeneratorTarget const* gt)
{
- // check to see if this is a fortran build
- {
- // Issue diagnostic if the source files depend on the config.
- std::vector<cmSourceFile*> sources;
- if (!gt->GetConfigCommonSourceFiles(sources)) {
- return false;
- }
- }
-
// If there's only one source language, Fortran has to be used
// in order for the sources to compile.
- std::set<std::string> languages;
- gt->GetLanguages(languages, "");
+ std::set<std::string> languages = gt->GetAllConfigCompileLanguages();
// Consider an explicit linker language property, but *not* the
// computed linker language that may depend on linked targets.
// This allows the project to control the language choice in
@@ -939,9 +930,10 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand(
cmCustomCommandLines commandLines = cmMakeSingleCommandLine(
{ cmakeCommand, "-E", "__create_def", mdi->DefFile, objs_file });
- cmCustomCommand command(gt->Target->GetMakefile(), outputs, empty, empty,
- commandLines, "Auto build dll exports", ".");
- commands.push_back(command);
+ cmCustomCommand command(outputs, empty, empty, commandLines,
+ gt->Target->GetMakefile()->GetBacktrace(),
+ "Auto build dll exports", ".");
+ commands.push_back(std::move(command));
}
static bool OpenSolution(std::string sln)