summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx61
1 files changed, 46 insertions, 15 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 3b1cddb..7624f78 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -42,7 +42,7 @@
#include "cmVisualStudioGeneratorOptions.h"
#include "windows.h"
-#include <cmsys/auto_ptr.hxx>
+#include <cm_auto_ptr.hxx>
cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetClFlagTable() const
{
@@ -531,7 +531,9 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
this->Configurations.begin();
i != this->Configurations.end(); ++i) {
this->WritePlatformConfigTag("LogicalName", i->c_str(), 3);
- if (this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE")) {
+ if (this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE") ||
+ // Handle variant of VS_GLOBAL_<variable> for RootNamespace.
+ this->GeneratorTarget->GetProperty("VS_GLOBAL_RootNamespace")) {
(*this->BuildFileStream) << "$(RootNamespace).";
}
(*this->BuildFileStream) << "%(Filename)";
@@ -1187,6 +1189,8 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
tool = "PRIResource";
} else if (ext == "xml") {
tool = "XML";
+ } else if (ext == "natvis") {
+ tool = "Natvis";
}
if (this->NsightTegra) {
@@ -1203,6 +1207,11 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
}
}
+ const char* toolOverride = sf->GetProperty("VS_TOOL_OVERRIDE");
+ if (toolOverride && *toolOverride) {
+ tool = toolOverride;
+ }
+
std::string deployContent;
std::string deployLocation;
if (this->GlobalGenerator->TargetsWindowsPhone() ||
@@ -1224,8 +1233,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
if (!deployContent.empty()) {
cmGeneratorExpression ge;
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(deployContent);
+ CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(deployContent);
// Deployment location cannot be set on a configuration basis
if (!deployLocation.empty()) {
this->WriteString("<Link>", 3);
@@ -1679,7 +1687,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
// copied from cmLocalVisualStudio7Generator.cxx 805
// TODO: Integrate code below with cmLocalVisualStudio7Generator.
- cmsys::auto_ptr<Options> pOptions(new Options(
+ CM_AUTO_PTR<Options> pOptions(new Options(
this->LocalGenerator, Options::Compiler, this->GetClFlagTable()));
Options& clOptions = *pOptions;
@@ -1843,7 +1851,7 @@ bool cmVisualStudio10TargetGenerator::ComputeRcOptions()
bool cmVisualStudio10TargetGenerator::ComputeRcOptions(
std::string const& configName)
{
- cmsys::auto_ptr<Options> pOptions(new Options(
+ CM_AUTO_PTR<Options> pOptions(new Options(
this->LocalGenerator, Options::ResourceCompiler, this->GetRcFlagTable()));
Options& rcOptions = *pOptions;
@@ -1900,7 +1908,7 @@ bool cmVisualStudio10TargetGenerator::ComputeMasmOptions()
bool cmVisualStudio10TargetGenerator::ComputeMasmOptions(
std::string const& configName)
{
- cmsys::auto_ptr<Options> pOptions(new Options(
+ CM_AUTO_PTR<Options> pOptions(new Options(
this->LocalGenerator, Options::MasmCompiler, this->GetMasmFlagTable()));
Options& masmOptions = *pOptions;
@@ -2053,7 +2061,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
if (const char* nativeLibDirectoriesExpression =
this->GeneratorTarget->GetProperty("ANDROID_NATIVE_LIB_DIRECTORIES")) {
cmGeneratorExpression ge;
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+ CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
ge.Parse(nativeLibDirectoriesExpression);
std::string nativeLibDirs =
cge->Evaluate(this->LocalGenerator, configName);
@@ -2066,7 +2074,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
this->GeneratorTarget->GetProperty(
"ANDROID_NATIVE_LIB_DEPENDENCIES")) {
cmGeneratorExpression ge;
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+ CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
ge.Parse(nativeLibDependenciesExpression);
std::string nativeLibDeps =
cge->Evaluate(this->LocalGenerator, configName);
@@ -2085,7 +2093,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
if (const char* jarDirectoriesExpression =
this->GeneratorTarget->GetProperty("ANDROID_JAR_DIRECTORIES")) {
cmGeneratorExpression ge;
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+ CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
ge.Parse(jarDirectoriesExpression);
std::string jarDirectories =
cge->Evaluate(this->LocalGenerator, configName);
@@ -2145,7 +2153,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions()
bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
std::string const& config)
{
- cmsys::auto_ptr<Options> pOptions(new Options(
+ CM_AUTO_PTR<Options> pOptions(new Options(
this->LocalGenerator, Options::Linker, this->GetLinkFlagTable(), 0, this));
Options& linkOptions = *pOptions;
@@ -2339,7 +2347,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
"%(IgnoreSpecificDefaultLibraries)");
}
- if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
+ if ((this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
+ this->GeneratorTarget->IsExecutableWithExports()) &&
this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) {
if (this->GeneratorTarget->GetPropertyAsBool(
"WINDOWS_EXPORT_ALL_SYMBOLS")) {
@@ -2354,7 +2363,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
cmGlobalVisualStudio10Generator* gg =
static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator);
const char* toolset = gg->GetPlatformToolset();
- if (toolset && (cmHasLiteralPrefix(toolset, "v100") ||
+ if (toolset && (cmHasLiteralPrefix(toolset, "v90") ||
+ cmHasLiteralPrefix(toolset, "v100") ||
cmHasLiteralPrefix(toolset, "v110") ||
cmHasLiteralPrefix(toolset, "v120"))) {
if (const char* debug =
@@ -2502,7 +2512,8 @@ void cmVisualStudio10TargetGenerator::WriteEvents(
std::string const& configName)
{
bool addedPrelink = false;
- if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
+ if ((this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
+ this->GeneratorTarget->IsExecutableWithExports()) &&
this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) {
if (this->GeneratorTarget->GetPropertyAsBool(
"WINDOWS_EXPORT_ALL_SYMBOLS")) {
@@ -2643,6 +2654,20 @@ void cmVisualStudio10TargetGenerator::WriteSinglePlatformExtension(
void cmVisualStudio10TargetGenerator::WriteSDKReferences()
{
+ std::vector<std::string> sdkReferences;
+ bool hasWrittenItemGroup = false;
+ if (const char* vsSDKReferences =
+ this->GeneratorTarget->GetProperty("VS_SDK_REFERENCES")) {
+ cmSystemTools::ExpandListArgument(vsSDKReferences, sdkReferences);
+ this->WriteString("<ItemGroup>\n", 1);
+ hasWrittenItemGroup = true;
+ for (std::vector<std::string>::iterator ri = sdkReferences.begin();
+ ri != sdkReferences.end(); ++ri) {
+ this->WriteString("<SDKReference Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(*ri) << "\"/>\n";
+ }
+ }
+
// This only applies to Windows 10 apps
if (this->GlobalGenerator->TargetsWindowsStore() &&
cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0")) {
@@ -2655,7 +2680,10 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences()
if (desktopExtensionsVersion || mobileExtensionsVersion ||
iotExtensionsVersion) {
- this->WriteString("<ItemGroup>\n", 1);
+ if (!hasWrittenItemGroup) {
+ this->WriteString("<ItemGroup>\n", 1);
+ hasWrittenItemGroup = true;
+ }
if (desktopExtensionsVersion) {
this->WriteSingleSDKReference("WindowsDesktop",
desktopExtensionsVersion);
@@ -2667,6 +2695,9 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences()
if (iotExtensionsVersion) {
this->WriteSingleSDKReference("WindowsIoT", iotExtensionsVersion);
}
+ }
+
+ if (hasWrittenItemGroup) {
this->WriteString("</ItemGroup>\n", 1);
}
}