summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx46
1 files changed, 35 insertions, 11 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 6296dd2..354ada9 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -10,6 +10,7 @@
#include "cmLocalVisualStudioGenerator.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
+#include "cmState.h"
#include "cmTarget.h"
#include <cmsys/Encoding.hxx>
@@ -81,7 +82,8 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
t != targets.end(); ++t) {
cmGeneratorTarget* tgt = *t;
- if (tgt->GetType() == cmState::GLOBAL_TARGET || tgt->IsImported()) {
+ if (tgt->GetType() == cmStateEnums::GLOBAL_TARGET ||
+ tgt->IsImported()) {
continue;
}
if (!this->IsExcluded(gen[0], tgt)) {
@@ -265,11 +267,11 @@ cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmGeneratorTarget* target)
void cmGlobalVisualStudioGenerator::FollowLinkDepends(
const cmGeneratorTarget* target, std::set<const cmGeneratorTarget*>& linked)
{
- if (target->GetType() == cmState::INTERFACE_LIBRARY) {
+ if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
return;
}
if (linked.insert(target).second &&
- target->GetType() == cmState::STATIC_LIBRARY) {
+ target->GetType() == cmStateEnums::STATIC_LIBRARY) {
// Static library targets do not list their link dependencies so
// we must follow them transitively now.
TargetDependSet const& depends = this->GetTargetDirectDepends(target);
@@ -304,7 +306,7 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
static bool VSLinkable(cmGeneratorTarget const* t)
{
- return t->IsLinkable() || t->GetType() == cmState::OBJECT_LIBRARY;
+ return t->IsLinkable() || t->GetType() == cmStateEnums::OBJECT_LIBRARY;
}
void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(
@@ -333,10 +335,10 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(
// leaving them out for the static library itself but following them
// transitively for other targets.
- bool allowLinkable = (target->GetType() != cmState::STATIC_LIBRARY &&
- target->GetType() != cmState::SHARED_LIBRARY &&
- target->GetType() != cmState::MODULE_LIBRARY &&
- target->GetType() != cmState::EXECUTABLE);
+ bool allowLinkable = (target->GetType() != cmStateEnums::STATIC_LIBRARY &&
+ target->GetType() != cmStateEnums::SHARED_LIBRARY &&
+ target->GetType() != cmStateEnums::MODULE_LIBRARY &&
+ target->GetType() != cmStateEnums::EXECUTABLE);
TargetDependSet const& depends = this->GetTargetDirectDepends(target);
@@ -344,7 +346,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(
// Static libraries cannot depend on their link implementation
// due to behavior (2), but they do not really need to.
std::set<cmGeneratorTarget const*> linkDepends;
- if (target->GetType() != cmState::STATIC_LIBRARY) {
+ if (target->GetType() != cmStateEnums::STATIC_LIBRARY) {
for (TargetDependSet::const_iterator di = depends.begin();
di != depends.end(); ++di) {
cmTargetDepend dep = *di;
@@ -367,7 +369,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(
// Collect all targets linked by this target so we can avoid
// intermediate targets below.
TargetSet linked;
- if (target->GetType() != cmState::STATIC_LIBRARY) {
+ if (target->GetType() != cmStateEnums::STATIC_LIBRARY) {
linked = this->GetTargetLinkClosure(target);
}
@@ -393,7 +395,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(
}
}
-void cmGlobalVisualStudioGenerator::FindMakeProgram(cmMakefile* mf)
+bool cmGlobalVisualStudioGenerator::FindMakeProgram(cmMakefile* mf)
{
// Visual Studio generators know how to lookup their build tool
// directly instead of needing a helper module to do it, so we
@@ -401,6 +403,7 @@ void cmGlobalVisualStudioGenerator::FindMakeProgram(cmMakefile* mf)
if (cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
mf->AddDefinition("CMAKE_MAKE_PROGRAM", this->GetVSMakeProgram().c_str());
}
+ return true;
}
std::string cmGlobalVisualStudioGenerator::GetUtilityDepend(
@@ -734,6 +737,27 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
return false;
}
+bool cmGlobalVisualStudioGenerator::TargetIsCSharpOnly(
+ cmGeneratorTarget const* gt)
+{
+ // check to see if this is a C# build
+ std::set<std::string> languages;
+ {
+ // Issue diagnostic if the source files depend on the config.
+ std::vector<cmSourceFile*> sources;
+ if (!gt->GetConfigCommonSourceFiles(sources)) {
+ return false;
+ }
+ }
+ gt->GetLanguages(languages, "");
+ if (languages.size() == 1) {
+ if (*languages.begin() == "CSharp") {
+ return true;
+ }
+ }
+ return false;
+}
+
bool cmGlobalVisualStudioGenerator::TargetCompare::operator()(
cmGeneratorTarget const* l, cmGeneratorTarget const* r) const
{