From 1c3a4f37352f9fe619c07df3998bd0ab6212d4fa Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Thu, 14 Apr 2011 20:48:16 +1000
Subject: CREDITS: Added TsAGE engine credits
---
devtools/credits.pl | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'devtools')
diff --git a/devtools/credits.pl b/devtools/credits.pl
index 075d7b03db..648b0c0a5b 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -695,6 +695,11 @@ begin_credits("Credits");
add_person("Gregory Montoir", "cyx", "");
end_section();
+ begin_section("TsAGE");
+ add_person("Paul Gilbert", "dreammaster", "");
+ add_person("Arnaud Boutonné", "Strangerke", "");
+ end_section();
+
begin_section("Tucker");
add_person("Gregory Montoir", "cyx", "");
end_section();
--
cgit v1.2.3
From 84184aabc00251374a181fe296487619afa779ed Mon Sep 17 00:00:00 2001
From: Max Horn
Date: Thu, 14 Apr 2011 14:12:27 +0200
Subject: ALL: colour -> color
---
devtools/create_lure/create_lure_dat.cpp | 2 +-
devtools/create_lure/create_lure_dat.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
(limited to 'devtools')
diff --git a/devtools/create_lure/create_lure_dat.cpp b/devtools/create_lure/create_lure_dat.cpp
index ad883b808f..4964b26903 100644
--- a/devtools/create_lure/create_lure_dat.cpp
+++ b/devtools/create_lure/create_lure_dat.cpp
@@ -503,7 +503,7 @@ void read_hotspot_data(byte *&data, uint16 &totalSize) {
r->tickSequenceOffset = entry.tickSequenceOffset;
r->layer = entry.layer;
- r->colourOffset = entry.colourOffset;
+ r->colorOffset = entry.colorOffset;
r->hotspotScriptOffset = entry.hotspotScriptOffset;
r->talkScriptOffset = entry.talkScriptOffset;
r->flags = entry.flags;
diff --git a/devtools/create_lure/create_lure_dat.h b/devtools/create_lure/create_lure_dat.h
index 4743f6ac3f..23090072bd 100644
--- a/devtools/create_lure/create_lure_dat.h
+++ b/devtools/create_lure/create_lure_dat.h
@@ -125,7 +125,7 @@ struct HotspotResource {
uint16 yCorrection;
uint16 tickTimeout;
uint16 animOffset;
- byte colourOffset;
+ byte colorOffset;
uint16 hotspotScriptOffset;
byte unused1[7];
uint16 talkScriptOffset;
@@ -166,7 +166,7 @@ struct HotspotResourceOutput {
uint16 walkY;
int8 talkX;
int8 talkY;
- uint16 colourOffset;
+ uint16 colorOffset;
uint16 animRecordId;
uint16 hotspotScriptOffset;
uint16 talkScriptOffset;
--
cgit v1.2.3
From ca7d1550e9afa16a36f7c6f8e6dd759e16277e24 Mon Sep 17 00:00:00 2001
From: strangerke
Date: Sat, 16 Apr 2011 20:32:49 +0200
Subject: HUGO: Fix the typo in the PL file too...
---
devtools/credits.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'devtools')
diff --git a/devtools/credits.pl b/devtools/credits.pl
index 648b0c0a5b..fc10f50bfb 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -1118,7 +1118,7 @@ begin_credits("Credits");
"freewaring the game.");
add_paragraph(
- "David P. Gray from Gray Design Associate for sharing the source code ".
+ "David P. Gray from Gray Design Associates for sharing the source code ".
"of the Hugo trilogy.");
add_paragraph(
--
cgit v1.2.3
From 886ea29bbfe5556729843d97637ea9f691382ddc Mon Sep 17 00:00:00 2001
From: Eugene Sandulenko
Date: Sun, 17 Apr 2011 13:46:58 +0300
Subject: SCUMM: Add md5 from bug #3264965 for fbpack
---
devtools/scumm-md5.txt | 1 +
1 file changed, 1 insertion(+)
(limited to 'devtools')
diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index 60fc615057..e9e155925e 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -466,6 +466,7 @@ fbear Fatty Bear's Birthday Surprise
fbpack Fatty Bear's Fun Pack
e01acc8c12ef44e8f778fe87e5f90f4e -1 en 3DO - - - sev
c9717ee6059f1e43b768b464493d2fba -1 jp 3DO - - - clone2727
+ 4cfd3fda4a4e6e64a1fc488eba973b7a -1 en DOS - - - velocity37
f06e66fd45b2f8b0f4a2833ff4476050 -1 he DOS - - - sev
freddi Freddi Fish 1: The Case of the Missing Kelp Seeds
--
cgit v1.2.3
From 9990ae6aa0bca8e9713018dff83827d5f27c6a60 Mon Sep 17 00:00:00 2001
From: Thierry Crozat
Date: Sun, 17 Apr 2011 14:21:49 +0100
Subject: CREDITS: Add buildbot skin to billwashere crontibutions
---
devtools/credits.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'devtools')
diff --git a/devtools/credits.pl b/devtools/credits.pl
index fc10f50bfb..94f72617af 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -977,7 +977,7 @@ begin_credits("Credits");
add_person("David Jensen", "Tyst", "SVG logo conversion");
add_person("Jean Marc Gimenez", "", "ScummVM logo");
add_person("", "Raina", "ScummVM forum buttons");
- add_person("William Claydon", "billwashere", "Skins for doxygen and wiki");
+ add_person("William Claydon", "billwashere", "Skins for doxygen, buildbot and wiki");
end_persons();
end_section();
--
cgit v1.2.3
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
From bfe0b5f41d048da2eb555aad2b6eece1bca82397 Mon Sep 17 00:00:00 2001
From: Thierry Crozat
Date: Sun, 24 Apr 2011 14:35:12 +0100
Subject: DRASCULA: Update German subtitles for Von Braun cutscene.
The first string of the old subtitles was too long.
---
devtools/create_drascula/staticdata.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'devtools')
diff --git a/devtools/create_drascula/staticdata.h b/devtools/create_drascula/staticdata.h
index 51ed995884..f45af487b1 100644
--- a/devtools/create_drascula/staticdata.h
+++ b/devtools/create_drascula/staticdata.h
@@ -6041,7 +6041,7 @@ const char *_texthis[NUM_LANGS][NUM_TEXTHIS] = {
},
{
"",
- "Vor einer langen Zeit scheint Drascula Von Brauns Frau getoetet zu haben und als Von Braun sich dann den Grafen vorknoepfen wollte, begann er damit, alles, was er ueber Vampire finden konnte, in Erfahrung zu bringen.",
+ "Vor langer Zeit scheint Drascula Von Brauns Frau getoetet zu haben. Um sich den Grafen vorzuknoepfen, fing Von Braun an, alles, was er ueber Vampire finden konnte, in Erfahrung zu bringen.",
"Als er glaubte, er sei bereit, ging er hoch zum Schloss und hatte eine aeusserst gewaltsame Auseinandersetzung mit Drascula.",
"Niemand weiss, was genau dort passierte. Obwohl Von Braun verlor, konnte Drascula ihn nicht toeten.",
"Von Braun fuehlte sich durch seine Niederlage gedemuetigt. Er rannte vom Schloss fort und wagte es nie wieder, Drascula gegenueberzutreten."
--
cgit v1.2.3
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/msbuild.cpp | 11 +++--
devtools/create_project/msbuild.h | 2 +-
devtools/create_project/msvc.cpp | 6 +--
devtools/create_project/msvc.h | 3 +-
devtools/create_project/scripts/postbuild.cmd | 4 +-
devtools/create_project/scripts/prebuild.cmd | 16 +++++--
devtools/create_project/scripts/revision.vbs | 69 ++++++++++++++-------------
devtools/create_project/visualstudio.cpp | 8 +++-
devtools/create_project/visualstudio.h | 2 +-
9 files changed, 68 insertions(+), 53 deletions(-)
(limited to 'devtools')
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index 070d7fea60..1198ff9a09 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -283,7 +283,7 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
project << "\t\n";
}
-void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix) {
+void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix, bool runBuildEvents) {
std::string warnings;
for (StringList::const_iterator i = _globalWarnings.begin(); i != _globalWarnings.end(); ++i)
@@ -293,6 +293,10 @@ void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits,
for (StringList::const_iterator i = defines.begin(); i != defines.end(); ++i)
definesList += *i + ';';
+ // Add define to include revision header
+ if (runBuildEvents)
+ definesList += "SCUMMVM_INTERNAL_REVISION;";
+
properties << "\n"
"\n"
"\t\n"
@@ -308,7 +312,7 @@ void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits,
"\t\t\n"
"\t\t\ttrue\n"
"\t\t\t" << warnings << ";%(DisableSpecificWarnings)\n"
- "\t\t\t$(SCUMMVM_LIBS)\\include;" << prefix << ";" << prefix << "\\engines;%(AdditionalIncludeDirectories)\n"
+ "\t\t\t$(SCUMMVM_LIBS)\\include;" << prefix << ";" << prefix << "\\engines;$(TargetDir);%(AdditionalIncludeDirectories)\n"
"\t\t\t" << definesList << "%(PreprocessorDefinitions)\n"
"\t\t\t\n"
"\t\t\tfalse\n"
@@ -436,9 +440,6 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream
projectFile << "\t\t\n"
"\t\t\t$(IntDir)" << (*entry).prefix << "%(Filename).obj\n";
- if (hasEnding((*entry).path, "base\\version.cpp"))
- projectFile << "\t\t\tSCUMMVM_REVISION#" $(SCUMMVM_REVISION_STRING)";%(PreprocessorDefinitions)\n";
-
projectFile << "\t\t\n";
} else {
projectFile << "\t\t\n";
diff --git a/devtools/create_project/msbuild.h b/devtools/create_project/msbuild.h
index fa5311734b..cc545e4755 100644
--- a/devtools/create_project/msbuild.h
+++ b/devtools/create_project/msbuild.h
@@ -45,7 +45,7 @@ protected:
void writeReferences(std::ofstream &output);
- void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix);
+ void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix, bool runBuildEvents);
void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32, bool enableAnalysis);
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;
diff --git a/devtools/create_project/msvc.h b/devtools/create_project/msvc.h
index f41ecc3aba..b2f2a5d33f 100644
--- a/devtools/create_project/msvc.h
+++ b/devtools/create_project/msvc.h
@@ -59,8 +59,9 @@ protected:
* @param bits Number of bits the platform supports.
* @param defines Defines the platform needs to have set.
* @param prefix File prefix, used to add additional include paths.
+ * @param runBuildEvents true if generating a revision number, false otherwise
*/
- virtual void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix) = 0;
+ virtual void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix, bool runBuildEvents) = 0;
/**
* Generates the project properties for debug and release settings.
diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd
index 5c2bd8a1ad..f548b81442 100644
--- a/devtools/create_project/scripts/postbuild.cmd
+++ b/devtools/create_project/scripts/postbuild.cmd
@@ -12,7 +12,7 @@ REM Root folder
REM Output folder
REM Architecture
-if "%~1"=="" goto error_input
+if "%~1"=="" goto error_root
if "%~2"=="" goto error_output
if "%~3"=="" goto error_arch
@@ -29,7 +29,7 @@ xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1
xcopy /F /Y "%SCUMMVM_LIBS%/lib/%~3/SDL.dll" %~2 > NUL 2>&1
goto done
-:error_output
+:error_root
echo Invalid root folder (%~1)!
goto done
diff --git a/devtools/create_project/scripts/prebuild.cmd b/devtools/create_project/scripts/prebuild.cmd
index b824f0d5a0..dd4d12a851 100644
--- a/devtools/create_project/scripts/prebuild.cmd
+++ b/devtools/create_project/scripts/prebuild.cmd
@@ -4,22 +4,28 @@ REM ---------------------------------------------------------------
REM -- Pre-Build Script
REM ---------------------------------------------------------------
REM
-REM Generate file with proper revision number
+REM Generate file with revision number
REM
REM Expected parameters
-REM Root folder
+REM Root folder (the source root folder)
+REM Target folder (the build output folder, will be used to copy internal_revision.h)
-if "%~1"=="" goto error_input
+if "%~1"=="" goto error_root
+if "%~2"=="" goto error_target
REM Run the revision script
-@call cscript "%~1/devtools/create_project/scripts/revision.vbs" %~1 1>NUL
+@call cscript "%~1/devtools/create_project/scripts/revision.vbs" %~1 %~2 1>NUL
if not %errorlevel% == 0 goto error_script
goto done
-:error_output
+:error_root
echo Invalid root folder (%~1)!
goto done
+:error_target
+echo Invalid target folder (%~2)!
+goto done
+
:error_script:
echo An error occured while running the revision script!
diff --git a/devtools/create_project/scripts/revision.vbs b/devtools/create_project/scripts/revision.vbs
index 851185371b..9c29a88f2d 100644
--- a/devtools/create_project/scripts/revision.vbs
+++ b/devtools/create_project/scripts/revision.vbs
@@ -35,6 +35,7 @@ Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
' Folders
Dim rootFolder : rootFolder = ""
+Dim targetFolder : targetFolder = ""
' Info variables
Dim tool : tool = ""
@@ -85,23 +86,25 @@ Sub DetermineRevision()
Wscript.StdErr.WriteLine "Found revision " & revision & " on branch " & branch & vbCrLf
' Setup our revision string
- Dim revisionString : revisionString = "r" & revision
+ Dim revisionString : revisionString = revision
If (modified) Then
- revisionString = revisionString & " M"
+ revisionString = revisionString & "-dirty"
End If
' If we are not on trunk, add the branch name to the revision string
- If (branch <> "trunk" And branch <> "") Then
- revisionString = revisionString & " (" & branch & ")"
+ If (branch <> "trunk" And branch <> "master" And branch <> "") Then
+ revisionString = revisionString & "(" & branch & ")"
End If
- ' Add the DVCS name at the end
- revisionString = revisionString & " - " & tool
+ ' Add the DVCS name at the end (when not git)
+ If (tool <> "git") Then
+ revisionString = revisionString & "-" & tool
+ End If
- ' Setup an environment variable with the revision string
- Dim Env: Set Env = WshShell.Environment("User")
- Env.item("SCUMMVM_REVISION_STRING") = revisionString
+ ' Output revision header file
+ FSO.CopyFile rootFolder & "\\base\\internal_revision.h.in", targetFolder & "\\internal_revision.h"
+ FindReplaceInFile targetFolder & "\\internal_revision.h", "@REVISION@", revisionString
End Sub
Function DetermineTortoiseSVNVersion()
@@ -283,29 +286,9 @@ Function DetermineGitVersion()
End If
End If
- ' Check for svn clones
- Set oExec = WshShell.Exec(gitPath & "log --pretty=format:%s --grep=" & Chr(34) & "^(svn r[0-9]*)" & Chr(34) & " -1 " & rootFolder)
- if Err.Number = 0 Then
- revision = Mid(oExec.StdOut.ReadLine(), 7)
- revision = Mid(revision, 1, InStr(revision, ")") - 1)
- tool = "svn-git"
- End If
-
- ' No revision? Maybe it is a custom git-svn clone
- If revision = "" Then
- Err.Clear
- Set oExec = WshShell.Exec(gitPath & "log --pretty=format:%b --grep=" & Chr(34) & "git-svn-id:.*@[0-9]*" & Chr(34) & " -1 " & rootFolder)
- If Err.Number = 0 Then
- revision = oExec.StdOut.ReadLine()
- revision = Mid(revision, InStr(revision, "@") + 1)
- revision = Mid(revision, 1, InStr(revision, " ") - 1)
- tool = "svn-git"
- End If
- End If
-
' Fallback to abbreviated revision number
If revision = "" Then
- revision = Mid(hash, 1, 8)
+ revision = Mid(hash, 1, 7)
End If
DetermineGitVersion = True
@@ -385,8 +368,8 @@ End Function
Function ParseCommandLine()
ParseCommandLine = True
- If Wscript.Arguments.Count <> 1 Then
- Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 1)"
+ If Wscript.Arguments.Count <> 2 Then
+ Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 2)"
ParseCommandLine = False
Exit Function
@@ -394,6 +377,7 @@ Function ParseCommandLine()
' Get our arguments
rootFolder = Wscript.Arguments.Item(0)
+ targetFolder = Wscript.Arguments.Item(1)
' Check that the folders are valid
If Not FSO.FolderExists(rootFolder) Then
@@ -403,8 +387,16 @@ Function ParseCommandLine()
Exit Function
End If
- ' Set absolute path
+ If Not FSO.FolderExists(targetFolder) Then
+ Wscript.StdErr.WriteLine "[Error] Invalid target folder (" & targetFolder & ")"
+
+ ParseCommandLine = False
+ Exit Function
+ End If
+
+ ' Set absolute paths
rootFolder = FSO.GetAbsolutePathName(rootFolder)
+ targetFolder = FSO.GetAbsolutePathName(targetFolder)
End Function
Function ReadRegistryKey(shive, subkey, valuename, architecture)
@@ -443,3 +435,14 @@ Function ReadRegistryKey(shive, subkey, valuename, architecture)
ReadRegistryKey = Outparams.SValue
End Function
+
+Sub FindReplaceInFile(filename, to_find, replacement)
+ Dim file, data
+ Set file = FSO.OpenTextFile(filename, 1, 0, 0)
+ data = file.ReadAll
+ file.Close
+ data = Replace(data, to_find, replacement)
+ Set file = FSO.CreateTextFile(filename, -1, 0)
+ file.Write data
+ file.Close
+End Sub
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index 390d0fba1f..41693dcc3a 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -193,7 +193,7 @@ void VisualStudioProvider::writeReferences(std::ofstream &output) {
output << "\tEndProjectSection\n";
}
-void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix) {
+void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix, bool runBuildEvents) {
std::string warnings;
for (StringList::const_iterator i = _globalWarnings.begin(); i != _globalWarnings.end(); ++i)
warnings += *i + ';';
@@ -205,6 +205,10 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
definesList += *i;
}
+ // Add define to include revision header
+ if (runBuildEvents)
+ definesList += "SCUMMVM_INTERNAL_REVISION;";
+
properties << "\n"
"
@@ -34,20 +35,20 @@ CodeBlocksProvider::CodeBlocksProvider(StringList &global_warnings, std::map\n"
"\n";
- workspace << "\t\n";
+ workspace << "\t\n";
writeReferences(workspace);
// 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;
workspace << "\t\tfirst << ".cbp\" />\n";
@@ -59,7 +60,7 @@ void CodeBlocksProvider::createWorkspace(const BuildSetup &setup) {
// HACK We need to pre-process library names
// since the MSVC and mingw precompiled
-// librarie have different names :(
+// libraries have different names :(
std::string processLibraryName(std::string name) {
// Remove "_static" in lib name
size_t pos = name.find("_static");
@@ -90,16 +91,16 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
"\t\t\n"
"\t\t\n";
- if (name == "scummvm") {
+ if (name == PROJECT_NAME) {
std::string libraries;
for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i)
libraries += processLibraryName(*i) + ".a;";
project << "\t\t\t\n"
- "\t\t\t\t\n"
- "\t\t\t\t\n"
- "\t\t\t\t\n"
+ "\t\t\t\t\n"
+ "\t\t\t\t\n"
+ "\t\t\t\t\n"
"\t\t\t\t\n"
"\t\t\t\t\n"
"\t\t\t\t\n"
@@ -112,8 +113,8 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
writeWarnings(name, project);
writeDefines(setup.defines, project);
- project << "\t\t\t\t\t\n"
- "\t\t\t\t\t\n"
+ project << "\t\t\t\t\t\n"
+ "\t\t\t\t\t\n"
"\t\t\t\t\t\n"
"\t\t\t\t\t\n"
"\t\t\t\t\t\n"
@@ -127,21 +128,21 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
project << "\t\t\t\t\t\n";
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
- if (i->first == "scummvm")
+ if (i->first == PROJECT_NAME)
continue;
- project << "\t\t\t\t\tfirst << "\\lib" << i->first << ".a\" />\n";
+ project << "\t\t\t\t\tfirst << "\\lib" << i->first << ".a\" />\n";
}
- project << "\t\t\t\t\t\n"
- "\t\t\t\t\t\n"
+ project << "\t\t\t\t\t\n"
+ "\t\t\t\t\t\n"
"\t\t\t\t\n";
//////////////////////////////////////////////////////////////////////////
// Resource compiler
project << "\t\t\t\t\n"
"\t\t\t\t\t\n"
- "\t\t\t\t\t\n"
+ "\t\t\t\t\t\n"
"\t\t\t\t\n"
"\t\t\t\n"
"\t\t\n";
@@ -150,9 +151,9 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
} else {
project << "\t\t\t\n"
- "\t\t\t\t\n"
+ "\t\t\t\t\n"
"\t\t\t\t\n"
- "\t\t\t\t\n"
+ "\t\t\t\t\n"
"\t\t\t\t\n"
"\t\t\t\t\n"
"\t\t\t\t\n"
@@ -163,11 +164,11 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
project << "\t\t\t\t\t\n"
"\t\t\t\t\t\n"
- "\t\t\t\t\t\n";
+ "\t\t\t\t\t\n";
// Sword2.5 engine needs theora and vorbis includes
if (name == "sword25")
- project << "\t\t\t\t\t\n";
+ project << "\t\t\t\t\t\n";
project << "\t\t\t\t\n"
"\t\t\t\n"
@@ -233,7 +234,7 @@ void CodeBlocksProvider::writeFileListToProject(const FileNode &dir, std::ofstre
"\t\t\n";
} else if (ext == "asm") {
projectFile << "\t\tname) << "\">\n"
- "\t\t\t"
+ "\t\t\t"
"\t\t\n";
} else {
projectFile << "\t\tname) << "\" />\n";
@@ -243,10 +244,10 @@ void CodeBlocksProvider::writeFileListToProject(const FileNode &dir, std::ofstre
}
void CodeBlocksProvider::writeReferences(std::ofstream &output) {
- output << "\t\t\n";
+ output << "\t\t\n";
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
- if (i->first == "scummvm")
+ if (i->first == " << PROJECT_NAME << ")
continue;
output << "\t\t\tfirst << ".cbp\" />\n";
diff --git a/devtools/create_project/codeblocks/create_project.cbp b/devtools/create_project/codeblocks/create_project.cbp
index 9078ddcd51..25b12d8cc2 100644
--- a/devtools/create_project/codeblocks/create_project.cbp
+++ b/devtools/create_project/codeblocks/create_project.cbp
@@ -36,6 +36,7 @@
+
diff --git a/devtools/create_project/config.h b/devtools/create_project/config.h
new file mode 100644
index 0000000000..1609e9e99a
--- /dev/null
+++ b/devtools/create_project/config.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef TOOLS_CREATE_PROJECT_CONFIG_H
+#define TOOLS_CREATE_PROJECT_CONFIG_H
+
+#define PROJECT_DESCRIPTION "ScummVM" // Used in console output and build configuration
+#define PROJECT_NAME "scummvm" // Used for folders, icons, resources and project/solution name
+#define LIBS_DEFINE "SCUMMVM_LIBS" // Name of the include environment variable
+#define REVISION_DEFINE "SCUMMVM_INTERNAL_REVISION"
+
+#define HAS_VIDEO_FOLDER 1
+//#define ADDITIONAL_LIBRARY ""
+#define NEEDS_RTTI 0
+
+#endif // TOOLS_CREATE_PROJECT_CONFIG_H
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index b896e85131..a597ba36e9 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -29,6 +29,7 @@
#undef main
#endif // main
+#include "config.h"
#include "create_project.h"
#include "codeblocks.h"
@@ -150,7 +151,7 @@ int main(int argc, char *argv[]) {
using std::cout;
for (int i = 2; i < argc; ++i) {
if (!std::strcmp(argv[i], "--list-engines")) {
- cout << " The following enables are available in the ScummVM source distribution\n"
+ cout << " The following enables are available in the " PROJECT_DESCRIPTION " source distribution\n"
" located at \"" << srcDir << "\":\n";
cout << " state | name | description\n\n";
@@ -289,6 +290,11 @@ int main(int argc, char *argv[]) {
setup.libraries.push_back("sdl");
setup.libraries.push_back("winmm");
+ // Add additional project-specific library
+#ifdef ADDITIONAL_LIBRARY
+ setup.libraries.push_back(ADDITIONAL_LIBRARY);
+#endif
+
// Initialize global & project-specific warnings
#define SET_GLOBAL_WARNINGS(...) \
{ \
@@ -456,7 +462,7 @@ void displayHelp(const char *exe) {
cout << "Usage:\n"
<< exe << " path\\to\\source [optional options]\n"
<< "\n"
- << " Creates project files for the ScummVM source located at \"path\\to\\source\".\n"
+ << " Creates project files for the " PROJECT_DESCRIPTION " source located at \"path\\to\\source\".\n"
" The project files will be created in the directory where tool is run from and\n"
" will include \"path\\to\\source\" for relative file paths, thus be sure that you\n"
" pass a relative file path like \"..\\..\\trunk\".\n"
@@ -482,14 +488,14 @@ void displayHelp(const char *exe) {
" --build-events Run custom build events as part of the build\n"
" (default: false)\n"
"\n"
- "ScummVM engine settings:\n"
+ "Engines settings:\n"
" --list-engines list all available engines and their default state\n"
" --enable-engine enable building of the engine with the name \"engine\"\n"
" --disable-engine disable building of the engine with the name \"engine\"\n"
" --enable-all-engines enable building of all engines\n"
" --disable-all-engines disable building of all engines\n"
"\n"
- "ScummVM optional feature settings:\n"
+ "Optional features settings:\n"
" --enable-name enable inclusion of the feature \"name\"\n"
" --disable-name disable inclusion of the feature \"name\"\n"
"\n"
@@ -686,25 +692,25 @@ TokenList tokenize(const std::string &input) {
namespace {
const Feature s_features[] = {
// Libraries
- { "libz", "USE_ZLIB", "zlib", true, "zlib (compression) support" },
- { "mad", "USE_MAD", "libmad", true, "libmad (MP3) support" },
+ { "libz", "USE_ZLIB", "zlib", true, "zlib (compression) support" },
+ { "mad", "USE_MAD", "libmad", true, "libmad (MP3) support" },
{ "vorbis", "USE_VORBIS", "libvorbisfile_static libvorbis_static libogg_static", true, "Ogg Vorbis support" },
- { "flac", "USE_FLAC", "libFLAC_static", true, "FLAC support" },
- { "png", "USE_PNG", "libpng", true, "libpng support" },
- { "theora", "USE_THEORADEC", "libtheora_static", true, "Theora decoding support" },
- { "mpeg2", "USE_MPEG2", "libmpeg2", false, "mpeg2 codec for cutscenes" },
-
- // ScummVM feature flags
- { "scalers", "USE_SCALERS", "", true, "Scalers" },
- { "hqscalers", "USE_HQ_SCALERS", "", true, "HQ scalers" },
- { "16bit", "USE_RGB_COLOR", "", true, "16bit color support" },
- { "mt32emu", "USE_MT32EMU", "", true, "integrated MT-32 emulator" },
- { "nasm", "USE_NASM", "", true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling.
+ { "flac", "USE_FLAC", "libFLAC_static", true, "FLAC support" },
+ { "png", "USE_PNG", "libpng", true, "libpng support" },
+ { "theora", "USE_THEORADEC", "libtheora_static", true, "Theora decoding support" },
+ { "mpeg2", "USE_MPEG2", "libmpeg2", false, "mpeg2 codec for cutscenes" },
+
+ // Feature flags
+ { "scalers", "USE_SCALERS", "", true, "Scalers" },
+ { "hqscalers", "USE_HQ_SCALERS", "", true, "HQ scalers" },
+ { "16bit", "USE_RGB_COLOR", "", true, "16bit color support" },
+ { "mt32emu", "USE_MT32EMU", "", true, "integrated MT-32 emulator" },
+ { "nasm", "USE_NASM", "", true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling.
{ "opengl", "USE_OPENGL", "opengl32", true, "OpenGL support" },
- { "indeo3", "USE_INDEO3", "", true, "Indeo3 codec support"},
- { "translation", "USE_TRANSLATION", "", true, "Translation 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...
+ { "indeo3", "USE_INDEO3", "", true, "Indeo3 codec support"},
+ { "translation", "USE_TRANSLATION", "", true, "Translation 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...
};
} // End of anonymous namespace
@@ -977,7 +983,7 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
_uuidMap = createUUIDMap(setup);
// We also need to add the UUID of the main project file.
- const std::string svmUUID = _uuidMap["scummvm"] = createUUID();
+ const std::string svmUUID = _uuidMap[PROJECT_NAME] = createUUID();
// Create Solution/Workspace file
createWorkspace(setup);
@@ -986,7 +992,7 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
// Create engine project files
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
- if (i->first == "scummvm")
+ if (i->first == PROJECT_NAME)
continue;
in.clear(); ex.clear();
@@ -996,10 +1002,10 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
createProjectFile(i->first, i->second, setup, moduleDir, in, ex);
}
- // Last but not least create the main ScummVM project file.
+ // Last but not least create the main project file.
in.clear(); ex.clear();
- // File list for the ScummVM project file
+ // File list for the Project file
createModuleList(setup.srcDir + "/backends", setup.defines, in, ex);
createModuleList(setup.srcDir + "/backends/platform/sdl", setup.defines, in, ex);
createModuleList(setup.srcDir + "/base", setup.defines, in, ex);
@@ -1009,11 +1015,13 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
createModuleList(setup.srcDir + "/gui", setup.defines, in, ex);
createModuleList(setup.srcDir + "/audio", setup.defines, in, ex);
createModuleList(setup.srcDir + "/audio/softsynth/mt32", setup.defines, in, ex);
+#if HAS_VIDEO_FOLDER
createModuleList(setup.srcDir + "/video", setup.defines, in, ex);
+#endif
// Resource files
- in.push_back(setup.srcDir + "/icons/scummvm.ico");
- in.push_back(setup.srcDir + "/dists/scummvm.rc");
+ in.push_back(setup.srcDir + "/icons/" + PROJECT_NAME + ".ico");
+ in.push_back(setup.srcDir + "/dists/" + PROJECT_NAME + ".rc");
// Various text files
in.push_back(setup.srcDir + "/AUTHORS");
@@ -1024,8 +1032,8 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
in.push_back(setup.srcDir + "/README");
in.push_back(setup.srcDir + "/TODO");
- // Create the scummvm project file.
- createProjectFile("scummvm", svmUUID, setup, setup.srcDir, in, ex);
+ // Create the main project file.
+ createProjectFile(PROJECT_NAME, svmUUID, setup, setup.srcDir, in, ex);
// Create other misc. build files
createOtherBuildFiles(setup);
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index 8c4b8c7d23..c228c34898 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -105,13 +105,13 @@ struct EngineDesc {
typedef std::list EngineDescList;
/**
- * This function parses the ScummVM configure file and creates a list
+ * This function parses the project configure file and creates a list
* of available engines.
*
* It will also automatically setup the default build state (enabled
* or disabled) to the state specified in the "configure" file.
*
- * @param srcDir Path to the root of the ScummVM source.
+ * @param srcDir Path to the root of the project source.
* @return List of available engines.
*/
EngineDescList parseConfigure(const std::string &srcDir);
@@ -206,11 +206,11 @@ bool setFeatureBuildState(const std::string &name, FeatureList &features, bool e
* Structure to describe a build setup.
*
* This includes various information about which engines to
- * enable, which features should be built into ScummVM.
- * It also contains the path to the ScummVM souce root.
+ * enable, which features should be built into the main executable.
+ * It also contains the path to the project source root.
*/
struct BuildSetup {
- std::string srcDir; ///< Path to the ScummVM sources.
+ std::string srcDir; ///< Path to the sources.
std::string filePrefix; ///< Prefix for the relative path arguments in the project files.
std::string outputDir; ///< Path where to put the MSVC project files.
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index 1198ff9a09..9d8b9c0407 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -23,10 +23,10 @@
*
*/
+#include "config.h"
#include "msbuild.h"
#include
-
#include
namespace CreateProjectTool {
@@ -60,7 +60,7 @@ int MSBuildProvider::getVisualStudioVersion() {
#define OUTPUT_CONFIGURATION_TYPE_MSBUILD(config) \
(project << "\t\n" \
- "\t\t" << (name == "scummvm" ? "Application" : "StaticLibrary") << "\n" \
+ "\t\t" << (name == PROJECT_NAME ? "Application" : "StaticLibrary") << "\n" \
"\t\n")
#define OUTPUT_PROPERTIES_MSBUILD(config, properties) \
@@ -110,12 +110,12 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
"\t\n"
"\t\n";
- OUTPUT_PROPERTIES_MSBUILD("Release|Win32", "ScummVM_Release.props");
- OUTPUT_PROPERTIES_MSBUILD("Analysis|Win32", "ScummVM_Analysis.props");
- OUTPUT_PROPERTIES_MSBUILD("Debug|Win32", "ScummVM_Debug.props");
- OUTPUT_PROPERTIES_MSBUILD("Release|x64", "ScummVM_Release64.props");
- OUTPUT_PROPERTIES_MSBUILD("Analysis|x64", "ScummVM_Analysis64.props");
- OUTPUT_PROPERTIES_MSBUILD("Debug|x64", "ScummVM_Debug64.props");
+ 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");
project << "\t\n";
@@ -140,8 +140,8 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
else
addFilesToProject(moduleDir, project, includeList, excludeList, setup.filePrefix);
- // Output references for scummvm project
- if (name == "scummvm")
+ // Output references for the main project
+ if (name == PROJECT_NAME)
writeReferences(project);
project << "\t\n"
@@ -212,7 +212,7 @@ void MSBuildProvider::writeReferences(std::ofstream &output) {
output << "\t\n";
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
- if (i->first == "scummvm")
+ if (i->first == PROJECT_NAME)
continue;
output << "\tfirst << ".vcxproj\">\n"
@@ -230,7 +230,7 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
std::map::iterator warningsIterator = _projectWarnings.find(name);
// Nothing to add here, move along!
- if (name != "scummvm" && name != "sword25" && name != "tinsel" && warningsIterator == _projectWarnings.end())
+ if (name != PROJECT_NAME && name != "sword25" && name != "tinsel" && name != "grim" && warningsIterator == _projectWarnings.end())
return;
std::string warnings = "";
@@ -242,7 +242,7 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
"\t\t\n";
// Compile configuration
- if (name == "scummvm" || name == "sword25") {
+ if (name == PROJECT_NAME || name == "sword25" || name == "grim") {
project << "\t\t\tfalse\n";
} else {
if (name == "tinsel" && !isRelease)
@@ -254,21 +254,21 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
project << "\t\t\n";
- // Link configuration for scummvm project
- if (name == "scummvm") {
+ // Link configuration for main project
+ if (name == PROJECT_NAME) {
std::string libraries;
for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i)
libraries += *i + ".lib;";
project << "\t\t\n"
- "\t\t\t$(OutDir)scummvm.exe\n"
+ "\t\t\t$(OutDir)" << PROJECT_NAME << ".exe\n"
"\t\t\t" << libraries << "%(AdditionalDependencies)\n"
"\t\t\n";
if (setup.runBuildEvents) {
project << "\t\t\n"
- "\t\t\tGenerate internal_version_build.h\n"
+ "\t\t\tGenerate revision\n"
"\t\t\t" << getPreBuildEvent() << "\n"
"\t\t\n";
@@ -295,16 +295,16 @@ void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits,
// Add define to include revision header
if (runBuildEvents)
- definesList += "SCUMMVM_INTERNAL_REVISION;";
+ definesList += REVISION_DEFINE ";";
properties << "\n"
"\n"
"\t\n"
- "\t\t<_ProjectFileVersion>10.0.30319.1\n"
- "\t\t<_PropertySheetDisplayName>ScummVM_Global\n"
- "\t\t$(SCUMMVM_LIBS)\\bin;$(ExecutablePath)\n"
- "\t\t$(SCUMMVM_LIBS)\\lib\\" << (bits == 32 ? "x86" : "x64") << ";$(LibraryPath)\n"
- "\t\t$(SCUMMVM_LIBS)\\include;$(IncludePath)\n"
+ "\t\t<_ProjectFileVersion>10.0.40219.1\n"
+ "\t\t<_PropertySheetDisplayName>" << PROJECT_DESCRIPTION << "_Global\n"
+ "\t\t$(" << LIBS_DEFINE << ")\\bin;$(ExecutablePath)\n"
+ "\t\t$(" << LIBS_DEFINE << ")\\lib\\" << (bits == 32 ? "x86" : "x64") << ";$(LibraryPath)\n"
+ "\t\t$(" << LIBS_DEFINE << ")\\include;$(IncludePath)\n"
"\t\t$(Configuration)" << bits << "\\\n"
"\t\t$(Configuration)" << bits << "/$(ProjectName)\\\n"
"\t\n"
@@ -312,11 +312,17 @@ void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits,
"\t\t\n"
"\t\t\ttrue\n"
"\t\t\t" << warnings << ";%(DisableSpecificWarnings)\n"
- "\t\t\t$(SCUMMVM_LIBS)\\include;" << prefix << ";" << prefix << "\\engines;$(TargetDir);%(AdditionalIncludeDirectories)\n"
+ "\t\t\t$(" << LIBS_DEFINE << ")\\include;" << prefix << ";" << prefix << "\\engines;$(TargetDir);%(AdditionalIncludeDirectories)\n"
"\t\t\t" << definesList << "%(PreprocessorDefinitions)\n"
- "\t\t\t\n"
- "\t\t\tfalse\n"
- "\t\t\tLevel4\n"
+ "\t\t\t\n";
+
+#if NEEDS_RTTI
+ properties << "\t\t\ttrue\n";
+#else
+ properties << "\t\t\tfalse\n";
+#endif
+
+ properties << "\t\t\tLevel4\n"
"\t\t\tfalse\n"
"\t\t\tDefault\n"
"\t\t\n"
@@ -339,18 +345,18 @@ void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, b
const std::string outputType = (enableAnalysis ? "Analysis" : (isRelease ? "Release" : "Debug"));
const std::string outputBitness = (isWin32 ? "32" : "64");
- std::ofstream properties((setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
+ std::ofstream properties((setup.outputDir + '/' + PROJECT_DESCRIPTION "_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
if (!properties)
- error("Could not open \"" + setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing");
+ error("Could not open \"" + setup.outputDir + '/' + PROJECT_DESCRIPTION "_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing");
properties << "\n"
"\n"
"\t\n"
- "\t\t\n"
+ "\t\t\n"
"\t\n"
"\t\n"
- "\t\t<_ProjectFileVersion>10.0.30319.1\n"
- "\t\t<_PropertySheetDisplayName>ScummVM_" << outputType << outputBitness << "\n"
+ "\t\t<_ProjectFileVersion>10.0.40219.1\n"
+ "\t\t<_PropertySheetDisplayName>" << PROJECT_DESCRIPTION << "_" << outputType << outputBitness << "\n"
"\t\t" << (isRelease ? "false" : "true") << "\n"
"\t\n"
"\t\n"
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";
diff --git a/devtools/create_project/msvc10/create_project.vcxproj b/devtools/create_project/msvc10/create_project.vcxproj
index 532d6dba29..15ce217bfc 100644
--- a/devtools/create_project/msvc10/create_project.vcxproj
+++ b/devtools/create_project/msvc10/create_project.vcxproj
@@ -101,6 +101,7 @@ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\
+
diff --git a/devtools/create_project/msvc10/create_project.vcxproj.filters b/devtools/create_project/msvc10/create_project.vcxproj.filters
index 7922e1e6f7..42db5aa97e 100644
--- a/devtools/create_project/msvc10/create_project.vcxproj.filters
+++ b/devtools/create_project/msvc10/create_project.vcxproj.filters
@@ -27,6 +27,9 @@
Header Files
+
+ Header Files
+
diff --git a/devtools/create_project/msvc8/create_project.vcproj b/devtools/create_project/msvc8/create_project.vcproj
index bc3b2437ac..9cd833ea23 100644
--- a/devtools/create_project/msvc8/create_project.vcproj
+++ b/devtools/create_project/msvc8/create_project.vcproj
@@ -198,6 +198,10 @@
RelativePath="..\codeblocks.h"
>
+
+
diff --git a/devtools/create_project/msvc9/create_project.vcproj b/devtools/create_project/msvc9/create_project.vcproj
index c89b88a1c9..4e0375c35e 100644
--- a/devtools/create_project/msvc9/create_project.vcproj
+++ b/devtools/create_project/msvc9/create_project.vcproj
@@ -199,6 +199,10 @@
RelativePath="..\codeblocks.h"
>
+
+
diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd
index f548b81442..6c062f7ab1 100644
--- a/devtools/create_project/scripts/postbuild.cmd
+++ b/devtools/create_project/scripts/postbuild.cmd
@@ -11,10 +11,12 @@ REM Expected parameters
REM Root folder
REM Output folder
REM Architecture
+REM Libs folder
if "%~1"=="" goto error_root
if "%~2"=="" goto error_output
if "%~3"=="" goto error_arch
+if "%~4"=="" goto error_libs
echo Copying data files
echo.
@@ -26,7 +28,7 @@ xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 > NUL 2>&1
xcopy /F /Y "%~1/dists/engine-data/README" %~2 > NUL 2>&1
xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1
xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1
-xcopy /F /Y "%SCUMMVM_LIBS%/lib/%~3/SDL.dll" %~2 > NUL 2>&1
+xcopy /F /Y "%~4/lib/%~3/SDL.dll" %~2 > NUL 2>&1
goto done
:error_root
@@ -41,5 +43,9 @@ goto done
echo Invalid arch parameter (was: %~3, allowed: x86, x64)!
goto done
+:error_libs
+echo Invalid libs folder (%~4)!
+goto done
+
:done
exit /B0
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index 41693dcc3a..2997e3096a 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -23,10 +23,10 @@
*
*/
+#include "config.h"
#include "visualstudio.h"
#include
-
#include
namespace CreateProjectTool {
@@ -54,7 +54,7 @@ int VisualStudioProvider::getVisualStudioVersion() {
if (_version == 8)
return 2005;
- error("Unsupported version passed to createScummVMSolution");
+ error("Unsupported version passed to getVisualStudioVersion");
}
#define OUTPUT_BUILD_EVENTS(isWin32) \
@@ -67,20 +67,20 @@ int VisualStudioProvider::getVisualStudioVersion() {
"\t\t\t/>\n"; \
}
-#define OUTPUT_CONFIGURATION_SCUMMVM(config, platform, props, isWin32) { \
- project << "\t\t\n" \
+#define OUTPUT_CONFIGURATION_MAIN(config, platform, props, isWin32) { \
+ project << "\t\t\n" \
"\t\t\t\n" \
- "\t\t\t\n"; \
OUTPUT_BUILD_EVENTS(isWin32) \
project << "\t\t\n"; \
}
-#define OUTPUT_CONFIGURATION_SCUMMVM_DEBUG(config, platform, props, isWin32) { \
- project << "\t\t\n" \
+#define OUTPUT_CONFIGURATION_DEBUG(config, platform, props, isWin32) { \
+ project << "\t\t\n" \
"\t\t\t\n" \
- "\t\t\t\n"; \
OUTPUT_BUILD_EVENTS(isWin32) \
@@ -88,7 +88,7 @@ int VisualStudioProvider::getVisualStudioVersion() {
}
#define OUTPUT_CONFIGURATION(config, platform, props) { \
- project << "\t\t\n" \
+ project << "\t\t\n" \
"\t\t\t\n" \
"\t\t\n"; \
}
@@ -122,24 +122,24 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
// Check for project-specific warnings:
std::map< std::string, std::list >::iterator warningsIterator = _projectWarnings.find(name);
- if (name == "scummvm") {
+ if (name == PROJECT_NAME) {
std::string libraries;
for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i)
libraries += ' ' + *i + ".lib";
// Win32
- OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Debug", "Win32", "", true);
- OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Analysis", "Win32", "", true);
- OUTPUT_CONFIGURATION_SCUMMVM("Release", "Win32", "", true);
+ OUTPUT_CONFIGURATION_DEBUG("Debug", "Win32", "", true);
+ OUTPUT_CONFIGURATION_DEBUG("Analysis", "Win32", "", true);
+ OUTPUT_CONFIGURATION_MAIN("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", false);
- OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Analysis", "x64", "64", false);
- OUTPUT_CONFIGURATION_SCUMMVM("Release", "x64", "64", false);
+ OUTPUT_CONFIGURATION_DEBUG("Debug", "x64", "64", false);
+ OUTPUT_CONFIGURATION_DEBUG("Analysis", "x64", "64", false);
+ OUTPUT_CONFIGURATION_MAIN("Release", "x64", "64", false);
} else {
std::string warnings = "";
@@ -151,6 +151,7 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
toolConfig = (!warnings.empty() ? "DisableSpecificWarnings=\"" + warnings + "\"" : "");
toolConfig += (name == "tinsel" ? "DebugInformationFormat=\"3\" " : "");
toolConfig += (name == "sword25" ? "DisableLanguageExtensions=\"false\" " : "");
+ toolConfig += (name == "grim" ? "DisableLanguageExtensions=\"false\" " : "");
// Win32
OUTPUT_CONFIGURATION("Debug", "Win32", "");
@@ -184,7 +185,7 @@ void VisualStudioProvider::writeReferences(std::ofstream &output) {
output << "\tProjectSection(ProjectDependencies) = postProject\n";
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
- if (i->first == "scummvm")
+ if (i->first == PROJECT_NAME)
continue;
output << "\t\t{" << i->second << "} = {" << i->second << "}\n";
@@ -207,13 +208,13 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
// Add define to include revision header
if (runBuildEvents)
- definesList += "SCUMMVM_INTERNAL_REVISION;";
+ definesList += REVISION_DEFINE ";";
properties << "\n"
"\n"
@@ -221,10 +222,17 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
"\t\tName=\"VCCLCompilerTool\"\n"
"\t\tDisableLanguageExtensions=\"true\"\n"
"\t\tDisableSpecificWarnings=\"" << warnings << "\"\n"
- "\t\tAdditionalIncludeDirectories=\"" << prefix << ";" << prefix << "\\engines;$(SCUMMVM_LIBS)\\include;$(TargetDir)\"\n"
+ "\t\tAdditionalIncludeDirectories=\"" << prefix << ";" << prefix << "\\engines;$(" << LIBS_DEFINE << ")\\include;$(TargetDir)\"\n"
"\t\tPreprocessorDefinitions=\"" << definesList << "\"\n"
- "\t\tExceptionHandling=\"0\"\n"
- "\t\tRuntimeTypeInfo=\"false\"\n"
+ "\t\tExceptionHandling=\"0\"\n";
+
+#if NEEDS_RTTI
+ properties << "\t\tRuntimeTypeInfo=\"true\"\n";
+#else
+ properties << "\t\tRuntimeTypeInfo=\"false\"\n";
+#endif
+
+ properties << "\t\tRuntimeTypeInfo=\"false\"\n"
"\t\tWarningLevel=\"4\"\n"
"\t\tWarnAsError=\"false\"\n"
"\t\tCompileAs=\"0\"\n"
@@ -238,7 +246,7 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
"\t\tIgnoreDefaultLibraryNames=\"\"\n"
"\t\tSubSystem=\"1\"\n"
"\t\tEntryPointSymbol=\"WinMainCRTStartup\"\n"
- "\t\tAdditionalLibraryDirectories=\"$(SCUMMVM_LIBS)\\lib\\" << ((bits == 32) ? "x86" : "x64") << "\"\n"
+ "\t\tAdditionalLibraryDirectories=\"$(" << LIBS_DEFINE << ")\\lib\\" << ((bits == 32) ? "x86" : "x64") << "\"\n"
"\t/>\n"
"\t\n"
"\n"
"\t NUL 2>&1
xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1
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 "%~1/backends/vkeybd/packs/vkeybd_default.zip" %~2 > NUL 2>&1
goto done
:error_root
--
cgit v1.2.3
From 175e441efa06a62d482695062dd331213ffeb5f6 Mon Sep 17 00:00:00 2001
From: Littleboy
Date: Tue, 26 Apr 2011 09:50:24 -0400
Subject: TOOLS: Add NSIS installer script template to update-version.pl list
of files to process
---
devtools/update-version.pl | 1 +
1 file changed, 1 insertion(+)
(limited to 'devtools')
diff --git a/devtools/update-version.pl b/devtools/update-version.pl
index 91e9e2492b..788cbc7e40 100755
--- a/devtools/update-version.pl
+++ b/devtools/update-version.pl
@@ -39,6 +39,7 @@ my @subs_files = qw(
dists/macosx/Info.plist
dists/iphone/Info.plist
dists/irix/scummvm.spec
+ dists/nsis/scummvm.nsi
dists/wii/meta.xml
dists/android/AndroidManifest.xml
dists/android/plugin-manifest.xml
--
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/create_project.cpp | 5 +
devtools/create_project/create_project.h | 6 +-
devtools/create_project/msbuild.cpp | 2 +-
devtools/create_project/msvc.cpp | 7 +-
devtools/create_project/msvc.h | 9 +-
.../create_project/msvc10/create_project.vcxproj | 1 +
.../msvc10/create_project.vcxproj.filters | 3 +
.../create_project/msvc8/create_project.vcproj | 4 +
.../create_project/msvc9/create_project.vcproj | 4 +
devtools/create_project/scripts/installer.vbs | 170 +++++++++++++++++++++
devtools/create_project/scripts/postbuild.cmd | 41 +++--
devtools/create_project/visualstudio.cpp | 2 +-
12 files changed, 236 insertions(+), 18 deletions(-)
create mode 100644 devtools/create_project/scripts/installer.vbs
(limited to 'devtools')
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index a597ba36e9..affd8f8675 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -245,6 +245,9 @@ int main(int argc, char *argv[]) {
} else if (!std::strcmp(argv[i], "--build-events")) {
setup.runBuildEvents = true;
+ } else if (!std::strcmp(argv[i], "--installer")) {
+ setup.runBuildEvents = true;
+ setup.createInstaller = true;
} else {
std::cerr << "ERROR: Unknown parameter \"" << argv[i] << "\"\n";
return -1;
@@ -487,6 +490,8 @@ void displayHelp(const char *exe) {
" The default is \"9\", thus \"Visual Studio 2008\"\n"
" --build-events Run custom build events as part of the build\n"
" (default: false)\n"
+ " --installer Create NSIS installer after the build (implies --build-events)\n"
+ " (default: false)\n"
"\n"
"Engines settings:\n"
" --list-engines list all available engines and their default state\n"
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index c228c34898..8968610e99 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -220,10 +220,12 @@ struct BuildSetup {
StringList defines; ///< List of all defines for the build.
StringList libraries; ///< List of all external libraries required for the build.
- bool runBuildEvents;
+ bool runBuildEvents; ///< Run build events as part of the build (generate revision number and copy engine/theme data & needed files to the build folder
+ bool createInstaller; ///< Create NSIS installer after the build
BuildSetup() {
- runBuildEvents = false;
+ runBuildEvents = false;
+ createInstaller = false;
}
};
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index 9d8b9c0407..36ea710c82 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -275,7 +275,7 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
// Copy data files to the build folder
project << "\t\t\n"
"\t\t\tCopy data files to the build folder\n"
- "\t\t\t" << getPostBuildEvent(isWin32) << "\n"
+ "\t\t\t" << getPostBuildEvent(isWin32, setup.createInstaller) << "\n"
"\t\t\n";
}
}
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";
diff --git a/devtools/create_project/msvc.h b/devtools/create_project/msvc.h
index b2f2a5d33f..6c8ac33a76 100644
--- a/devtools/create_project/msvc.h
+++ b/devtools/create_project/msvc.h
@@ -89,11 +89,14 @@ protected:
std::string getPreBuildEvent() const;
/**
- * Get the command line for copying data files to the build directory
+ * Get the command line for copying data files to the build directory.
*
- * @param isWin32 Bitness of property file
+ * @param isWin32 Bitness of property file.
+ * @param createInstaller true to NSIS create installer
+ *
+ * @return The post build event.
*/
- std::string getPostBuildEvent(bool isWin32) const;
+ std::string getPostBuildEvent(bool isWin32, bool createInstaller) const;
};
} // End of CreateProjectTool namespace
diff --git a/devtools/create_project/msvc10/create_project.vcxproj b/devtools/create_project/msvc10/create_project.vcxproj
index 15ce217bfc..bf5e415b5d 100644
--- a/devtools/create_project/msvc10/create_project.vcxproj
+++ b/devtools/create_project/msvc10/create_project.vcxproj
@@ -108,6 +108,7 @@ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\
+
diff --git a/devtools/create_project/msvc10/create_project.vcxproj.filters b/devtools/create_project/msvc10/create_project.vcxproj.filters
index 42db5aa97e..b5e870824e 100644
--- a/devtools/create_project/msvc10/create_project.vcxproj.filters
+++ b/devtools/create_project/msvc10/create_project.vcxproj.filters
@@ -58,5 +58,8 @@
scripts
+
+ scripts
+
\ No newline at end of file
diff --git a/devtools/create_project/msvc8/create_project.vcproj b/devtools/create_project/msvc8/create_project.vcproj
index 9cd833ea23..639b23d6e7 100644
--- a/devtools/create_project/msvc8/create_project.vcproj
+++ b/devtools/create_project/msvc8/create_project.vcproj
@@ -232,6 +232,10 @@
RelativePath="..\scripts\revision.vbs"
>
+
+
diff --git a/devtools/create_project/msvc9/create_project.vcproj b/devtools/create_project/msvc9/create_project.vcproj
index 4e0375c35e..f56cbd711c 100644
--- a/devtools/create_project/msvc9/create_project.vcproj
+++ b/devtools/create_project/msvc9/create_project.vcproj
@@ -233,6 +233,10 @@
RelativePath="..\scripts\revision.vbs"
>
+
+
diff --git a/devtools/create_project/scripts/installer.vbs b/devtools/create_project/scripts/installer.vbs
new file mode 100644
index 0000000000..3348b692e5
--- /dev/null
+++ b/devtools/create_project/scripts/installer.vbs
@@ -0,0 +1,170 @@
+'
+' ScummVM - Graphic Adventure Engine
+'
+' ScummVM is the legal property of its developers, whose names
+' are too numerous to list here. Please refer to the COPYRIGHT
+' file distributed with this source distribution.
+'
+' This program is free software; you can redistribute it and/or
+' modify it under the terms of the GNU General Public License
+' as published by the Free Software Foundation, version 2
+' of the License.
+'
+' This program is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU General Public License for more details.
+'
+' You should have received a copy of the GNU General Public License
+' along with this program; if not, write to the Free Software
+' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+'
+'/
+
+Option Explicit
+
+Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
+Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
+
+' Folders
+Dim rootFolder : rootFolder = ""
+Dim targetFolder : targetFolder = ""
+
+' Parse our command line arguments
+If ParseCommandLine() Then
+ CreateInstaller()
+End If
+
+'////////////////////////////////////////////////////////////////
+'// Installer creation
+'////////////////////////////////////////////////////////////////
+Sub CreateInstaller()
+ ' Get nsis installation folder
+ Dim nsisPath : nsisPath = GetNSISPath()
+ If (nsisPath = "") Then
+ Exit Sub
+ End If
+
+ ' Build command line
+ Dim commandLine : commandLine = """" & nsisPath & "\makensis.exe"" /V2" & _
+ " /Dtop_srcdir=""" & rootFolder & """" & _
+ " /Dbuild_dir=""" & targetFolder & """" & _
+ " /Dtext_dir=""" & targetFolder & """" & _
+ " """ & rootFolder & "\dists\nsis\scummvm.nsi"""
+
+ Dim oExec: Set oExec = WshShell.Exec(commandline)
+ If Err.Number <> 0 Then
+ Wscript.StdErr.WriteLine "Error running makensis.exe!"
+ Exit Sub
+ End If
+
+ ' Wait till the application is finished ...
+ Dim ostdOut : Set oStdOut = oExec.StdOut
+ Do While oExec.Status = 0
+ If Not ostdOut.AtEndOfStream Then
+ Wscript.StdErr.WriteLine ostdOut.ReadAll
+ End If
+
+ WScript.Sleep 100
+ Loop
+
+ If oExec.ExitCode <> 0 Then
+ Wscript.StdErr.WriteLine "Error while creating installer!"
+ Exit Sub
+ End If
+End Sub
+
+Function GetNSISPath()
+ ' Get the directory where NSIS (should) reside(s)
+ Dim sNSIS
+
+ ' First, try with 32-bit architecture
+ sNSIS = ReadRegistryKey("HKLM", "SOFTWARE\NSIS", "", 32)
+
+ If sNSIS = "" Or IsNull(sNSIS) Then
+ ' No 32-bit version of TortoiseSVN installed, try 64-bit version (doesn't hurt on 32-bit machines, it returns nothing or is ignored)
+ sNSIS = ReadRegistryKey("HKLM", "SOFTWARE\NSIS", "", 64)
+ End If
+
+ ' Check if Tortoise is present
+ If sNSIS = "" Then
+ Wscript.StdErr.WriteLine "NSIS not installed!"
+ Exit Function
+ End If
+
+ GetNSISPath = sNSIS
+End Function
+
+'////////////////////////////////////////////////////////////////
+'// Utilities
+'////////////////////////////////////////////////////////////////
+Function ParseCommandLine()
+ ParseCommandLine = True
+
+ If Wscript.Arguments.Count <> 2 Then
+ Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 2)"
+
+ ParseCommandLine = False
+ Exit Function
+ End If
+
+ ' Get our arguments
+ rootFolder = Wscript.Arguments.Item(0)
+ targetFolder = Wscript.Arguments.Item(1)
+
+ ' Check that the folders are valid
+ If Not FSO.FolderExists(rootFolder) Then
+ Wscript.StdErr.WriteLine "[Error] Invalid root folder (" & rootFolder & ")"
+
+ ParseCommandLine = False
+ Exit Function
+ End If
+
+ If Not FSO.FolderExists(targetFolder) Then
+ Wscript.StdErr.WriteLine "[Error] Invalid target folder (" & targetFolder & ")"
+
+ ParseCommandLine = False
+ Exit Function
+ End If
+
+ ' Set absolute paths
+ rootFolder = FSO.GetAbsolutePathName(rootFolder)
+ targetFolder = FSO.GetAbsolutePathName(targetFolder)
+End Function
+
+Function ReadRegistryKey(shive, subkey, valuename, architecture)
+ Dim hiveKey, objCtx, objLocator, objServices, objReg, Inparams, Outparams
+
+ ' First, get the Registry Provider for the requested architecture
+ Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+ objCtx.Add "__ProviderArchitecture", architecture ' Must be 64 of 32
+ Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
+ Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
+ Set objReg = objServices.Get("StdRegProv")
+
+ ' Check the hive and give it the right value
+ Select Case shive
+ Case "HKCR", "HKEY_CLASSES_ROOT"
+ hiveKey = &h80000000
+ Case "HKCU", "HKEY_CURRENT_USER"
+ hiveKey = &H80000001
+ Case "HKLM", "HKEY_LOCAL_MACHINE"
+ hiveKey = &h80000002
+ Case "HKU", "HKEY_USERS"
+ hiveKey = &h80000003
+ Case "HKCC", "HKEY_CURRENT_CONFIG"
+ hiveKey = &h80000005
+ Case "HKDD", "HKEY_DYN_DATA" ' Only valid for Windows 95/98
+ hiveKey = &h80000006
+ Case Else
+ MsgBox "Hive not valid (ReadRegistryKey)"
+ End Select
+
+ Set Inparams = objReg.Methods_("GetStringValue").Inparameters
+ Inparams.Hdefkey = hiveKey
+ Inparams.Ssubkeyname = subkey
+ Inparams.Svaluename = valuename
+ Set Outparams = objReg.ExecMethod_("GetStringValue", Inparams,,objCtx)
+
+ ReadRegistryKey = Outparams.SValue
+End Function
\ No newline at end of file
diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd
index 6c062f7ab1..aacf7255d0 100644
--- a/devtools/create_project/scripts/postbuild.cmd
+++ b/devtools/create_project/scripts/postbuild.cmd
@@ -1,34 +1,49 @@
-REM @echo off
+@echo off
REM ---------------------------------------------------------------
REM -- Post-Build Script
REM ---------------------------------------------------------------
REM
REM Copy engine data, themes, translation and required dlls to the
-REM output folder.
+REM output folder and optionnaly create an installer
REM
REM Expected parameters
REM Root folder
REM Output folder
REM Architecture
REM Libs folder
+REM Installer ("1" to build, "0" to skip)
if "%~1"=="" goto error_root
if "%~2"=="" goto error_output
if "%~3"=="" goto error_arch
if "%~4"=="" goto error_libs
+if "%~5"=="" goto error_installer
echo Copying data files
echo.
-REM Copy files
-xcopy /F /Y "%~1/dists/engine-data/*.dat" %~2 > NUL 2>&1
-xcopy /F /Y "%~1/dists/engine-data/*.tbl" %~2 > NUL 2>&1
-xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 > NUL 2>&1
-xcopy /F /Y "%~1/dists/engine-data/README" %~2 > NUL 2>&1
-xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/AUTHORS" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/COPYING.GPL" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/COPYING" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/COPYING.LGPL" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/COPYRIGHT" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/NEWS" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/README" %~2 > NUL 2>&1
+
+xcopy /F /Y "%~1/dists/engine-data/*.dat" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/dists/engine-data/*.tbl" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1
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/lib/%~3/SDL.dll" %~2 > NUL 2>&1
+
+if "%~5"=="0" goto done
+
+echo Running installer script
+echo.
+@call cscript "%~1/devtools/create_project/scripts/installer.vbs" %~1 %~2 1>NUL
+if not %errorlevel% == 0 goto error_script
goto done
:error_root
@@ -47,5 +62,13 @@ goto done
echo Invalid libs folder (%~4)!
goto done
+:error_installer
+echo Invalid installer parameter. Should be "0" or "1" (was %~5)!
+goto done
+
+:error_script:
+echo An error occured while running the installer script!
+goto done
+
:done
exit /B0
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index 2997e3096a..e405e42e54 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -63,7 +63,7 @@ int VisualStudioProvider::getVisualStudioVersion() {
"\t\t\t\tCommandLine=\"" << getPreBuildEvent() << "\"\n" \
"\t\t\t/>\n" \
"\t\t\t\n"; \
}
--
cgit v1.2.3
From 606f3fd855724c568ae13bc94d4fef09fa085f21 Mon Sep 17 00:00:00 2001
From: Thierry Crozat
Date: Wed, 27 Apr 2011 20:42:27 +0100
Subject: CREDITS: Remove nickname for Spanish translator.
He asked me to keep only his full name and remove the nickname.
---
devtools/credits.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'devtools')
diff --git a/devtools/credits.pl b/devtools/credits.pl
index 94f72617af..c45f16eec9 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -960,7 +960,7 @@ begin_credits("Credits");
add_person("Eugene Sandulenko", "sev", "");
end_section();
begin_section("Spanish");
- add_person("Tomás Maidagan", "Truido", "");
+ add_person("Tomás Maidagan", "", "");
end_section();
begin_section("Swedish");
add_person("Hampus Flink", "", "");
--
cgit v1.2.3
From 801c27bd224f20370e152372941510964a85a6c3 Mon Sep 17 00:00:00 2001
From: Littleboy
Date: Wed, 27 Apr 2011 17:00:38 -0400
Subject: TOOLS: Exclude .o files from projects files generated by
create_project
---
devtools/create_project/create_project.cpp | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
(limited to 'devtools')
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 148cd40f0e..aa3960d042 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -798,9 +798,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.
@@ -830,7 +831,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 {
--
cgit v1.2.3
From 5618276f1884788f44c0f43d7a287e800ba8b5e8 Mon Sep 17 00:00:00 2001
From: Littleboy
Date: Thu, 28 Apr 2011 05:02:39 -0400
Subject: TOOLS: Add documentation to create_project installer/revision build
scripts
---
devtools/create_project/scripts/installer.vbs | 16 +++++++++++++++-
devtools/create_project/scripts/revision.vbs | 17 ++++++++++++++++-
2 files changed, 31 insertions(+), 2 deletions(-)
(limited to 'devtools')
diff --git a/devtools/create_project/scripts/installer.vbs b/devtools/create_project/scripts/installer.vbs
index 3348b692e5..716fa279a9 100644
--- a/devtools/create_project/scripts/installer.vbs
+++ b/devtools/create_project/scripts/installer.vbs
@@ -21,6 +21,20 @@
'
'/
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+' This script calls the makensis tool to generate a NSIS Windows installer for ScummVM
+'
+' It tries to read the NSIS installation folder from the registry and then calls the
+' command line script compiler to create the installer.
+'
+' This is called from the postbuild.cmd batch file
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+'================================================================
+' TODO: Reduce duplication with revision.vbs script
+' (ReadRegistryKey and ParseCommandLine are identical)
+'================================================================
+
Option Explicit
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
@@ -167,4 +181,4 @@ Function ReadRegistryKey(shive, subkey, valuename, architecture)
Set Outparams = objReg.ExecMethod_("GetStringValue", Inparams,,objCtx)
ReadRegistryKey = Outparams.SValue
-End Function
\ No newline at end of file
+End Function
diff --git a/devtools/create_project/scripts/revision.vbs b/devtools/create_project/scripts/revision.vbs
index 9c29a88f2d..fb904856ec 100644
--- a/devtools/create_project/scripts/revision.vbs
+++ b/devtools/create_project/scripts/revision.vbs
@@ -23,6 +23,21 @@
'
'/
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+' This script tries to determine a revision number based on the current working tree
+' by trying revision control tools in the following order:
+' - git (with hg-git detection)
+' - mercurial
+' - TortoiseSVN
+' - SVN
+'
+' It then writes a new header file to be included during build, with the revision
+' information, the current branch, the revision control system (when not git) and
+' a flag when the tree is dirty.
+'
+' This is called from the prebuild.cmd batch file
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
Option Explicit
' Working copy check priority:
@@ -216,7 +231,7 @@ Function DetermineGitVersion()
Wscript.StdErr.Write " Git... "
tool = "git"
- ' First check if we have both a .git & .svn folders (in case hg-git has been set up to have the git folder at the working copy level)
+ ' First check if we have both a .git & .hg folders (in case hg-git has been set up to have the git folder at the working copy level)
If FSO.FolderExists(rootFolder & "/.git") And FSO.FolderExists(rootFolder & "/.hg") Then
Wscript.StdErr.WriteLine "Mercurial clone with git repository in tree!"
Exit Function
--
cgit v1.2.3
From 8a02cf47320a9c2e8b6601ed61ee4d8264f4de09 Mon Sep 17 00:00:00 2001
From: Littleboy
Date: Thu, 28 Apr 2011 05:04:06 -0400
Subject: DISTS: Copy/use README-SDL to/from the build folder (it is copied
from out of tree)
---
devtools/create_project/scripts/postbuild.cmd | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
(limited to 'devtools')
diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd
index aacf7255d0..a9ffecabcf 100644
--- a/devtools/create_project/scripts/postbuild.cmd
+++ b/devtools/create_project/scripts/postbuild.cmd
@@ -5,7 +5,7 @@ REM -- Post-Build Script
REM ---------------------------------------------------------------
REM
REM Copy engine data, themes, translation and required dlls to the
-REM output folder and optionnaly create an installer
+REM output folder and optionally create an installer
REM
REM Expected parameters
REM Root folder
@@ -23,13 +23,13 @@ if "%~5"=="" goto error_installer
echo Copying data files
echo.
-xcopy /F /Y "%~1/AUTHORS" %~2 > NUL 2>&1
-xcopy /F /Y "%~1/COPYING.GPL" %~2 > NUL 2>&1
-xcopy /F /Y "%~1/COPYING" %~2 > NUL 2>&1
-xcopy /F /Y "%~1/COPYING.LGPL" %~2 > NUL 2>&1
-xcopy /F /Y "%~1/COPYRIGHT" %~2 > NUL 2>&1
-xcopy /F /Y "%~1/NEWS" %~2 > NUL 2>&1
-xcopy /F /Y "%~1/README" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/AUTHORS" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/COPYING.GPL" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/COPYING" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/COPYING.LGPL" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/COPYRIGHT" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/NEWS" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/README" %~2 > NUL 2>&1
xcopy /F /Y "%~1/dists/engine-data/*.dat" %~2 > NUL 2>&1
xcopy /F /Y "%~1/dists/engine-data/*.tbl" %~2 > NUL 2>&1
@@ -37,6 +37,7 @@ xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 > NUL 2>&1
xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1
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
if "%~5"=="0" goto done
--
cgit v1.2.3
From 7f889c61011e0d780e190e5aecdb4c157862560c Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Thu, 28 Apr 2011 16:42:16 +0200
Subject: CREATE_PROJECT: Get rid of variadic macro usage.
Variadic macros are C99 and ugly in C++. If we would want to do it differently
we should rather rely on C++0x's initializer lists. But since we cannot assume
all compilers we want create_project to build support that we cannot do that.
---
devtools/create_project/create_project.cpp | 68 ++++++++++++++++++++----------
devtools/create_project/create_project.h | 28 ------------
2 files changed, 46 insertions(+), 50 deletions(-)
(limited to 'devtools')
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index aa3960d042..475a18bd11 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -295,19 +295,6 @@ 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
StringList globalWarnings;
std::map projectWarnings;
@@ -342,9 +329,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);
@@ -421,12 +422,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);
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index c228c34898..f4d2a0a66a 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -32,34 +32,6 @@
#include
-// 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 StringList;
/**
--
cgit v1.2.3
From 78a0db127ab5ccbe53adf86dde1f040364ad3282 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Thu, 28 Apr 2011 16:45:54 +0200
Subject: CREATE_PROJECT: Add a FIXME related to our warning lists.
---
devtools/create_project/create_project.cpp | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'devtools')
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 475a18bd11..35f68a12c0 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -296,6 +296,11 @@ int main(int argc, char *argv[]) {
#endif
// 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 projectWarnings;
--
cgit v1.2.3
From 1279264c373ad7f84a1a500ab9514e16847f1812 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Thu, 28 Apr 2011 17:44:17 +0200
Subject: CREATE_PROJECT: Replace macros by proper functions/methods.
---
devtools/create_project/msbuild.cpp | 159 +++++++++++++++++--------------
devtools/create_project/msbuild.h | 3 +
devtools/create_project/visualstudio.cpp | 89 ++++++++---------
devtools/create_project/visualstudio.h | 4 +
4 files changed, 133 insertions(+), 122 deletions(-)
(limited to 'devtools')
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index 9d8b9c0407..06425dd4aa 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\n" \
- "\t\t\t" << config << "\n" \
- "\t\t\t" << platform << "\n" \
- "\t\t\n")
-
-#define OUTPUT_CONFIGURATION_TYPE_MSBUILD(config) \
- (project << "\t\n" \
- "\t\t" << (name == PROJECT_NAME ? "Application" : "StaticLibrary") << "\n" \
- "\t\n")
-
-#define OUTPUT_PROPERTIES_MSBUILD(config, properties) \
- (project << "\t\n" \
- "\t\t\n" \
- "\t\t\n" \
- "\t\n")
+namespace {
+
+inline void outputConfiguration(std::ostream &project, const std::string &config, const std::string &platform) {
+ project << "\t\t\n"
+ "\t\t\t" << config << "\n"
+ "\t\t\t" << platform << "\n"
+ "\t\t\n";
+}
+
+inline void outputConfigurationType(std::ostream &project, const std::string &name, const std::string &config) {
+ project << "\t\n"
+ "\t\t" << (name == PROJECT_NAME ? "Application" : "StaticLibrary") << "\n"
+ "\t\n";
+}
+
+inline void outputProperties(std::ostream &project, const std::string &config, const std::string &properties) {
+ project << "\t\n"
+ "\t\t\n"
+ "\t\t\n"
+ "\t\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
"\n"
"\t\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\n";
@@ -99,23 +106,23 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
// Shared configuration
project << "\t\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\n"
"\t\n"
"\t\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\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\n"; \
- for (std::list::const_iterator entry = files.begin(); entry != files.end(); ++entry) { \
- if ((*entry).filter != "") { \
- filters << "\t\t<" action " Include=\"" << (*entry).path << "\">\n" \
- "\t\t\t" << (*entry).filter << "\n" \
- "\t\t" action ">\n"; \
- } else { \
- filters << "\t\t<" action " Include=\"" << (*entry).path << "\" />\n"; \
- } \
- } \
- filters << "\t\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\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 << "";
}
+void MSBuildProvider::outputFilter(std::ostream &filters, const FileEntries &files, const std::string &action) {
+ if (!files.empty()) {
+ filters << "\t\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" << (*entry).filter << "\n"
+ "\t\t" << action << ">\n";
+ } else {
+ filters << "\t\t<" << action << " Include=\"" << (*entry).path << "\" />\n";
+ }
+ }
+ filters << "\t\n";
+ }
+}
+
void MSBuildProvider::writeReferences(std::ofstream &output) {
output << "\t\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\tnasm.exe -f win32 -g -o \"$(IntDir)" << (isDuplicate ? (*entry).prefix : "") << "%(Filename).obj\" \"%(FullPath)\"\n" \
- "\t\t\t$(IntDir)" << (isDuplicate ? (*entry).prefix : "") << "%(Filename).obj;%(Outputs)\n";
-
-#define OUPUT_FILES_MSBUILD(files, action) \
- if (!files.empty()) { \
- projectFile << "\t\n"; \
- for (std::list::const_iterator entry = files.begin(); entry != files.end(); ++entry) { \
- projectFile << "\t\t<" action " Include=\"" << (*entry).path << "\" />\n"; \
- } \
- projectFile << "\t\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\tnasm.exe -f win32 -g -o \"$(IntDir)" << prefix << "%(Filename).obj\" \"%(FullPath)\"\n"
+ "\t\t\t$(IntDir)" << prefix << "%(Filename).obj;%(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\n"
"\t\t\tDocument\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\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\n";
+ for (FileEntries::const_iterator entry = files.begin(), end = files.end(); entry != end; ++entry) {
+ projectFile << "\t\t<" << action << " Include=\"" << (*entry).path << "\" />\n";
+ }
+ projectFile << "\t\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/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index 2997e3096a..77af8aeca1 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\n" \
- "\t\t\t\n"; \
- }
-
-#define OUTPUT_CONFIGURATION_MAIN(config, platform, props, isWin32) { \
- project << "\t\t\n" \
- "\t\t\t\n" \
- "\t\t\t\n"; \
- OUTPUT_BUILD_EVENTS(isWin32) \
- project << "\t\t\n"; \
-}
-
-#define OUTPUT_CONFIGURATION_DEBUG(config, platform, props, isWin32) { \
- project << "\t\t\n" \
- "\t\t\t\n" \
- "\t\t\t\n"; \
- OUTPUT_BUILD_EVENTS(isWin32) \
- project << "\t\t\n"; \
-}
-
-#define OUTPUT_CONFIGURATION(config, platform, props) { \
- project << "\t\t\n" \
- "\t\t\t\n" \
- "\t\t\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\n"
@@ -181,6 +145,33 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
"\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\n"
+ "\t\t\t\n"
+ "\t\t\t\n";
+ outputBuildEvents(project, setup, isWin32);
+ project << "\t\t\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\n"
+ "\t\t\t\n"
+ "\t\t\n";
+}
+
+void VisualStudioProvider::outputBuildEvents(std::ostream &project, const BuildSetup &setup, const bool isWin32) {
+ if (setup.runBuildEvents) {
+ project << "\t\t\t\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 2 Then
- Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 2)"
+ If Wscript.Arguments.Count <> 3 Then
+ Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 3)"
ParseCommandLine = False
Exit Function
@@ -125,6 +136,7 @@ Function ParseCommandLine()
' Get our arguments
rootFolder = Wscript.Arguments.Item(0)
targetFolder = Wscript.Arguments.Item(1)
+ arch = Wscript.Arguments.Item(2)
' Check that the folders are valid
If Not FSO.FolderExists(rootFolder) Then
diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd
index da61afcc3c..e78861463a 100644
--- a/devtools/create_project/scripts/postbuild.cmd
+++ b/devtools/create_project/scripts/postbuild.cmd
@@ -45,7 +45,7 @@ if "%~5"=="0" goto done
echo Running installer script
echo.
-@call cscript "%~1/devtools/create_project/scripts/installer.vbs" %~1 %~2 1>NUL
+@call cscript "%~1/devtools/create_project/scripts/installer.vbs" %~1 %~2 %~3 1>NUL
if not %errorlevel% == 0 goto error_script
goto done
--
cgit v1.2.3
From 3f370629020d0d13c2612a55566b2c3480acc4eb Mon Sep 17 00:00:00 2001
From: Littleboy
Date: Thu, 5 May 2011 13:53:32 -0400
Subject: CREATE_PROJECT: Generate the same revision numbers as the configure
script
The revision number now includes the number of commits since the last tag
---
devtools/create_project/scripts/revision.vbs | 31 +++++++++++++++++++++-------
1 file changed, 23 insertions(+), 8 deletions(-)
(limited to 'devtools')
diff --git a/devtools/create_project/scripts/revision.vbs b/devtools/create_project/scripts/revision.vbs
index fb904856ec..3e1212521c 100644
--- a/devtools/create_project/scripts/revision.vbs
+++ b/devtools/create_project/scripts/revision.vbs
@@ -97,14 +97,15 @@ Sub DetermineRevision()
End If
End If
End If
-
- Wscript.StdErr.WriteLine "Found revision " & revision & " on branch " & branch & vbCrLf
-
+
+ Dim outputInfo : outputInfo = "Found revision " & revision & " on branch " & branch
+
' Setup our revision string
Dim revisionString : revisionString = revision
If (modified) Then
revisionString = revisionString & "-dirty"
+ outputInfo = outputInfo & " (dirty)"
End If
' If we are not on trunk, add the branch name to the revision string
@@ -115,7 +116,10 @@ Sub DetermineRevision()
' Add the DVCS name at the end (when not git)
If (tool <> "git") Then
revisionString = revisionString & "-" & tool
+ outputInfo = outputInfo & " using " & tool
End If
+
+ Wscript.StdErr.WriteLine outputInfo & vbCrLf
' Output revision header file
FSO.CopyFile rootFolder & "\\base\\internal_revision.h.in", targetFolder & "\\internal_revision.h"
@@ -228,6 +232,7 @@ Function DetermineGitVersion()
Err.Clear
On Error Resume Next
DetermineGitVersion = False
+ Dim line
Wscript.StdErr.Write " Git... "
tool = "git"
@@ -265,10 +270,10 @@ Function DetermineGitVersion()
End If
' Get the version hash
- Dim hash: hash = oExec.StdOut.ReadLine()
+ Dim hash : hash = oExec.StdOut.ReadLine()
' Make sure index is in sync with disk
- Set oExec = WshShell.Exec(gitPath & "update-index --refresh")
+ Set oExec = WshShell.Exec(gitPath & "update-index --refresh --unmerged")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
@@ -276,7 +281,7 @@ Function DetermineGitVersion()
Loop
End If
- Set oExec = WshShell.Exec(gitPath & "diff-index --exit-code --quiet HEAD " & rootFolder)
+ Set oExec = WshShell.Exec(gitPath & "diff-index --quiet HEAD " & rootFolder)
If oExec.ExitCode <> 0 Then
Wscript.StdErr.WriteLine "Error parsing git revision!"
Exit Function
@@ -294,14 +299,24 @@ Function DetermineGitVersion()
' Get branch name
Set oExec = WshShell.Exec(gitPath & "symbolic-ref HEAD")
If Err.Number = 0 Then
- Dim line: line = oExec.StdOut.ReadLine()
+ line = oExec.StdOut.ReadLine()
line = Mid(line, InStrRev(line, "/") + 1)
If line <> "master" Then
branch = line
End If
End If
- ' Fallback to abbreviated revision number
+ ' Get revision description
+ Set oExec = WshShell.Exec(gitPath & "describe --match desc/*")
+ If Err.Number = 0 Then
+ line = oExec.StdOut.ReadLine()
+ line = Mid(line, InStr(line, "-") + 1)
+ If line <> "" Then
+ revision = line
+ End If
+ End If
+
+ ' Fallback to abbreviated revision number if needed
If revision = "" Then
revision = Mid(hash, 1, 7)
End If
--
cgit v1.2.3
From d41c32d363e985f4d5b64795bbccebe976bdd5c4 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Thu, 5 May 2011 20:28:43 +0200
Subject: BUILD: Get rid of old MSVC style win resource support.
---
devtools/create_project/msbuild.cpp | 1 -
devtools/create_project/visualstudio.cpp | 1 -
2 files changed, 2 deletions(-)
(limited to 'devtools')
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index 06425dd4aa..8143c92c35 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -340,7 +340,6 @@ void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits,
"\t\t\tWinMainCRTStartup\n"
"\t\t\n"
"\t\t\n"
- "\t\t\tHAS_INCLUDE_SET;%(PreprocessorDefinitions)\n"
"\t\t\t" << prefix << ";%(AdditionalIncludeDirectories)\n"
"\t\t\n"
"\t\n"
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index 77af8aeca1..1c52e9d3c1 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -241,7 +241,6 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
"\t/>\n"
"\t\n"
"\n";
--
cgit v1.2.3
From 3758dcbbcc6006aa2d16b90501fd0ea818a47d79 Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Fri, 6 May 2011 19:39:12 +1000
Subject: DEVTOOLS: Bugfix for CREATE_PROJECT creating duplicate tag in Visual
Studio projects
---
devtools/create_project/visualstudio.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
(limited to 'devtools')
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index f0901907e2..3acb283652 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -223,8 +223,7 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
properties << "\t\tRuntimeTypeInfo=\"false\"\n";
#endif
- properties << "\t\tRuntimeTypeInfo=\"false\"\n"
- "\t\tWarningLevel=\"4\"\n"
+ properties << "\t\tWarningLevel=\"4\"\n"
"\t\tWarnAsError=\"false\"\n"
"\t\tCompileAs=\"0\"\n"
"\t\t/>\n"
--
cgit v1.2.3
From c35ef00c4a10bcd4d1c8d8e57d8a368b879fb059 Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Fri, 6 May 2011 21:09:44 +1000
Subject: DEVTOOLS: Fix linking failure in Visual Studio created project
---
devtools/create_project/visualstudio.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'devtools')
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index 3acb283652..a7a6ac84a7 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -148,7 +148,7 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
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\n"
"\t\t\t\n"
- "\t\t\t\n";
outputBuildEvents(project, setup, isWin32);
--
cgit v1.2.3
From dea5aa8a2017ec9b9abc16b34683a1e37aafbe46 Mon Sep 17 00:00:00 2001
From: Johannes Schickel
Date: Fri, 6 May 2011 20:41:21 +0200
Subject: CREATE_PROJECT: Fix module.mk parsing.
Formerly create_project incorrectly assumed that a given object file is only
present once in an module.mk file. This is not the case for backends/module.mk
for example. There the Windows FS object files are in two different if blocks.
In this particular case it resulted in the object file being added to both the
include list and the exclude list.
Now the module.mk handler prefers files being in the include list.
---
devtools/create_project/create_project.cpp | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
(limited to 'devtools')
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 7d112c7ffe..de82dd1698 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -1225,10 +1225,20 @@ void ProjectProvider::createModuleList(const std::string &moduleDir, const Strin
tokens = tokenize(line);
i = tokens.begin();
} else {
- if (shouldInclude.top())
- includeList.push_back(moduleDir + "/" + unifyPath(*i));
- else
- excludeList.push_back(moduleDir + "/" + unifyPath(*i));
+ const std::string filename = moduleDir + "/" + unifyPath(*i);
+
+ if (shouldInclude.top()) {
+ // In case we should include a file, we need to make
+ // sure it is not in the exclude list already. If it
+ // is we just drop it from the exclude list.
+ excludeList.remove(filename);
+
+ includeList.push_back(filename);
+ } else if (std::find(includeList.begin(), includeList.end(), filename) == includeList.end()) {
+ // We only add the file to the exclude list in case it
+ // has not yet been added to the include list.
+ excludeList.push_back(filename);
+ }
++i;
}
}
--
cgit v1.2.3