Ticket #9137: TOOLS - Add analysis build configuration.patch

File TOOLS - Add analysis build configuration.patch, 23.2 KB (added by Templier, 9 years ago)

5 - Add support for analysis build configuration

  • tools/create_project/create_project.cpp

    # HG changeset patch
    # Parent 899cc75a29a44b6aae92faee0a7304a352970dc4
    TOOLS: Add analysis build configuration to create_project
    
    diff -r 899cc75a29a4 tools/create_project/create_project.cpp
    a b  
    380380                // 4996 ('function': was declared deprecated)
    381381                //   disabling it removes all the non-standard unsafe functions warnings (strcpy_s, etc.)
    382382                //
     383                // 6211 (Leaking memory <pointer> due to an exception. Consider using a local catch block to clean up memory)
     384                //   we disable exceptions
     385                //
     386                // 6204 (possible buffer overrun in call to <function>: use of unchecked parameter <variable>)
     387                // 6385 (invalid data: accessing <buffer name>, the readable size is <size1> bytes, but <size2> bytes may be read)
     388                // 6386 (buffer overrun: accessing <buffer name>, the writable size is <size1> bytes, but <size2> bytes may be written)
     389                //   give way too many false positives
     390                //
    383391                ////////////////////////////////////////////////////////////////////////////
    384392                //
    385393                // 4189 (local variable is initialized but not referenced)
     
    397405                //
    398406                ////////////////////////////////////////////////////////////////////////////
    399407
    400                 SET_GLOBAL_WARNINGS("4068", "4100", "4103", "4127", "4244", "4250", "4310", "4351", "4512", "4702", "4706", "4800", "4996");
     408                SET_GLOBAL_WARNINGS("4068", "4100", "4103", "4127", "4244", "4250", "4310", "4351", "4512", "4702", "4706", "4800", "4996", "6204", "6211", "6385", "6386");
    401409                SET_WARNINGS("agi", "4510", "4610");
    402410                SET_WARNINGS("agos", "4511");
    403411                SET_WARNINGS("lure", "4189", "4355");
  • tools/create_project/msvc.cpp

    diff -r 899cc75a29a4 tools/create_project/msvc.cpp
    a b  
    7575        solution << "Global\n"
    7676                    "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n"
    7777                    "\t\tDebug|Win32 = Debug|Win32\n"
     78                                "\t\tAnalysis|Win32 = Analysis|Win32\n"
    7879                    "\t\tRelease|Win32 = Release|Win32\n"
    79                      "\t\tDebug|x64 = Debug|x64\n"
     80                    "\t\tDebug|x64 = Debug|x64\n"
     81                                "\t\tAnalysis|x64 = Analysis|x64\n"
    8082                    "\t\tRelease|x64 = Release|x64\n"
    8183                    "\tEndGlobalSection\n"
    8284                    "\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n";
    8385
    8486        for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
    8587                solution << "\t\t{" << i->second << "}.Debug|Win32.ActiveCfg = Debug|Win32\n"
    86                          << "\t\t{" << i->second << "}.Debug|Win32.Build.0 = Debug|Win32\n"
    87                          << "\t\t{" << i->second << "}.Release|Win32.ActiveCfg = Release|Win32\n"
    88                          << "\t\t{" << i->second << "}.Release|Win32.Build.0 = Release|Win32\n"
    89                          << "\t\t{" << i->second << "}.Debug|x64.ActiveCfg = Debug|x64\n"
    90                          << "\t\t{" << i->second << "}.Debug|x64.Build.0 = Debug|x64\n"
    91                          << "\t\t{" << i->second << "}.Release|x64.ActiveCfg = Release|x64\n"
    92                          << "\t\t{" << i->second << "}.Release|x64.Build.0 = Release|x64\n";
     88                            "\t\t{" << i->second << "}.Debug|Win32.Build.0 = Debug|Win32\n"
     89                                        "\t\t{" << i->second << "}.Analysis|Win32.ActiveCfg = Analysis|Win32\n"
     90                                        "\t\t{" << i->second << "}.Analysis|Win32.Build.0 = Analysis|Win32\n"
     91                            "\t\t{" << i->second << "}.Release|Win32.ActiveCfg = Release|Win32\n"
     92                            "\t\t{" << i->second << "}.Release|Win32.Build.0 = Release|Win32\n"
     93                            "\t\t{" << i->second << "}.Debug|x64.ActiveCfg = Debug|x64\n"
     94                            "\t\t{" << i->second << "}.Debug|x64.Build.0 = Debug|x64\n"
     95                                        "\t\t{" << i->second << "}.Analysis|x64.ActiveCfg = Analysis|x64\n"
     96                                        "\t\t{" << i->second << "}.Analysis|x64.Build.0 = Analysis|x64\n"
     97                            "\t\t{" << i->second << "}.Release|x64.ActiveCfg = Release|x64\n"
     98                            "\t\t{" << i->second << "}.Release|x64.Build.0 = Release|x64\n";
    9399        }
    94100
    95101        solution << "\tEndGlobalSection\n"
     
    104110        createGlobalProp(setup);
    105111
    106112        // Create the configuration property files (for Debug and Release with 32 and 64bits versions)
    107         createBuildProp(setup, true, false);
    108         createBuildProp(setup, true, true);
    109         createBuildProp(setup, false, false);
    110         createBuildProp(setup, false, true);
     113        // Note: we use the debug properties for the analysis configuration
     114        createBuildProp(setup, true, false, false);
     115        createBuildProp(setup, true, true, false);
     116        createBuildProp(setup, false, false, false);
     117        createBuildProp(setup, false, false, true);
     118        createBuildProp(setup, false, true, false);
     119        createBuildProp(setup, false, true, true);
    111120}
    112121
    113122void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
     
    197206        error("Unsupported version passed to createScummVMSolution");
    198207}
    199208
     209#define OUTPUT_CONFIGURATION_SCUMMVM(config, platform, props) { \
     210        project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\ScummVM_" << config << props << ".vsprops\">\n" \
     211                   "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \
     212                   "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/scummvm.exe\"\n" \
     213                   "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \
     214                   "\t\t\t/>\n" \
     215                   "\t\t</Configuration>\n"; \
     216}
     217
     218#define OUTPUT_CONFIGURATION_SCUMMVM_DEBUG(config, platform, props, isWin32) { \
     219        project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\ScummVM_" << config << props << ".vsprops\">\n" \
     220                   "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \
     221                   "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/scummvm.exe\"\n" \
     222                   "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \
     223                   "\t\t\t/>\n" \
     224                   "\t\t\t<Tool\tName=\"VCPreBuildEventTool\"\n" \
     225                   "\t\t\t\tCommandLine=\"" << getRevisionToolCommandLine() << "\"\n" \
     226                   "\t\t\t/>\n" \
     227                   "\t\t\t<Tool\tName=\"VCPostBuildEventTool\"\n" \
     228                   "\t\t\t\tCommandLine=\"" << getCopyDataCommandLine(isWin32) << "\"\n" \
     229                   "\t\t\t/>\n" \
     230                   "\t\t</Configuration>\n"; \
     231}
     232
     233#define OUTPUT_CONFIGURATION(config, platform, props) { \
     234        project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_" << config << props << ".vsprops\">\n" \
     235                   "\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n" \
     236                   "\t\t</Configuration>\n"; \
     237}
     238
    200239void VisualStudioProvider::createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
    201240                                             const StringList &includeList, const StringList &excludeList) {
    202241        const std::string projectFile = setup.outputDir + '/' + name + getProjectExtension();
     
    233272                        libraries += ' ' + *i + ".lib";
    234273
    235274                // Win32
    236                 project << "\t\t<Configuration Name=\"Debug|Win32\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\ScummVM_Debug.vsprops\">\n"
    237                            "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n"
    238                            "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/scummvm.exe\"\n"
    239                            "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n"
    240                            "\t\t\t/>\n"
    241                            "\t\t\t<Tool\tName=\"VCPreBuildEventTool\"\n"
    242                            "\t\t\t\tCommandLine=\"" << getRevisionToolCommandLine() << "\"\n"
    243                            "\t\t\t/>\n"
    244                            "\t\t\t<Tool\tName=\"VCPostBuildEventTool\"\n"
    245                            "\t\t\t\tCommandLine=\"" << getCopyDataCommandLine(true) << "\"\n"
    246                            "\t\t\t/>\n"
    247                            "\t\t</Configuration>\n"
    248                            "\t\t<Configuration Name=\"Release|Win32\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\ScummVM_Release.vsprops\">\n"
    249                            "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n"
    250                            "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/scummvm.exe\"\n"
    251                            "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n"
    252                            "\t\t\t/>\n"
    253                            "\t\t</Configuration>\n";
     275                OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Debug", "Win32", "", true);
     276                OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Analysis", "Win32", "", true);
     277                OUTPUT_CONFIGURATION_SCUMMVM("Release", "Win32", "");
    254278
    255279                // x64
    256280                // For 'x64' we must disable NASM support. Usually we would need to disable the "nasm" feature for that and
    257281                // re-create the library list, BUT since NASM doesn't link any additional libraries, we can just use the
    258282                // libraries list created for IA-32. If that changes in the future, we need to adjust this part!
    259                 project << "\t\t<Configuration Name=\"Debug|x64\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\ScummVM_Debug64.vsprops\">\n"
    260                            "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n"
    261                            "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/scummvm.exe\"\n"
    262                            "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n"
    263                            "\t\t\t/>\n"
    264                            "\t\t\t<Tool\tName=\"VCPreBuildEventTool\"\n"
    265                            "\t\t\t\tCommandLine=\"" << getRevisionToolCommandLine() << "\"\n"
    266                            "\t\t\t/>\n"
    267                            "\t\t\t<Tool\tName=\"VCPostBuildEventTool\"\n"
    268                            "\t\t\t\tCommandLine=\"" << getCopyDataCommandLine(false) << "\"\n"
    269                            "\t\t\t/>\n"
    270                            "\t\t</Configuration>\n"
    271                            "\t\t<Configuration Name=\"Release|x64\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\ScummVM_Release64.vsprops\">\n"
    272                            "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n"
    273                            "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/scummvm.exe\"\n"
    274                            "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n"
    275                            "\t\t\t/>\n"
    276                            "\t\t</Configuration>\n";
     283                OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Debug", "x64", "64", true);
     284                OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Analysis", "x64", "64", true);
     285                OUTPUT_CONFIGURATION_SCUMMVM("Release", "x64", "64");
     286
    277287        } else {
    278288                std::string warnings = "";
    279289                if (warningsIterator != _projectWarnings.end())
     
    286296                toolConfig += (name == "sword25" ? "DisableLanguageExtensions=\"false\" " : "");
    287297
    288298                // Win32
    289                 project << "\t\t<Configuration Name=\"Debug|Win32\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_Debug.vsprops\">\n"
    290                            "\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n"
    291                            "\t\t</Configuration>\n"
    292 
    293                            "\t\t<Configuration Name=\"Release|Win32\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_Release.vsprops\">\n"
    294                            "\t\t\t<Tool Name=\"VCCLCompilerTool\" " << toolConfig << " />\n"
    295                            "\t\t</Configuration>\n";
    296                 // x64
    297                 project << "\t\t<Configuration Name=\"Debug|x64\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_Debug64.vsprops\">\n"
    298                            "\t\t\t<Tool Name=\"VCCLCompilerTool\" " << toolConfig << " />\n"
    299                            "\t\t</Configuration>\n"
    300                            "\t\t<Configuration Name=\"Release|x64\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_Release64.vsprops\">\n"
    301                            "\t\t\t<Tool Name=\"VCCLCompilerTool\" " << toolConfig << " />\n"
    302                            "\t\t</Configuration>\n";
     299                OUTPUT_CONFIGURATION("Debug", "Win32", "");
     300                OUTPUT_CONFIGURATION("Analysis", "Win32", "");
     301                OUTPUT_CONFIGURATION("Release", "Win32", "");
     302                OUTPUT_CONFIGURATION("Debug", "x64", "64");
     303                OUTPUT_CONFIGURATION("Analysis", "x64", "64");
     304                OUTPUT_CONFIGURATION("Release", "x64", "64");
    303305        }
    304306
    305307        project << "\t</Configurations>\n"
     
    386388        properties.flush();
    387389}
    388390
    389 void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32) {
    390         const std::string outputType = (isRelease ? "Release" : "Debug");
     391void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32, bool enableAnalysis) {
     392        const std::string outputType = (enableAnalysis ? "Analysis" : (isRelease ? "Release" : "Debug"));
    391393        const std::string outputBitness = (isWin32 ? "32" : "64");
    392394
    393395        std::ofstream properties((setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
     
    411413                              "\t\tStringPooling=\"true\"\n"
    412414                              "\t\tBufferSecurityCheck=\"false\"\n"
    413415                              "\t\tDebugInformationFormat=\"0\"\n"
     416                              "\t\tAdditionalOption=\"" << (enableAnalysis ? "/analyze" : "") << "\"\n"
    414417                              "\t/>\n"
    415418                              "\t<Tool\n"
    416419                              "\t\tName=\"VCLinkerTool\"\n"
     
    426429                              "\t\tEnableFunctionLevelLinking=\"true\"\n"
    427430                              "\t\tWarnAsError=\"false\"\n"
    428431                              "\t\tDebugInformationFormat=\"" << (isWin32 ? "4" : "3") << "\"\n"        // For x64 format "4" (Edit and continue) is not supported, thus we default to "3"
     432                              "\t\tAdditionalOption=\"" << (enableAnalysis ? "/analyze" : "") << "\"\n"
    429433                              "\t/>\n"
    430434                              "\t<Tool\n"
    431435                              "\t\tName=\"VCLinkerTool\"\n"
     
    472476                                                    << indentString << "\t<FileConfiguration Name=\"Debug|Win32\">\n"
    473477                                                    << toolLine
    474478                                                    << indentString << "\t</FileConfiguration>\n"
     479                                                                << indentString << "\t<FileConfiguration Name=\"Analysis|Win32\">\n"
     480                                                                << toolLine
     481                                                                << indentString << "\t</FileConfiguration>\n"
    475482                                                    << indentString << "\t<FileConfiguration Name=\"Release|Win32\">\n"
    476483                                                    << toolLine
    477484                                                    << indentString << "\t</FileConfiguration>\n"
     
    484491                                                            << indentString << "\t<FileConfiguration Name=\"Debug|Win32\">\n"
    485492                                                            << toolLine
    486493                                                            << indentString << "\t</FileConfiguration>\n"
     494                                                                        << indentString << "\t<FileConfiguration Name=\"Analysis|Win32\">\n"
     495                                                                        << toolLine
     496                                                                        << indentString << "\t</FileConfiguration>\n"
    487497                                                            << indentString << "\t<FileConfiguration Name=\"Release|Win32\">\n"
    488498                                                            << toolLine
    489499                                                            << indentString << "\t</FileConfiguration>\n"
    490                                                             << indentString << "\t<FileConfiguration Name=\"Debug|x64\">\n"
    491                                                             << toolLine
    492                                                             << indentString << "\t</FileConfiguration>\n"
     500                                                                        << indentString << "\t<FileConfiguration Name=\"Debug|x64\">\n"
     501                                                                        << toolLine
     502                                                                        << indentString << "\t</FileConfiguration>\n"
     503                                                                        << indentString << "\t<FileConfiguration Name=\"Analysis|x64\">\n"
     504                                                                        << toolLine
     505                                                                        << indentString << "\t</FileConfiguration>\n"
    493506                                                            << indentString << "\t<FileConfiguration Name=\"Release|x64\">\n"
    494507                                                            << toolLine
    495508                                                            << indentString << "\t</FileConfiguration>\n"
     
    559572
    560573        OUTPUT_CONFIGURATION_MSBUILD("Debug", "Win32");
    561574        OUTPUT_CONFIGURATION_MSBUILD("Debug", "x64");
     575        OUTPUT_CONFIGURATION_MSBUILD("Analysis", "Win32");
     576        OUTPUT_CONFIGURATION_MSBUILD("Analysis", "x64");
    562577        OUTPUT_CONFIGURATION_MSBUILD("Release", "Win32");
    563578        OUTPUT_CONFIGURATION_MSBUILD("Release", "x64");
    564579
     
    575590        project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n";
    576591
    577592        OUTPUT_CONFIGURATION_TYPE_MSBUILD("Release|Win32");
     593        OUTPUT_CONFIGURATION_TYPE_MSBUILD("Analysis|Win32");
    578594        OUTPUT_CONFIGURATION_TYPE_MSBUILD("Debug|Win32");
    579595        OUTPUT_CONFIGURATION_TYPE_MSBUILD("Release|x64");
     596        OUTPUT_CONFIGURATION_TYPE_MSBUILD("Analysis|x64");
    580597        OUTPUT_CONFIGURATION_TYPE_MSBUILD("Debug|x64");
    581598
    582599        project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n"
    583600                   "\t<ImportGroup Label=\"ExtensionSettings\">\n"
    584601                   "\t</ImportGroup>\n";
    585602
    586         OUTPUT_PROPERTIES_MSBUILD("Release|Win32", "ScummVM_Release.props");
    587         OUTPUT_PROPERTIES_MSBUILD("Debug|Win32", "ScummVM_Debug.props");
    588         OUTPUT_PROPERTIES_MSBUILD("Release|x64", "ScummVM_Release64.props");
    589         OUTPUT_PROPERTIES_MSBUILD("Debug|x64", "ScummVM_Debug64.props");
     603        OUTPUT_PROPERTIES_MSBUILD("Release|Win32",  "ScummVM_Release.props");
     604        OUTPUT_PROPERTIES_MSBUILD("Analysis|Win32", "ScummVM_Analysis.props");
     605        OUTPUT_PROPERTIES_MSBUILD("Debug|Win32",    "ScummVM_Debug.props");
     606        OUTPUT_PROPERTIES_MSBUILD("Release|x64",    "ScummVM_Release64.props");
     607        OUTPUT_PROPERTIES_MSBUILD("Analysis|x64",   "ScummVM_Analysis64.props");
     608        OUTPUT_PROPERTIES_MSBUILD("Debug|x64",      "ScummVM_Debug64.props");
    590609
    591610        project << "\t<PropertyGroup Label=\"UserMacros\" />\n";
    592611
    593         // Project-specific settings
    594         outputProjectSettings(project, name, setup, false, true);
    595         outputProjectSettings(project, name, setup, true, true);
    596         outputProjectSettings(project, name, setup, false, false);
    597         outputProjectSettings(project, name, setup, true, false);
     612        // Project-specific settings (analysis uses debug properties)
     613        outputProjectSettings(project, name, setup, false, true, false);
     614        outputProjectSettings(project, name, setup, false, true, true);
     615        outputProjectSettings(project, name, setup, true, true, false);
     616        outputProjectSettings(project, name, setup, false, false, false);
     617        outputProjectSettings(project, name, setup, false, false, true);
     618        outputProjectSettings(project, name, setup, true, false, false);
    598619
    599620        // Files
    600621        std::string modulePath;
     
    692713        output << "\t</ItemGroup>\n";
    693714}
    694715
    695 void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::string &name, const BuildSetup &setup, bool isRelease, bool isWin32) {
     716void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::string &name, const BuildSetup &setup, bool isRelease, bool isWin32, bool enableAnalysis) {
     717        const std::string configuration = (enableAnalysis ? "Analysis" : (isRelease ? "Release" : "Debug"));
     718
    696719        // Check for project-specific warnings:
    697720        std::map<std::string, StringList>::iterator warningsIterator = _projectWarnings.find(name);
    698721
     
    705728                for (StringList::const_iterator i = warningsIterator->second.begin(); i != warningsIterator->second.end(); ++i)
    706729                        warnings +=  *i + ';';
    707730
    708         project << "\t<ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='" << (isRelease ? "Release" : "Debug") << "|" << (isWin32 ? "Win32" : "x64") << "'\">\n"
     731        project << "\t<ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='" << configuration << "|" << (isWin32 ? "Win32" : "x64") << "'\">\n"
    709732                   "\t\t<ClCompile>\n";
    710733
    711734        // Compile configuration
     
    799822        properties.flush();
    800823}
    801824
    802 void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32) {
    803         const std::string outputType = (isRelease ? "Release" : "Debug");
     825void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32, bool enableAnalysis) {
     826        const std::string outputType = (enableAnalysis ? "Analysis" : (isRelease ? "Release" : "Debug"));
    804827        const std::string outputBitness = (isWin32 ? "32" : "64");
    805828
    806829        std::ofstream properties((setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
     
    827850                              "\t\t\t<StringPooling>true</StringPooling>\n"
    828851                              "\t\t\t<BufferSecurityCheck>false</BufferSecurityCheck>\n"
    829852                              "\t\t\t<DebugInformationFormat></DebugInformationFormat>\n"
     853                              "\t\t\t<EnablePREfast>" << (enableAnalysis ? "true" : "false") << "</EnablePREfast>\n"
    830854                              "\t\t</ClCompile>\n"
    831855                              "\t\t<Link>\n"
    832856                              "\t\t\t<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\n"
     
    840864                              "\t\t\t<FunctionLevelLinking>true</FunctionLevelLinking>\n"
    841865                              "\t\t\t<TreatWarningAsError>false</TreatWarningAsError>\n"
    842866                              "\t\t\t<DebugInformationFormat>" << (isWin32 ? "EditAndContinue" : "ProgramDatabase") << "</DebugInformationFormat>\n" // For x64 format Edit and continue is not supported, thus we default to Program Database
     867                              "\t\t\t<EnablePREfast>" << (enableAnalysis ? "true" : "false") << "</EnablePREfast>\n"
    843868                              "\t\t</ClCompile>\n"
    844869                              "\t\t<Link>\n"
    845870                              "\t\t\t<GenerateDebugInformation>true</GenerateDebugInformation>\n"
     
    897922                                projectFile << "\t\t<ClCompile Include=\"" << (*entry).path << "\">\n";
    898923                                OUPUT_OBJECT_FILENAME_MSBUILD("Debug", "Win32", (*entry).prefix)
    899924                                OUPUT_OBJECT_FILENAME_MSBUILD("Debug", "x64", (*entry).prefix)
     925                                OUPUT_OBJECT_FILENAME_MSBUILD("Analysis", "Win32", (*entry).prefix)
     926                                OUPUT_OBJECT_FILENAME_MSBUILD("Analysis", "x64", (*entry).prefix)
    900927                                OUPUT_OBJECT_FILENAME_MSBUILD("Release", "Win32", (*entry).prefix)
    901928                                OUPUT_OBJECT_FILENAME_MSBUILD("Release", "x64", (*entry).prefix)
    902929                                projectFile << "\t\t</ClCompile>\n";
     
    923950                                       "\t\t\t<FileType>Document</FileType>\n";
    924951
    925952                        OUTPUT_NASM_COMMAND_MSBUILD("Debug")
     953                        OUTPUT_NASM_COMMAND_MSBUILD("Analysis")
    926954                        OUTPUT_NASM_COMMAND_MSBUILD("Release")
    927955
    928956                        projectFile << "\t\t</CustomBuild>\n";
  • tools/create_project/msvc.h

    diff -r 899cc75a29a4 tools/create_project/msvc.h
    a b  
    6666         * Generates the project properties for debug and release settings.
    6767         *
    6868         * @param setup Description of the desired build setup.
    69          * @param isRelease Type of property file
    70          * @param isWin32 Bitness of property file
     69         * @param isRelease       Type of property file
     70         * @param isWin32         Bitness of property file
     71         * @param enableAnalysis  PREfast support
    7172         */
    72         virtual void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32) = 0;
     73        virtual void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32, bool enableAnalysis) = 0;
    7374
    7475        /**
    7576         * Get the file extension for property files
     
    109110
    110111        void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix);
    111112
    112         void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32);
     113        void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32, bool enableAnalysis);
    113114
    114115        const char *getProjectExtension();
    115116        const char *getPropertiesExtension();
     
    124125        void createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
    125126                               const StringList &includeList, const StringList &excludeList);
    126127
    127         void outputProjectSettings(std::ofstream &project, const std::string &name, const BuildSetup &setup, bool isRelease, bool isWin32);
     128        void outputProjectSettings(std::ofstream &project, const std::string &name, const BuildSetup &setup, bool isRelease, bool isWin32, bool enableAnalysis);
    128129
    129130        void writeFileListToProject(const FileNode &dir, std::ofstream &projectFile, const int indentation,
    130131                                    const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix);
     
    133134
    134135        void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix);
    135136
    136         void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32);
     137        void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32, bool enableAnalysis);
    137138
    138139        const char *getProjectExtension();
    139140        const char *getPropertiesExtension();