Ticket #9120: create_msvc_disable_warnings.patch

File create_msvc_disable_warnings.patch, 3.4 KB (added by Templier, 14 years ago)

Updated patch for create_msvc

  • tools/create_msvc/create_msvc.cpp

     
    9090void displayHelp(const char *exe);
    9191} // End of anonymous namespace
    9292
     93// Map containing a project-specific list of warnings
     94static std::map<std::string, std::string> project_warnings;
     95static std::string global_warnings;
     96
    9397int main(int argc, char *argv[]) {
    9498#if !(defined(_WIN32) || defined(WIN32))
    9599        // Initialize random number generator for UUID creation
     
    241245        setup.libraries.push_back("winmm.lib");
    242246        setup.libraries.push_back("sdl.lib");
    243247
     248        // Initialize global & project-specific warnings
     249        global_warnings = "4068;4100;4103;4127;4244;4250;4310;4351;4512;4702;4706;4800;4996";
     250
     251        project_warnings["agi"] = "4510;4610";
     252        project_warnings["lure"] = "4189";
     253
    244254        createMSVCProject(setup, msvcVersion);
    245255}
    246256
     
    841851                   "\t</Platforms>\n"
    842852                   "\t<Configurations>\n";
    843853
     854        // Check for project-specific warnings:
     855        std::map<std::string, std::string>::iterator warnings = project_warnings.find(name);
     856
    844857        if (name == "scummvm") {
    845858                std::string libraries;
    846859
     
    877890                           "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n"
    878891                           "\t\t\t/>\n"
    879892                           "\t\t</Configuration>\n";
     893        } else if (warnings != project_warnings.end()) {
     894                // Win32
     895                project << "\t\t<Configuration Name=\"Debug|Win32\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_Debug.vsprops\">\n"
     896                           "\t\t\t<Tool Name=\"VCCLCompilerTool\" DisableSpecificWarnings=\"" << warnings->second << "\" />\n"
     897                           "\t\t</Configuration>\n"
     898                           "\t\t<Configuration Name=\"Release|Win32\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_Release.vsprops\">\n"
     899                                   "\t\t\t<Tool Name=\"VCCLCompilerTool\" DisableSpecificWarnings=\"" << warnings->second << "\" />\n"
     900                                   "\t\t</Configuration>\n";
     901                // x64
     902                project << "\t\t<Configuration Name=\"Debug|x64\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_Debug64.vsprops\">\n"
     903                           "\t\t\t<Tool Name=\"VCCLCompilerTool\" DisableSpecificWarnings=\"" << warnings->second << "\" />\n"
     904                           "\t\t</Configuration>\n"
     905                           "\t\t<Configuration Name=\"Release|x64\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_Release64.vsprops\">\n"
     906                                   "\t\t\t<Tool Name=\"VCCLCompilerTool\" DisableSpecificWarnings=\"" << warnings->second << "\" />\n"
     907                                   "\t\t</Configuration>\n";
    880908        } else if (name == "tinsel") {
    881909                // Win32
    882910                project << "\t\t<Configuration Name=\"Debug|Win32\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_Debug.vsprops\">\n"
     
    940968                      "\t<Tool\n"
    941969                      "\t\tName=\"VCCLCompilerTool\"\n"
    942970                      "\t\tDisableLanguageExtensions=\"true\"\n"
    943                       "\t\tDisableSpecificWarnings=\"4068;4100;4103;4121;4127;4189;4201;4221;4244;4250;4267;4310;4351;4355;4510;4511;4512;4610;4701;4702;4706;4800;4996\"\n"
     971                      "\t\tDisableSpecificWarnings=\"" << global_warnings << "\"\n"
    944972                      "\t\tAdditionalIncludeDirectories=\"" << prefix << ";" << prefix << "\\engines\"\n"
    945973                      "\t\tPreprocessorDefinitions=\"" << defines << "\"\n"
    946974                      "\t\tExceptionHandling=\"0\"\n"