From 89dfd36b60f5ea2cc96aa0a0381b148e75e4a0c9 Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Mon, 28 Sep 2015 19:23:58 -0400
Subject: CREATE_PROJECT: Add support for Visual Studio 2015
---
devtools/create_project/msbuild.cpp | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
(limited to 'devtools/create_project/msbuild.cpp')
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index 87c9066199..4698ebd303 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -55,9 +55,16 @@ int MSBuildProvider::getVisualStudioVersion() {
if (_version == 12)
return 2013;
+ if (_version == 14)
+ return 14;
+
error("Unsupported version passed to getVisualStudioVersion");
}
+int MSBuildProvider::getSolutionVersion() {
+ return (_version < 14) ? _version + 1 : _version;
+}
+
namespace {
inline void outputConfiguration(std::ostream &project, const std::string &config, const std::string &platform) {
@@ -116,7 +123,7 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
// Shared configuration
project << "\t\n";
- std::string version = "v" + toString(_version) + "0";
+ std::string version = "v" + toString(_version) + "0";
std::string llvm = "LLVM-vs" + toString(getVisualStudioVersion());
outputConfigurationType(setup, project, name, "Release|Win32", version);
@@ -177,6 +184,13 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
project << "\t\n";
}
+ // Visual Studio 2015 automatically imports natvis files that are part of the project
+ if (name == PROJECT_NAME && _version == 14) {
+ project << "\t\n";
+ project << "\t\t\n";
+ project << "\t\n";
+ }
+
project << "\t\n"
"\t\n"
"\t\n";
@@ -185,7 +199,7 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
// We override the normal target to ignore the exit code (this allows us to have a clean output and not message about the command exit code)
project << "\t\t\n"
<< "\t\t\t\n"
- << "\t\t\t\n"
+ << "\t\t\t\n"
<< "\t\t\n";
}
@@ -305,6 +319,13 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i)
libraries += *i + ".lib;";
+ if (_version == 14)
+ {
+ std::string debug = isRelease ? "" : "d";
+ libraries += "libvcruntime" + debug + ".lib;";
+ libraries += "libucrt" + debug + ".lib;";
+ }
+
project << "\t\t\n"
"\t\t\t$(OutDir)" << ((setup.devTools || setup.tests) ? name : setup.projectName) << ".exe\n"
"\t\t\t" << libraries << "%(AdditionalDependencies)\n"
@@ -362,7 +383,7 @@ void MSBuildProvider::outputGlobalPropFile(const BuildSetup &setup, std::ofstrea
"\t\t\t" << warnings << ";%(DisableSpecificWarnings)\n"
"\t\t\t$(" << LIBS_DEFINE << ")\\include;.;" << prefix << ";" << prefix << "\\engines;" << (setup.tests ? prefix + "\\test\\cxxtest;" : "") << "$(TargetDir);%(AdditionalIncludeDirectories)\n"
"\t\t\t" << definesList << "%(PreprocessorDefinitions)\n"
- "\t\t\t" << ((setup.devTools || setup.tests) ? "Sync" : "") << "\n";
+ "\t\t\t" << ((setup.devTools || setup.tests || _version == 14) ? "Sync" : "") << "\n";
#if NEEDS_RTTI
properties << "\t\t\ttrue\n";
--
cgit v1.2.3