diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index a13cbd29b..15d098060 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -180,7 +180,8 @@ cmVisualStudio10TargetGenerator(cmTarget* target, this->GlobalGenerator->CreateGUID(this->Name.c_str()); this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str()); this->Platform = gg->GetPlatformName(); - this->MSTools = true; + this->NsightTegra = gg->IsNsightTegra(); + this->MSTools = !this->NsightTegra; this->TargetCompileAsWinRT = false; this->BuildFileStream = 0; this->IsMissingFiles = false; @@ -312,6 +313,15 @@ void cmVisualStudio10TargetGenerator::Generate() "xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"); this->WriteString(project_defaults.c_str(),0); + if(this->NsightTegra) + { + this->WriteString("\n", 1); + this->WriteString("" + "6" + "\n", 2); + this->WriteString("\n", 1); + } + this->WriteProjectConfigurations(); this->WriteString("\n", 1); this->WriteString("", 2); @@ -605,11 +615,27 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() configType += "StaticLibrary"; break; case cmTarget::EXECUTABLE: - configType += "Application"; + if(this->NsightTegra) + { + // Android executables are .so too. + configType += "DynamicLibrary"; + } + else + { + configType += "Application"; + } break; case cmTarget::UTILITY: case cmTarget::GLOBAL_TARGET: - configType += "Utility"; + if(this->NsightTegra) + { + // Tegra-Android platform does not understand "Utility". + configType += "StaticLibrary"; + } + else + { + configType += "Utility"; + } break; case cmTarget::UNKNOWN_LIBRARY: case cmTarget::INTERFACE_LIBRARY: @@ -622,6 +648,10 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() { this->WriteMSToolConfigurationValues(*i); } + else if(this->NsightTegra) + { + this->WriteNsightTegraConfigurationValues(*i); + } this->WriteString("\n", 1); } @@ -683,6 +713,19 @@ void cmVisualStudio10TargetGenerator } } +//---------------------------------------------------------------------------- +void cmVisualStudio10TargetGenerator +::WriteNsightTegraConfigurationValues(std::string const&) +{ + cmGlobalVisualStudio10Generator* gg = + static_cast(this->GlobalGenerator); + const char* toolset = gg->GetPlatformToolset(); + std::string ntv = ""; + ntv += toolset? toolset : "Default"; + ntv += "\n"; + this->WriteString(ntv.c_str(), 2); +} + void cmVisualStudio10TargetGenerator::WriteCustomCommands() { this->SourcesVisited.clear(); @@ -2188,6 +2231,10 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) linkOptions.AppendFlag("IgnoreSpecificDefaultLibraries", "ole32.lib"); } } + else if(this->NsightTegra) + { + linkOptions.AddFlag("SoName", targetNameSO.c_str()); + } linkOptions.Parse(flags.c_str()); diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index d6db18a2f..8887d14d9 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -59,6 +59,7 @@ private: void WriteMSToolConfigurationValues(std::string const& config); void WriteHeaderSource(cmSourceFile const* sf); void WriteExtraSource(cmSourceFile const* sf); + void WriteNsightTegraConfigurationValues(std::string const& config); void WriteSource(std::string const& tool, cmSourceFile const* sf, const char* end = 0); void WriteSources(std::string const& tool, @@ -139,6 +140,7 @@ private: std::string GUID; std::string Name; bool MSTools; + bool NsightTegra; bool TargetCompileAsWinRT; cmGlobalVisualStudio10Generator* GlobalGenerator; cmGeneratedFileStream* BuildFileStream;