From 1d2d9ec6aaeddcc189e413be82757fa63cffced4 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Wed, 30 Dec 2009 16:04:59 +0000
Subject: Commit patch 2 "Simplify createBuildProp code" from fr #2891357
"create_msvc: Add support for MSVC10".
svn-id: r46758
---
tools/create_msvc/create_msvc.cpp | 138 ++++++++++----------------------------
1 file changed, 34 insertions(+), 104 deletions(-)
(limited to 'tools/create_msvc/create_msvc.cpp')
diff --git a/tools/create_msvc/create_msvc.cpp b/tools/create_msvc/create_msvc.cpp
index ebe7bb7536..9c69453eeb 100644
--- a/tools/create_msvc/create_msvc.cpp
+++ b/tools/create_msvc/create_msvc.cpp
@@ -217,8 +217,10 @@ public:
* Generates the project properties for debug and release settings.
*
* @param setup Description of the desired build setup.
+ * @param isRelease Type of property file
+ * @param isWin32 Bitness of property file
*/
- virtual void createBuildProp(const BuildSetup &setup) = 0;
+ virtual void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32) = 0;
/**
* Get the file extension for project files
@@ -282,7 +284,7 @@ public:
void outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix);
- void createBuildProp(const BuildSetup &setup);
+ void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32);
const char *getProjectExtension();
const char *getPropertiesExtension();
@@ -898,8 +900,11 @@ void ProjectProvider::createMSVCProject(const BuildSetup &setup) {
// Create the global property file
createGlobalProp(setup);
- // Create the configuration property files
- createBuildProp(setup);
+ // Create the configuration property files (for Debug and Release with 32 and 64bits versions)
+ createBuildProp(setup, true, false);
+ createBuildProp(setup, true, true);
+ createBuildProp(setup, false, false);
+ createBuildProp(setup, false, true);
}
void ProjectProvider::createScummVMSolution(const BuildSetup &setup) {
@@ -1565,130 +1570,55 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
properties.flush();
}
-void VisualStudioProvider::createBuildProp(const BuildSetup &setup) {
- std::ofstream properties((setup.outputDir + '/' + "ScummVM_Debug" + getPropertiesExtension()).c_str());
+void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32) {
+ const std::string outputType = (isRelease ? "Release" : "Debug");
+ const std::string outputBitness = (isWin32 ? "32" : "64");
+
+ std::ofstream properties((setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
if (!properties)
- error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Debug" + + getPropertiesExtension() + "\" for writing");
+ error("Could not open \"" + setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing");
properties << "\n"
"\n"
"\t\n"
"\t\n"
- "\n";
-
- properties.flush();
- properties.close();
-
- properties.open((setup.outputDir + '/' + "ScummVM_Debug64" + getPropertiesExtension()).c_str());
- if (!properties)
- error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Debug64" + getPropertiesExtension() + "\" for writing");
-
- properties << "\n"
- "\n"
- "\t\n"
"\t\n"
- "\n";
-
- properties.flush();
- properties.close();
-
- properties.open((setup.outputDir + '/' + "ScummVM_Release" + getPropertiesExtension()).c_str());
- if (!properties)
- error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Release" + getPropertiesExtension() + "\" for writing");
-
- properties << "\n"
- "\n"
- "\t\n"
- "\t\n"
- "\n";
-
- properties.flush();
- properties.close();
-
- properties.open((setup.outputDir + '/' + "ScummVM_Release64" + getPropertiesExtension()).c_str());
- if (!properties)
- error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Release64" + getPropertiesExtension() + "\" for writing");
+ "\t\tIgnoreDefaultLibraryNames=\"libcmt.lib\"\n";
+ }
- properties << "\n"
- "\n"
- "\t\n"
- "\t\n"
+ properties << "\t/>\n"
"\n";
properties.flush();
--
cgit v1.2.3