From 74d28bf8e74b693157960883163cf5449b433236 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 25 Dec 2009 01:00:17 +0000 Subject: Commit of patch #2909981 "create_msvc: Updated default warnings + per-project warnings" with some slight changes. svn-id: r46540 --- tools/create_msvc/create_msvc.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/create_msvc/create_msvc.cpp b/tools/create_msvc/create_msvc.cpp index 62ad3267ac..ec54129ff8 100644 --- a/tools/create_msvc/create_msvc.cpp +++ b/tools/create_msvc/create_msvc.cpp @@ -88,6 +88,11 @@ std::string getLastPathComponent(const std::string &path); * @param exe Name of the executable. */ void displayHelp(const char *exe); + +// Map containing a project-specific list of warnings +// TODO: Remove the use of global variables +std::map g_projectWarnings; +std::string g_globalWarnings; } // End of anonymous namespace int main(int argc, char *argv[]) { @@ -241,6 +246,13 @@ int main(int argc, char *argv[]) { setup.libraries.push_back("winmm.lib"); setup.libraries.push_back("sdl.lib"); + // Initialize global & project-specific warnings + g_globalWarnings = "4068;4100;4103;4127;4244;4250;4310;4351;4512;4702;4706;4800;4996"; + + g_projectWarnings["agi"] = "4510;4610"; + g_projectWarnings["lure"] = "4189;4355"; + g_projectWarnings["kyra"] = "4355"; + createMSVCProject(setup, msvcVersion); } @@ -841,6 +853,9 @@ void createProjectFile(const std::string &name, const std::string &uuid, const B "\t\n" "\t\n"; + // Check for project-specific warnings: + std::map::iterator warnings = g_projectWarnings.find(name); + if (name == "scummvm") { std::string libraries; @@ -877,6 +892,21 @@ void createProjectFile(const std::string &name, const std::string &uuid, const B "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" "\t\t\t/>\n" "\t\t\n"; + } else if (warnings != g_projectWarnings.end()) { + // Win32 + project << "\t\t\n" + "\t\t\tsecond << "\" />\n" + "\t\t\n" + "\t\t\n" + "\t\t\tsecond << "\" />\n" + "\t\t\n"; + // x64 + project << "\t\t\n" + "\t\t\tsecond << "\" />\n" + "\t\t\n" + "\t\t\n" + "\t\t\tsecond << "\" />\n" + "\t\t\n"; } else if (name == "tinsel") { // Win32 project << "\t\t\n" @@ -940,7 +970,7 @@ void outputGlobalPropFile(std::ofstream &properties, int bits, const std::string "\t