From 1f660237a4c5b4e80af6515848e6cf0bcd7c74bc Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 22 Apr 2011 14:10:14 -0400 Subject: CREATE_PROJECT: Change build events to also be run in release builds Unofficial builds using MSVC in release mode will benefit from having a revision number available --- devtools/create_project/msbuild.cpp | 11 ++++------- devtools/create_project/visualstudio.cpp | 34 ++++++++++++++++++-------------- 2 files changed, 23 insertions(+), 22 deletions(-) (limited to 'devtools') diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp index 73511218b4..070d7fea60 100644 --- a/devtools/create_project/msbuild.cpp +++ b/devtools/create_project/msbuild.cpp @@ -267,13 +267,10 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s "\t\t\n"; if (setup.runBuildEvents) { - // Only generate revision number in debug builds - if (!isRelease) { - project << "\t\t\n" - "\t\t\tGenerate internal_version.h\n" - "\t\t\t" << getPreBuildEvent() << "\n" - "\t\t\n"; - } + project << "\t\t\n" + "\t\t\tGenerate internal_version_build.h\n" + "\t\t\t" << getPreBuildEvent() << "\n" + "\t\t\n"; // Copy data files to the build folder project << "\t\t\n" diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp index 2b7c8908cb..390d0fba1f 100644 --- a/devtools/create_project/visualstudio.cpp +++ b/devtools/create_project/visualstudio.cpp @@ -57,13 +57,24 @@ int VisualStudioProvider::getVisualStudioVersion() { error("Unsupported version passed to createScummVMSolution"); } -#define OUTPUT_CONFIGURATION_SCUMMVM(config, platform, props) { \ +#define OUTPUT_BUILD_EVENTS(isWin32) \ + if (setup.runBuildEvents) { \ + project << "\t\t\t\n" \ + "\t\t\t\n"; \ + } + +#define OUTPUT_CONFIGURATION_SCUMMVM(config, platform, props, isWin32) { \ project << "\t\t\n" \ "\t\t\t\n" \ "\t\t\t\n" \ - "\t\t\n"; \ + "\t\t\t/>\n"; \ + OUTPUT_BUILD_EVENTS(isWin32) \ + project << "\t\t\n"; \ } #define OUTPUT_CONFIGURATION_SCUMMVM_DEBUG(config, platform, props, isWin32) { \ @@ -72,14 +83,7 @@ int VisualStudioProvider::getVisualStudioVersion() { "\t\t\t\n"; \ - if (setup.runBuildEvents) { \ - project << "\t\t\t\n" \ - "\t\t\t\n"; \ - } \ + OUTPUT_BUILD_EVENTS(isWin32) \ project << "\t\t\n"; \ } @@ -127,15 +131,15 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std: // Win32 OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Debug", "Win32", "", true); OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Analysis", "Win32", "", true); - OUTPUT_CONFIGURATION_SCUMMVM("Release", "Win32", ""); + OUTPUT_CONFIGURATION_SCUMMVM("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_SCUMMVM_DEBUG("Debug", "x64", "64", true); - OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Analysis", "x64", "64", true); - OUTPUT_CONFIGURATION_SCUMMVM("Release", "x64", "64"); + OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Debug", "x64", "64", false); + OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Analysis", "x64", "64", false); + OUTPUT_CONFIGURATION_SCUMMVM("Release", "x64", "64", false); } else { std::string warnings = ""; -- cgit v1.2.3