From 11b907ebf45f5a0707c2748b8f7413b2910976a8 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sun, 24 Apr 2011 12:34:57 -0400 Subject: CREATE_PROJECT: Update revision number support (fixes bug #3280881) Replace existing environment variable based revision number support by a file-based method - Generate a special header file in the build output folder with the current revision number - Include the new header file from internal_version.h when a specific define is set - Update create_project to define SCUMMVM_INTERNAL_REVISION as needed and add the build output folder to the include path - Remove support for git-svn clones in the revision script (not useful anymore after the switch to git) --- devtools/create_project/msvc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'devtools/create_project/msvc.cpp') diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp index e2fff59c46..ccdf4ac82b 100644 --- a/devtools/create_project/msvc.cpp +++ b/devtools/create_project/msvc.cpp @@ -124,7 +124,7 @@ void MSVCProvider::createGlobalProp(const BuildSetup &setup) { if (!properties) error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Global" + getPropertiesExtension() + "\" for writing"); - outputGlobalPropFile(properties, 32, setup.defines, convertPathToWin(setup.filePrefix)); + outputGlobalPropFile(properties, 32, setup.defines, convertPathToWin(setup.filePrefix), setup.runBuildEvents); properties.close(); properties.open((setup.outputDir + '/' + "ScummVM_Global64" + getPropertiesExtension()).c_str()); @@ -143,7 +143,7 @@ void MSVCProvider::createGlobalProp(const BuildSetup &setup) { x64Defines.push_back("WIN32"); x64Defines.push_back("SDL_BACKEND"); - outputGlobalPropFile(properties, 64, x64Defines, convertPathToWin(setup.filePrefix)); + outputGlobalPropFile(properties, 64, x64Defines, convertPathToWin(setup.filePrefix), setup.runBuildEvents); } std::string MSVCProvider::getPreBuildEvent() const { @@ -152,7 +152,7 @@ std::string MSVCProvider::getPreBuildEvent() const { cmdLine = "@echo off\n" "echo Executing Pre-Build script...\n" "echo.\n" - "@call "$(SolutionDir)../../devtools/create_project/scripts/prebuild.cmd" "$(SolutionDir)/../.."\n" + "@call "$(SolutionDir)../../devtools/create_project/scripts/prebuild.cmd" "$(SolutionDir)/../.." "$(TargetDir)"\n" "EXIT /B0"; return cmdLine; -- cgit v1.2.3 From 878d72b387d13bdb7713b142abae32bc28a51047 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sun, 24 Apr 2011 13:33:23 -0400 Subject: CREATE_PROJECT: Move project-specific information to configuration file User-visible output and project-specific names are now defined in a config header. This allows an easier usage of the create_project tools in other scummvm-derived projects (such as residual). --- devtools/create_project/msvc.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'devtools/create_project/msvc.cpp') diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp index ccdf4ac82b..49998cd738 100644 --- a/devtools/create_project/msvc.cpp +++ b/devtools/create_project/msvc.cpp @@ -23,10 +23,10 @@ * */ +#include "config.h" #include "msvc.h" #include - #include namespace CreateProjectTool { @@ -39,23 +39,23 @@ MSVCProvider::MSVCProvider(StringList &global_warnings, std::mapsecond; assert(!svmProjectUUID.empty()); std::string solutionUUID = createUUID(); - std::ofstream solution((setup.outputDir + '/' + "scummvm.sln").c_str()); + std::ofstream solution((setup.outputDir + '/' + PROJECT_NAME ".sln").c_str()); if (!solution) - error("Could not open \"" + setup.outputDir + '/' + "scummvm.sln\" for writing"); + error("Could not open \"" + setup.outputDir + '/' + PROJECT_NAME ".sln\" for writing"); solution << "Microsoft Visual Studio Solution File, Format Version " << _version + 1 << ".00\n"; solution << "# Visual Studio " << getVisualStudioVersion() << "\n"; - solution << "Project(\"{" << solutionUUID << "}\") = \"scummvm\", \"scummvm" << getProjectExtension() << "\", \"{" << svmProjectUUID << "}\"\n"; + solution << "Project(\"{" << solutionUUID << "}\") = \"" << PROJECT_NAME << "\", \"" << PROJECT_NAME << getProjectExtension() << "\", \"{" << svmProjectUUID << "}\"\n"; // Project dependencies are moved to vcxproj files in Visual Studio 2010 if (_version < 10) @@ -65,7 +65,7 @@ void MSVCProvider::createWorkspace(const BuildSetup &setup) { // Note we assume that the UUID map only includes UUIDs for enabled engines! for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) { - if (i->first == "scummvm") + if (i->first == PROJECT_NAME) continue; solution << "Project(\"{" << solutionUUID << "}\") = \"" << i->first << "\", \"" << i->first << getProjectExtension() << "\", \"{" << i->second << "}\"\n" @@ -120,16 +120,16 @@ void MSVCProvider::createOtherBuildFiles(const BuildSetup &setup) { } void MSVCProvider::createGlobalProp(const BuildSetup &setup) { - std::ofstream properties((setup.outputDir + '/' + "ScummVM_Global" + getPropertiesExtension()).c_str()); + std::ofstream properties((setup.outputDir + '/' + PROJECT_DESCRIPTION "_Global" + getPropertiesExtension()).c_str()); if (!properties) - error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Global" + getPropertiesExtension() + "\" for writing"); + error("Could not open \"" + setup.outputDir + '/' + PROJECT_DESCRIPTION "_Global" + getPropertiesExtension() + "\" for writing"); outputGlobalPropFile(properties, 32, setup.defines, convertPathToWin(setup.filePrefix), setup.runBuildEvents); properties.close(); - properties.open((setup.outputDir + '/' + "ScummVM_Global64" + getPropertiesExtension()).c_str()); + properties.open((setup.outputDir + '/' + PROJECT_DESCRIPTION "_Global64" + getPropertiesExtension()).c_str()); if (!properties) - error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Global64" + getPropertiesExtension() + "\" for writing"); + error("Could not open \"" + setup.outputDir + '/' + PROJECT_DESCRIPTION "_Global64" + getPropertiesExtension() + "\" for writing"); // HACK: We must disable the "nasm" feature for x64. To achieve that we must duplicate the feature list and // recreate a define list. @@ -168,6 +168,8 @@ std::string MSVCProvider::getPostBuildEvent(bool isWin32) const { cmdLine += (isWin32) ? "x86" : "x64"; + cmdLine += " %SCUMMVM_LIBS%"; + cmdLine += "\n" "EXIT /B0"; -- cgit v1.2.3 From 3f2b25f8790708cfdfd9c357acf7e43b95330077 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 26 Apr 2011 20:10:46 -0400 Subject: TOOLS: Update create_project to optionally create an installer after a successful build --- devtools/create_project/msvc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'devtools/create_project/msvc.cpp') diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp index 49998cd738..af3aa4a519 100644 --- a/devtools/create_project/msvc.cpp +++ b/devtools/create_project/msvc.cpp @@ -158,7 +158,7 @@ std::string MSVCProvider::getPreBuildEvent() const { return cmdLine; } -std::string MSVCProvider::getPostBuildEvent(bool isWin32) const { +std::string MSVCProvider::getPostBuildEvent(bool isWin32, bool createInstaller) const { std::string cmdLine = ""; cmdLine = "@echo off\n" @@ -168,7 +168,10 @@ std::string MSVCProvider::getPostBuildEvent(bool isWin32) const { cmdLine += (isWin32) ? "x86" : "x64"; - cmdLine += " %SCUMMVM_LIBS%"; + cmdLine += " %SCUMMVM_LIBS% "; + + // Specify if installer needs to be built or not + cmdLine += (createInstaller ? "1" : "0"); cmdLine += "\n" "EXIT /B0"; -- cgit v1.2.3