Ticket #7741: 0002-create_msvc-Simplify-createBuildProp.patch
| File 0002-create_msvc-Simplify-createBuildProp.patch, 9.2 KB (added by , 16 years ago) |
|---|
-
tools/create_msvc/create_msvc.cpp
From a9168a348bbaf73c1648db542d3a413d895c67a9 Mon Sep 17 00:00:00 2001 From: Julien <littleboy@users.sourceforge.net> Date: Sat, 26 Dec 2009 02:12:46 -0500 Subject: [PATCH 2/7] create_msvc: Simplify createBuildProp --- tools/create_msvc/create_msvc.cpp | 138 +++++++++---------------------------- 1 files changed, 34 insertions(+), 104 deletions(-) diff --git a/tools/create_msvc/create_msvc.cpp b/tools/create_msvc/create_msvc.cpp index 5d0bbe7..a276a57 100644
a b public: 216 216 * Generates the project properties for debug and release settings. 217 217 * 218 218 * @param setup Description of the desired build setup. 219 * @param isRelease Type of property file 220 * @param isWin32 Bitness of property file 219 221 */ 220 virtual void createBuildProp(const BuildSetup &setup ) = 0;222 virtual void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32) = 0; 221 223 222 224 /** 223 225 * Get the file extension for project files … … public: 281 283 282 284 void outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix); 283 285 284 void createBuildProp(const BuildSetup &setup );286 void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32); 285 287 286 288 const char *getProjectExtension(); 287 289 const char *getPropertiesExtension(); … … void ProjectProvider::createMSVCProject(const BuildSetup &setup) { 897 899 // Create the global property file 898 900 createGlobalProp(setup); 899 901 900 // Create the configuration property files 901 createBuildProp(setup); 902 // Create the configuration property files (for Debug and Release with 32 and 64bits versions) 903 createBuildProp(setup, true, false); 904 createBuildProp(setup, true, true); 905 createBuildProp(setup, false, false); 906 createBuildProp(setup, false, true); 902 907 } 903 908 904 909 void ProjectProvider::createScummVMSolution(const BuildSetup &setup) { … … void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b 1564 1569 properties.flush(); 1565 1570 } 1566 1571 1567 void VisualStudioProvider::createBuildProp(const BuildSetup &setup) { 1568 std::ofstream properties((setup.outputDir + '/' + "ScummVM_Debug" + getPropertiesExtension()).c_str()); 1572 void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32) { 1573 const std::string outputType = (isRelease ? "Release" : "Debug"); 1574 const std::string outputBitness = (isWin32 ? "32" : "64"); 1575 1576 std::ofstream properties((setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str()); 1569 1577 if (!properties) 1570 error("Could not open \"" + setup.outputDir + '/' + "ScummVM_ Debug" ++ getPropertiesExtension() + "\" for writing");1578 error("Could not open \"" + setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing"); 1571 1579 1572 1580 properties << "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n" 1573 1581 "<VisualStudioPropertySheet\n" 1574 1582 "\tProjectType=\"Visual C++\"\n" 1575 1583 "\tVersion=\"8.00\"\n" 1576 "\tName=\"ScummVM_ Debug32\"\n"1577 "\tInheritedPropertySheets=\".\\ScummVM_Global .vsprops\"\n"1584 "\tName=\"ScummVM_" << outputType << outputBitness << "\"\n" 1585 "\tInheritedPropertySheets=\".\\ScummVM_Global" << (isWin32 ? "" : "64") << ".vsprops\"\n" 1578 1586 "\t>\n" 1579 1587 "\t<Tool\n" 1580 "\t\tName=\"VCCLCompilerTool\"\n" 1581 "\t\tOptimization=\"0\"\n" 1588 "\t\tName=\"VCCLCompilerTool\"\n"; 1589 1590 if (isRelease) { 1591 properties << "\t\tEnableIntrinsicFunctions=\"true\"\n" 1592 "\t\tWholeProgramOptimization=\"true\"\n" 1582 1593 "\t\tPreprocessorDefinitions=\"WIN32\"\n" 1583 "\t\tMinimalRebuild=\"true\"\n" 1584 "\t\tBasicRuntimeChecks=\"3\"\n" 1585 "\t\tRuntimeLibrary=\"1\"\n" 1586 "\t\tEnableFunctionLevelLinking=\"true\"\n" 1587 "\t\tWarnAsError=\"false\"\n" 1588 "\t\tDebugInformationFormat=\"4\"\n" 1594 "\t\tStringPooling=\"true\"\n" 1595 "\t\tBufferSecurityCheck=\"false\"\n" 1596 "\t\tDebugInformationFormat=\"0\"\n" 1589 1597 "\t/>\n" 1590 1598 "\t<Tool\n" 1591 1599 "\t\tName=\"VCLinkerTool\"\n" 1592 "\t\tLinkIncremental=\"2\"\n" 1593 "\t\tGenerateDebugInformation=\"true\"\n" 1594 "\t\tIgnoreDefaultLibraryNames=\"libcmt.lib\"\n" 1595 "\t/>\n" 1596 "</VisualStudioPropertySheet>\n"; 1597 1598 properties.flush(); 1599 properties.close(); 1600 1601 properties.open((setup.outputDir + '/' + "ScummVM_Debug64" + getPropertiesExtension()).c_str()); 1602 if (!properties) 1603 error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Debug64" + getPropertiesExtension() + "\" for writing"); 1604 1605 properties << "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n" 1606 "<VisualStudioPropertySheet\n" 1607 "\tProjectType=\"Visual C++\"\n" 1608 "\tVersion=\"8.00\"\n" 1609 "\tName=\"ScummVM_Debug64\"\n" 1610 "\tInheritedPropertySheets=\".\\ScummVM_Global64.vsprops\"\n" 1611 "\t>\n" 1612 "\t<Tool\n" 1613 "\t\tName=\"VCCLCompilerTool\"\n" 1614 "\t\tOptimization=\"0\"\n" 1600 "\t\tLinkIncremental=\"1\"\n" 1601 "\t\tIgnoreDefaultLibraryNames=\"\"\n" 1602 "\t\tSetChecksum=\"true\"\n"; 1603 } else { 1604 properties << "\t\tOptimization=\"0\"\n" 1615 1605 "\t\tPreprocessorDefinitions=\"WIN32\"\n" 1616 1606 "\t\tMinimalRebuild=\"true\"\n" 1617 1607 "\t\tBasicRuntimeChecks=\"3\"\n" 1618 1608 "\t\tRuntimeLibrary=\"1\"\n" 1619 1609 "\t\tEnableFunctionLevelLinking=\"true\"\n" 1620 1610 "\t\tWarnAsError=\"false\"\n" 1621 "\t\tDebugInformationFormat=\"3\"\n"// For x64 format "4" (Edit and continue) is not supported, thus we default to "3"1611 "\t\tDebugInformationFormat=\"" << (isWin32 ? "4" : "3") << "\"\n" // For x64 format "4" (Edit and continue) is not supported, thus we default to "3" 1622 1612 "\t/>\n" 1623 1613 "\t<Tool\n" 1624 1614 "\t\tName=\"VCLinkerTool\"\n" 1625 1615 "\t\tLinkIncremental=\"2\"\n" 1626 1616 "\t\tGenerateDebugInformation=\"true\"\n" 1627 "\t\tIgnoreDefaultLibraryNames=\"libcmt.lib\"\n" 1628 "\t/>\n" 1629 "</VisualStudioPropertySheet>\n"; 1630 1631 properties.flush(); 1632 properties.close(); 1633 1634 properties.open((setup.outputDir + '/' + "ScummVM_Release" + getPropertiesExtension()).c_str()); 1635 if (!properties) 1636 error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Release" + getPropertiesExtension() + "\" for writing"); 1637 1638 properties << "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n" 1639 "<VisualStudioPropertySheet\n" 1640 "\tProjectType=\"Visual C++\"\n" 1641 "\tVersion=\"8.00\"\n" 1642 "\tName=\"ScummVM_Release32\"\n" 1643 "\tInheritedPropertySheets=\".\\ScummVM_Global.vsprops\"\n" 1644 "\t>\n" 1645 "\t<Tool\n" 1646 "\t\tName=\"VCCLCompilerTool\"\n" 1647 "\t\tEnableIntrinsicFunctions=\"true\"\n" 1648 "\t\tWholeProgramOptimization=\"true\"\n" 1649 "\t\tPreprocessorDefinitions=\"WIN32\"\n" 1650 "\t\tStringPooling=\"true\"\n" 1651 "\t\tBufferSecurityCheck=\"false\"\n" 1652 "\t\tDebugInformationFormat=\"0\"\n" 1653 "\t/>\n" 1654 "\t<Tool\n" 1655 "\t\tName=\"VCLinkerTool\"\n" 1656 "\t\tLinkIncremental=\"1\"\n" 1657 "\t\tIgnoreDefaultLibraryNames=\"\"\n" 1658 "\t\tSetChecksum=\"true\"\n" 1659 "\t/>\n" 1660 "</VisualStudioPropertySheet>\n"; 1661 1662 properties.flush(); 1663 properties.close(); 1664 1665 properties.open((setup.outputDir + '/' + "ScummVM_Release64" + getPropertiesExtension()).c_str()); 1666 if (!properties) 1667 error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Release64" + getPropertiesExtension() + "\" for writing"); 1617 "\t\tIgnoreDefaultLibraryNames=\"libcmt.lib\"\n"; 1618 } 1668 1619 1669 properties << "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n" 1670 "<VisualStudioPropertySheet\n" 1671 "\tProjectType=\"Visual C++\"\n" 1672 "\tVersion=\"8.00\"\n" 1673 "\tName=\"ScummVM_Release64\"\n" 1674 "\tInheritedPropertySheets=\".\\ScummVM_Global64.vsprops\"\n" 1675 "\t>\n" 1676 "\t<Tool\n" 1677 "\t\tName=\"VCCLCompilerTool\"\n" 1678 "\t\tEnableIntrinsicFunctions=\"true\"\n" 1679 "\t\tWholeProgramOptimization=\"true\"\n" 1680 "\t\tPreprocessorDefinitions=\"WIN32\"\n" 1681 "\t\tStringPooling=\"true\"\n" 1682 "\t\tBufferSecurityCheck=\"false\"\n" 1683 "\t\tDebugInformationFormat=\"0\"\n" 1684 "\t/>\n" 1685 "\t<Tool\n" 1686 "\t\tName=\"VCLinkerTool\"\n" 1687 "\t\tLinkIncremental=\"1\"\n" 1688 "\t\tIgnoreDefaultLibraryNames=\"\"\n" 1689 "\t\tSetChecksum=\"true\"\n" 1690 "\t/>\n" 1620 properties << "\t/>\n" 1691 1621 "</VisualStudioPropertySheet>\n"; 1692 1622 1693 1623 properties.flush();
