diff options
author | Littleboy | 2011-05-02 17:18:22 -0400 |
---|---|---|
committer | Littleboy | 2011-05-02 17:21:10 -0400 |
commit | 0e45aa8655dc3122e8d88dbcb67ab2013a292989 (patch) | |
tree | f523e5c1870497528d85385ce5ef24259937813c /devtools/create_project | |
parent | 580986aa42889c9a775b3ebe5709292d779f41cf (diff) | |
parent | 1aff380a15f12e53bd380fc2a189882e2d6172c0 (diff) | |
download | scummvm-rg350-0e45aa8655dc3122e8d88dbcb67ab2013a292989.tar.gz scummvm-rg350-0e45aa8655dc3122e8d88dbcb67ab2013a292989.tar.bz2 scummvm-rg350-0e45aa8655dc3122e8d88dbcb67ab2013a292989.zip |
Merge remote-tracking branch 'upstream/master' into nsis
Conflicts:
devtools/create_project/scripts/postbuild.cmd
devtools/create_project/visualstudio.cpp
ports.mk
Diffstat (limited to 'devtools/create_project')
-rw-r--r-- | devtools/create_project/create_project.cpp | 85 | ||||
-rw-r--r-- | devtools/create_project/create_project.h | 28 | ||||
-rw-r--r-- | devtools/create_project/msbuild.cpp | 159 | ||||
-rw-r--r-- | devtools/create_project/msbuild.h | 3 | ||||
-rw-r--r-- | devtools/create_project/scripts/postbuild.cmd | 2 | ||||
-rw-r--r-- | devtools/create_project/visualstudio.cpp | 89 | ||||
-rw-r--r-- | devtools/create_project/visualstudio.h | 4 |
7 files changed, 194 insertions, 176 deletions
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index 3f28790a6e..7d112c7ffe 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -298,20 +298,12 @@ int main(int argc, char *argv[]) { setup.libraries.push_back(ADDITIONAL_LIBRARY); #endif -// Initialize global & project-specific warnings -#define SET_GLOBAL_WARNINGS(...) \ - { \ - std::string global[PP_NARG(__VA_ARGS__)] = { __VA_ARGS__ }; \ - globalWarnings.assign(global, global + (sizeof(global) / sizeof(global[0]))); \ - } - -#define SET_WARNINGS(name, ...) \ - { \ - std::string project[PP_NARG(__VA_ARGS__)] = { __VA_ARGS__ }; \ - projectWarnings[name].assign(project, project + (sizeof(project) / sizeof(project[0]))); \ - } - // List of global warnings and map of project-specific warnings + // FIXME: As shown below these two structures have different behavior for + // Code::Blocks and MSVC. In Code::Blocks this is used to enable *and* + // disable certain warnings (and some other not warning related flags + // actually...). While in MSVC this is solely for disabling warnings. + // That is really not nice. We should consider a nicer way of doing this. StringList globalWarnings; std::map<std::string, StringList> projectWarnings; @@ -345,9 +337,23 @@ int main(int argc, char *argv[]) { // //////////////////////////////////////////////////////////////////////////// - SET_GLOBAL_WARNINGS("-Wall", "-Wno-long-long", "-Wno-multichar", "-Wno-unknown-pragmas", "-Wno-reorder", - "-Wpointer-arith", "-Wcast-qual", "-Wcast-align", "-Wshadow", "-Wimplicit", - "-Wnon-virtual-dtor", "-Wwrite-strings", "-fno-rtti", "-fno-exceptions", "-fcheck-new"); + globalWarnings.push_back("-Wall"); + globalWarnings.push_back("-Wno-long-long"); + globalWarnings.push_back("-Wno-multichar"); + globalWarnings.push_back("-Wno-unknown-pragmas"); + globalWarnings.push_back("-Wno-reorder"); + globalWarnings.push_back("-Wpointer-arith"); + globalWarnings.push_back("-Wcast-qual"); + globalWarnings.push_back("-Wcast-align"); + globalWarnings.push_back("-Wshadow"); + globalWarnings.push_back("-Wimplicit"); + globalWarnings.push_back("-Wnon-virtual-dtor"); + globalWarnings.push_back("-Wwrite-strings"); + // The following are not warnings at all... We should consider adding them to + // a different list of parameters. + globalWarnings.push_back("-fno-rtti"); + globalWarnings.push_back("-fno-exceptions"); + globalWarnings.push_back("-fcheck-new"); provider = new CreateProjectTool::CodeBlocksProvider(globalWarnings, projectWarnings); @@ -424,12 +430,35 @@ int main(int argc, char *argv[]) { // //////////////////////////////////////////////////////////////////////////// - SET_GLOBAL_WARNINGS("4068", "4100", "4103", "4127", "4244", "4250", "4310", "4351", "4512", "4702", "4706", "4800", "4996", "6204", "6211", "6385", "6386"); - SET_WARNINGS("agi", "4510", "4610"); - SET_WARNINGS("agos", "4511"); - SET_WARNINGS("lure", "4189", "4355"); - SET_WARNINGS("kyra", "4355"); - SET_WARNINGS("m4", "4355"); + globalWarnings.push_back("4068"); + globalWarnings.push_back("4100"); + globalWarnings.push_back("4103"); + globalWarnings.push_back("4127"); + globalWarnings.push_back("4244"); + globalWarnings.push_back("4250"); + globalWarnings.push_back("4310"); + globalWarnings.push_back("4351"); + globalWarnings.push_back("4512"); + globalWarnings.push_back("4702"); + globalWarnings.push_back("4706"); + globalWarnings.push_back("4800"); + globalWarnings.push_back("4996"); + globalWarnings.push_back("6204"); + globalWarnings.push_back("6211"); + globalWarnings.push_back("6385"); + globalWarnings.push_back("6386"); + + projectWarnings["agi"].push_back("4510"); + projectWarnings["agi"].push_back("4610"); + + projectWarnings["agos"].push_back("4511"); + + projectWarnings["lure"].push_back("4189"); + projectWarnings["lure"].push_back("4355"); + + projectWarnings["kyra"].push_back("4355"); + + projectWarnings["m4"].push_back("4355"); if (msvcVersion == 8 || msvcVersion == 9) provider = new CreateProjectTool::VisualStudioProvider(globalWarnings, projectWarnings, msvcVersion); @@ -714,6 +743,7 @@ const Feature s_features[] = { { "opengl", "USE_OPENGL", "opengl32", true, "OpenGL support" }, { "indeo3", "USE_INDEO3", "", true, "Indeo3 codec support"}, { "translation", "USE_TRANSLATION", "", true, "Translation support" }, + { "vkeybd", "ENABLE_VKEYBD", "", false, "Virtual keyboard support"}, { "langdetect", "USE_DETECTLANG", "", true, "System language detection support" } // This feature actually depends on "translation", there // is just no current way of properly detecting this... }; @@ -802,9 +832,10 @@ bool producesObjectFile(const std::string &fileName) { * Checks whether the give file in the specified directory is present in the given * file list. * - * This function does as special match against the file list. It will not take file - * extensions into consideration, when the extension of a file in the specified - * directory is one of "h", "cpp", "c" or "asm". + * This function does as special match against the file list. Object files (.o) are + * excluded by default and it will not take file extensions into consideration, + * when the extension of a file in the specified directory is one of "h", "cpp", + * "c" or "asm". * * @param dir Parent directory of the file. * @param fileName File name to match. @@ -834,7 +865,9 @@ bool isInList(const std::string &dir, const std::string &fileName, const StringL } const std::string lastPathComponent = getLastPathComponent(*i); - if (!producesObjectFile(fileName) && extensionName != "h") { + if (extensionName == "o") { + return false; + } else if (!producesObjectFile(fileName) && extensionName != "h") { if (fileName == lastPathComponent) return true; } else { diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h index 8968610e99..e4ccd7313a 100644 --- a/devtools/create_project/create_project.h +++ b/devtools/create_project/create_project.h @@ -32,34 +32,6 @@ #include <cassert> -// The PP_NARG macro returns the number of arguments that have been passed to it. -#define PP_NARG(...) \ - PP_NARG_(__VA_ARGS__,PP_RSEQ_N()) -#define PP_NARG_(...) \ - PP_ARG_N(__VA_ARGS__) -#define PP_ARG_N( \ - _1, _2, _3, _4, _5, _6, _7, _8, _9,_10, \ - _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, \ - _21,_22,_23,_24,_25,_26,_27,_28,_29,_30, \ - _31,_32,_33,_34,_35,_36,_37,_38,_39,_40, \ - _41,_42,_43,_44,_45,_46,_47,_48,_49,_50, \ - _51,_52,_53,_54,_55,_56,_57,_58,_59,_60, \ - _61,_62,_63,N,...) N -#define PP_RSEQ_N() \ - 63,62,61,60, \ - 59,58,57,56,55,54,53,52,51,50, \ - 49,48,47,46,45,44,43,42,41,40, \ - 39,38,37,36,35,34,33,32,31,30, \ - 29,28,27,26,25,24,23,22,21,20, \ - 19,18,17,16,15,14,13,12,11,10, \ - 9,8,7,6,5,4,3,2,1,0 - -#define SET_VALUES(list, ...) \ - { \ - std::string values[PP_NARG(__VA_ARGS__)] = { __VA_ARGS__ }; \ - list.assign(values, values + (sizeof(values) / sizeof(values[0]))); \ - } - typedef std::list<std::string> StringList; /** diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp index 36ea710c82..4b8276da6f 100644 --- a/devtools/create_project/msbuild.cpp +++ b/devtools/create_project/msbuild.cpp @@ -52,22 +52,29 @@ int MSBuildProvider::getVisualStudioVersion() { return 2010; } -#define OUTPUT_CONFIGURATION_MSBUILD(config, platform) \ - (project << "\t\t<ProjectConfiguration Include=\"" << config << "|" << platform << "\">\n" \ - "\t\t\t<Configuration>" << config << "</Configuration>\n" \ - "\t\t\t<Platform>" << platform << "</Platform>\n" \ - "\t\t</ProjectConfiguration>\n") - -#define OUTPUT_CONFIGURATION_TYPE_MSBUILD(config) \ - (project << "\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"Configuration\">\n" \ - "\t\t<ConfigurationType>" << (name == PROJECT_NAME ? "Application" : "StaticLibrary") << "</ConfigurationType>\n" \ - "\t</PropertyGroup>\n") - -#define OUTPUT_PROPERTIES_MSBUILD(config, properties) \ - (project << "\t<ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"PropertySheets\">\n" \ - "\t\t<Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n" \ - "\t\t<Import Project=\"" << properties << "\" />\n" \ - "\t</ImportGroup>\n") +namespace { + +inline void outputConfiguration(std::ostream &project, const std::string &config, const std::string &platform) { + project << "\t\t<ProjectConfiguration Include=\"" << config << "|" << platform << "\">\n" + "\t\t\t<Configuration>" << config << "</Configuration>\n" + "\t\t\t<Platform>" << platform << "</Platform>\n" + "\t\t</ProjectConfiguration>\n"; +} + +inline void outputConfigurationType(std::ostream &project, const std::string &name, const std::string &config) { + project << "\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"Configuration\">\n" + "\t\t<ConfigurationType>" << (name == PROJECT_NAME ? "Application" : "StaticLibrary") << "</ConfigurationType>\n" + "\t</PropertyGroup>\n"; +} + +inline void outputProperties(std::ostream &project, const std::string &config, const std::string &properties) { + project << "\t<ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"PropertySheets\">\n" + "\t\t<Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n" + "\t\t<Import Project=\"" << properties << "\" />\n" + "\t</ImportGroup>\n"; +} + +} // End of anonymous namespace void MSBuildProvider::createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir, const StringList &includeList, const StringList &excludeList) { @@ -80,12 +87,12 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri "<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n" "\t<ItemGroup Label=\"ProjectConfigurations\">\n"; - OUTPUT_CONFIGURATION_MSBUILD("Debug", "Win32"); - OUTPUT_CONFIGURATION_MSBUILD("Debug", "x64"); - OUTPUT_CONFIGURATION_MSBUILD("Analysis", "Win32"); - OUTPUT_CONFIGURATION_MSBUILD("Analysis", "x64"); - OUTPUT_CONFIGURATION_MSBUILD("Release", "Win32"); - OUTPUT_CONFIGURATION_MSBUILD("Release", "x64"); + outputConfiguration(project, "Debug", "Win32"); + outputConfiguration(project, "Debug", "x64"); + outputConfiguration(project, "Analysis", "Win32"); + outputConfiguration(project, "Analysis", "x64"); + outputConfiguration(project, "Release", "Win32"); + outputConfiguration(project, "Release", "x64"); project << "\t</ItemGroup>\n"; @@ -99,23 +106,23 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri // Shared configuration project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n"; - OUTPUT_CONFIGURATION_TYPE_MSBUILD("Release|Win32"); - OUTPUT_CONFIGURATION_TYPE_MSBUILD("Analysis|Win32"); - OUTPUT_CONFIGURATION_TYPE_MSBUILD("Debug|Win32"); - OUTPUT_CONFIGURATION_TYPE_MSBUILD("Release|x64"); - OUTPUT_CONFIGURATION_TYPE_MSBUILD("Analysis|x64"); - OUTPUT_CONFIGURATION_TYPE_MSBUILD("Debug|x64"); + outputConfigurationType(project, name, "Release|Win32"); + outputConfigurationType(project, name, "Analysis|Win32"); + outputConfigurationType(project, name, "Debug|Win32"); + outputConfigurationType(project, name, "Release|x64"); + outputConfigurationType(project, name, "Analysis|x64"); + outputConfigurationType(project, name, "Debug|x64"); project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n" "\t<ImportGroup Label=\"ExtensionSettings\">\n" "\t</ImportGroup>\n"; - OUTPUT_PROPERTIES_MSBUILD("Release|Win32", PROJECT_DESCRIPTION "_Release.props"); - OUTPUT_PROPERTIES_MSBUILD("Analysis|Win32", PROJECT_DESCRIPTION "_Analysis.props"); - OUTPUT_PROPERTIES_MSBUILD("Debug|Win32", PROJECT_DESCRIPTION "_Debug.props"); - OUTPUT_PROPERTIES_MSBUILD("Release|x64", PROJECT_DESCRIPTION "_Release64.props"); - OUTPUT_PROPERTIES_MSBUILD("Analysis|x64", PROJECT_DESCRIPTION "_Analysis64.props"); - OUTPUT_PROPERTIES_MSBUILD("Debug|x64", PROJECT_DESCRIPTION "_Debug64.props"); + outputProperties(project, "Release|Win32", PROJECT_DESCRIPTION "_Release.props"); + outputProperties(project, "Analysis|Win32", PROJECT_DESCRIPTION "_Analysis.props"); + outputProperties(project, "Debug|Win32", PROJECT_DESCRIPTION "_Debug.props"); + outputProperties(project, "Release|x64", PROJECT_DESCRIPTION "_Release64.props"); + outputProperties(project, "Analysis|x64", PROJECT_DESCRIPTION "_Analysis64.props"); + outputProperties(project, "Debug|x64", PROJECT_DESCRIPTION "_Debug64.props"); project << "\t<PropertyGroup Label=\"UserMacros\" />\n"; @@ -153,21 +160,6 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri createFiltersFile(setup, name); } -#define OUTPUT_FILTER_MSBUILD(files, action) \ - if (!files.empty()) { \ - filters << "\t<ItemGroup>\n"; \ - for (std::list<FileEntry>::const_iterator entry = files.begin(); entry != files.end(); ++entry) { \ - if ((*entry).filter != "") { \ - filters << "\t\t<" action " Include=\"" << (*entry).path << "\">\n" \ - "\t\t\t<Filter>" << (*entry).filter << "</Filter>\n" \ - "\t\t</" action ">\n"; \ - } else { \ - filters << "\t\t<" action " Include=\"" << (*entry).path << "\" />\n"; \ - } \ - } \ - filters << "\t</ItemGroup>\n"; \ - } - void MSBuildProvider::createFiltersFile(const BuildSetup &setup, const std::string &name) { // No filters => no need to create a filter file if (_filters.empty()) @@ -199,15 +191,31 @@ void MSBuildProvider::createFiltersFile(const BuildSetup &setup, const std::stri filters << "\t</ItemGroup>\n"; // Output files - OUTPUT_FILTER_MSBUILD(_compileFiles, "ClCompile") - OUTPUT_FILTER_MSBUILD(_includeFiles, "ClInclude") - OUTPUT_FILTER_MSBUILD(_otherFiles, "None") - OUTPUT_FILTER_MSBUILD(_resourceFiles, "ResourceCompile") - OUTPUT_FILTER_MSBUILD(_asmFiles, "CustomBuild") + outputFilter(filters, _compileFiles, "ClCompile"); + outputFilter(filters, _includeFiles, "ClInclude"); + outputFilter(filters, _otherFiles, "None"); + outputFilter(filters, _resourceFiles, "ResourceCompile"); + outputFilter(filters, _asmFiles, "CustomBuild"); filters << "</Project>"; } +void MSBuildProvider::outputFilter(std::ostream &filters, const FileEntries &files, const std::string &action) { + if (!files.empty()) { + filters << "\t<ItemGroup>\n"; + for (FileEntries::const_iterator entry = files.begin(), end = files.end(); entry != end; ++entry) { + if ((*entry).filter != "") { + filters << "\t\t<" << action << " Include=\"" << (*entry).path << "\">\n" + "\t\t\t<Filter>" << (*entry).filter << "</Filter>\n" + "\t\t</" << action << ">\n"; + } else { + filters << "\t\t<" << action << " Include=\"" << (*entry).path << "\" />\n"; + } + } + filters << "\t</ItemGroup>\n"; + } +} + void MSBuildProvider::writeReferences(std::ofstream &output) { output << "\t<ItemGroup>\n"; @@ -398,19 +406,6 @@ void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, b properties.close(); } -#define OUTPUT_NASM_COMMAND_MSBUILD(config) \ - projectFile << "\t\t\t<Command Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">nasm.exe -f win32 -g -o \"$(IntDir)" << (isDuplicate ? (*entry).prefix : "") << "%(Filename).obj\" \"%(FullPath)\"</Command>\n" \ - "\t\t\t<Outputs Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">$(IntDir)" << (isDuplicate ? (*entry).prefix : "") << "%(Filename).obj;%(Outputs)</Outputs>\n"; - -#define OUPUT_FILES_MSBUILD(files, action) \ - if (!files.empty()) { \ - projectFile << "\t<ItemGroup>\n"; \ - for (std::list<FileEntry>::const_iterator entry = files.begin(); entry != files.end(); ++entry) { \ - projectFile << "\t\t<" action " Include=\"" << (*entry).path << "\" />\n"; \ - } \ - projectFile << "\t</ItemGroup>\n"; \ - } - bool hasEnding(std::string const &fullString, std::string const &ending) { if (fullString.length() > ending.length()) { return (0 == fullString.compare (fullString.length() - ending.length(), ending.length(), ending)); @@ -419,6 +414,14 @@ bool hasEnding(std::string const &fullString, std::string const &ending) { } } +namespace { + +inline void outputNasmCommand(std::ostream &projectFile, const std::string &config, const std::string &prefix) { + projectFile << "\t\t\t<Command Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">nasm.exe -f win32 -g -o \"$(IntDir)" << prefix << "%(Filename).obj\" \"%(FullPath)\"</Command>\n" + "\t\t\t<Outputs Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">$(IntDir)" << prefix << "%(Filename).obj;%(Outputs)</Outputs>\n"; +} + +} // End of anonymous namespace void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream &projectFile, const int, const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix) { @@ -455,9 +458,9 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream } // Output include, other and resource files - OUPUT_FILES_MSBUILD(_includeFiles, "ClInclude") - OUPUT_FILES_MSBUILD(_otherFiles, "None") - OUPUT_FILES_MSBUILD(_resourceFiles, "ResourceCompile") + outputFiles(projectFile, _includeFiles, "ClInclude"); + outputFiles(projectFile, _otherFiles, "None"); + outputFiles(projectFile, _resourceFiles, "ResourceCompile"); // Output asm files if (!_asmFiles.empty()) { @@ -469,9 +472,9 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream projectFile << "\t\t<CustomBuild Include=\"" << (*entry).path << "\">\n" "\t\t\t<FileType>Document</FileType>\n"; - OUTPUT_NASM_COMMAND_MSBUILD("Debug") - OUTPUT_NASM_COMMAND_MSBUILD("Analysis") - OUTPUT_NASM_COMMAND_MSBUILD("Release") + outputNasmCommand(projectFile, "Debug", (isDuplicate ? (*entry).prefix : "")); + outputNasmCommand(projectFile, "Analysis", (isDuplicate ? (*entry).prefix : "")); + outputNasmCommand(projectFile, "Release", (isDuplicate ? (*entry).prefix : "")); projectFile << "\t\t</CustomBuild>\n"; } @@ -479,6 +482,16 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream } } +void MSBuildProvider::outputFiles(std::ostream &projectFile, const FileEntries &files, const std::string &action) { + if (!files.empty()) { + projectFile << "\t<ItemGroup>\n"; + for (FileEntries::const_iterator entry = files.begin(), end = files.end(); entry != end; ++entry) { + projectFile << "\t\t<" << action << " Include=\"" << (*entry).path << "\" />\n"; + } + projectFile << "\t</ItemGroup>\n"; + } +} + void MSBuildProvider::computeFileList(const FileNode &dir, const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix) { for (FileNode::NodeList::const_iterator i = dir.children.begin(); i != dir.children.end(); ++i) { const FileNode *node = *i; diff --git a/devtools/create_project/msbuild.h b/devtools/create_project/msbuild.h index cc545e4755..98bb65e19b 100644 --- a/devtools/create_project/msbuild.h +++ b/devtools/create_project/msbuild.h @@ -75,6 +75,9 @@ private: void computeFileList(const FileNode &dir, const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix); void createFiltersFile(const BuildSetup &setup, const std::string &name); + + void outputFilter(std::ostream &filters, const FileEntries &files, const std::string &action); + void outputFiles(std::ostream &projectFile, const FileEntries &files, const std::string &action); }; } // End of CreateProjectTool namespace diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd index a9ffecabcf..da61afcc3c 100644 --- a/devtools/create_project/scripts/postbuild.cmd +++ b/devtools/create_project/scripts/postbuild.cmd @@ -39,6 +39,8 @@ xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1 xcopy /F /Y "%~4/lib/%~3/SDL.dll" %~2 > NUL 2>&1
xcopy /F /Y "%~4/README-SDL" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/backends/vkeybd/packs/vkeybd_default.zip" %~2 > NUL 2>&1
+
if "%~5"=="0" goto done
echo Running installer script
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp index e405e42e54..f0901907e2 100644 --- a/devtools/create_project/visualstudio.cpp +++ b/devtools/create_project/visualstudio.cpp @@ -57,42 +57,6 @@ int VisualStudioProvider::getVisualStudioVersion() { error("Unsupported version passed to getVisualStudioVersion"); } -#define OUTPUT_BUILD_EVENTS(isWin32) \ - if (setup.runBuildEvents) { \ - project << "\t\t\t<Tool\tName=\"VCPreBuildEventTool\"\n" \ - "\t\t\t\tCommandLine=\"" << getPreBuildEvent() << "\"\n" \ - "\t\t\t/>\n" \ - "\t\t\t<Tool\tName=\"VCPostBuildEventTool\"\n" \ - "\t\t\t\tCommandLine=\"" << getPostBuildEvent(isWin32, setup.createInstaller) << "\"\n" \ - "\t\t\t/>\n"; \ - } - -#define OUTPUT_CONFIGURATION_MAIN(config, platform, props, isWin32) { \ - project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \ - "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \ - "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/" << PROJECT_NAME << "\"\n" \ - "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \ - "\t\t\t/>\n"; \ - OUTPUT_BUILD_EVENTS(isWin32) \ - project << "\t\t</Configuration>\n"; \ -} - -#define OUTPUT_CONFIGURATION_DEBUG(config, platform, props, isWin32) { \ - project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \ - "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \ - "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/" << PROJECT_NAME << ".exe\"\n" \ - "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \ - "\t\t\t/>\n"; \ - OUTPUT_BUILD_EVENTS(isWin32) \ - project << "\t\t</Configuration>\n"; \ -} - -#define OUTPUT_CONFIGURATION(config, platform, props) { \ - project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \ - "\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n" \ - "\t\t</Configuration>\n"; \ -} - void VisualStudioProvider::createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir, const StringList &includeList, const StringList &excludeList) { const std::string projectFile = setup.outputDir + '/' + name + getProjectExtension(); @@ -129,17 +93,17 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std: libraries += ' ' + *i + ".lib"; // Win32 - OUTPUT_CONFIGURATION_DEBUG("Debug", "Win32", "", true); - OUTPUT_CONFIGURATION_DEBUG("Analysis", "Win32", "", true); - OUTPUT_CONFIGURATION_MAIN("Release", "Win32", "", true); + outputConfiguration(project, setup, libraries, "Debug", "Win32", "", true); + outputConfiguration(project, setup, libraries, "Analysis", "Win32", "", true); + outputConfiguration(project, setup, libraries, "Release", "Win32", "", true); // x64 // For 'x64' we must disable NASM support. Usually we would need to disable the "nasm" feature for that and // re-create the library list, BUT since NASM doesn't link any additional libraries, we can just use the // libraries list created for IA-32. If that changes in the future, we need to adjust this part! - OUTPUT_CONFIGURATION_DEBUG("Debug", "x64", "64", false); - OUTPUT_CONFIGURATION_DEBUG("Analysis", "x64", "64", false); - OUTPUT_CONFIGURATION_MAIN("Release", "x64", "64", false); + outputConfiguration(project, setup, libraries, "Debug", "x64", "64", false); + outputConfiguration(project, setup, libraries, "Analysis", "x64", "64", false); + outputConfiguration(project, setup, libraries, "Release", "x64", "64", false); } else { std::string warnings = ""; @@ -154,12 +118,12 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std: toolConfig += (name == "grim" ? "DisableLanguageExtensions=\"false\" " : ""); // Win32 - OUTPUT_CONFIGURATION("Debug", "Win32", ""); - OUTPUT_CONFIGURATION("Analysis", "Win32", ""); - OUTPUT_CONFIGURATION("Release", "Win32", ""); - OUTPUT_CONFIGURATION("Debug", "x64", "64"); - OUTPUT_CONFIGURATION("Analysis", "x64", "64"); - OUTPUT_CONFIGURATION("Release", "x64", "64"); + outputConfiguration(project, toolConfig, "Debug", "Win32", ""); + outputConfiguration(project, toolConfig, "Analysis", "Win32", ""); + outputConfiguration(project, toolConfig, "Release", "Win32", ""); + outputConfiguration(project, toolConfig, "Debug", "x64", "64"); + outputConfiguration(project, toolConfig, "Analysis", "x64", "64"); + outputConfiguration(project, toolConfig, "Release", "x64", "64"); } project << "\t</Configurations>\n" @@ -181,6 +145,33 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std: "</VisualStudioProject>\n"; } +void VisualStudioProvider::outputConfiguration(std::ostream &project, const BuildSetup &setup, const std::string &libraries, const std::string &config, const std::string &platform, const std::string &props, const bool isWin32) { + project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" + "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" + "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/" << PROJECT_NAME << "\"\n" + "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" + "\t\t\t/>\n"; + outputBuildEvents(project, setup, isWin32); + project << "\t\t</Configuration>\n"; +} + +void VisualStudioProvider::outputConfiguration(std::ostream &project, const std::string &toolConfig, const std::string &config, const std::string &platform, const std::string &props) { + project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" + "\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n" + "\t\t</Configuration>\n"; +} + +void VisualStudioProvider::outputBuildEvents(std::ostream &project, const BuildSetup &setup, const bool isWin32) { + if (setup.runBuildEvents) { + project << "\t\t\t<Tool\tName=\"VCPreBuildEventTool\"\n" + "\t\t\t\tCommandLine=\"" << getPreBuildEvent() << "\"\n" + "\t\t\t/>\n" + "\t\t\t<Tool\tName=\"VCPostBuildEventTool\"\n" + "\t\t\t\tCommandLine=\"" << getPostBuildEvent(isWin32, setup.createInstaller) << "\"\n" + "\t\t\t/>\n"; + } +} + void VisualStudioProvider::writeReferences(std::ofstream &output) { output << "\tProjectSection(ProjectDependencies) = postProject\n"; @@ -298,7 +289,7 @@ void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelea "\t\tRuntimeLibrary=\"1\"\n" "\t\tEnableFunctionLevelLinking=\"true\"\n" "\t\tWarnAsError=\"false\"\n" - "\t\tDebugInformationFormat=\"" << (isWin32 ? "4" : "3") << "\"\n" // For x64 format "4" (Edit and continue) is not supported, thus we default to "3" + "\t\tDebugInformationFormat=\"" << (isWin32 ? "4" : "3") << "\"\n" // For x64 format "4" (Edit and continue) is not supported, thus we default to "3" "\t\tAdditionalOption=\"" << (enableAnalysis ? "/analyze" : "") << "\"\n" "\t/>\n" "\t<Tool\n" diff --git a/devtools/create_project/visualstudio.h b/devtools/create_project/visualstudio.h index a1d5c76b01..0e4b441e63 100644 --- a/devtools/create_project/visualstudio.h +++ b/devtools/create_project/visualstudio.h @@ -50,6 +50,10 @@ protected: const char *getProjectExtension(); const char *getPropertiesExtension(); int getVisualStudioVersion(); + + void outputConfiguration(std::ostream &project, const BuildSetup &setup, const std::string &libraries, const std::string &config, const std::string &platform, const std::string &props, const bool isWin32); + void outputConfiguration(std::ostream &project, const std::string &toolConfig, const std::string &config, const std::string &platform, const std::string &props); + void outputBuildEvents(std::ostream &project, const BuildSetup &setup, const bool isWin32); }; } // End of CreateProjectTool namespace |