Merge remote-tracking branch 'upstream/master' into nsis

Conflicts:
	devtools/create_project/scripts/postbuild.cmd
	devtools/create_project/visualstudio.cpp
	ports.mk
This commit is contained in:
Littleboy 2011-05-02 17:18:22 -04:00
commit 0e45aa8655
985 changed files with 3861 additions and 2466 deletions

View file

@ -298,20 +298,12 @@ int main(int argc, char *argv[]) {
setup.libraries.push_back(ADDITIONAL_LIBRARY);
#endif
// Initialize global & project-specific warnings
#define SET_GLOBAL_WARNINGS(...) \
{ \
std::string global[PP_NARG(__VA_ARGS__)] = { __VA_ARGS__ }; \
globalWarnings.assign(global, global + (sizeof(global) / sizeof(global[0]))); \
}
#define SET_WARNINGS(name, ...) \
{ \
std::string project[PP_NARG(__VA_ARGS__)] = { __VA_ARGS__ }; \
projectWarnings[name].assign(project, project + (sizeof(project) / sizeof(project[0]))); \
}
// List of global warnings and map of project-specific warnings
// FIXME: As shown below these two structures have different behavior for
// Code::Blocks and MSVC. In Code::Blocks this is used to enable *and*
// disable certain warnings (and some other not warning related flags
// actually...). While in MSVC this is solely for disabling warnings.
// That is really not nice. We should consider a nicer way of doing this.
StringList globalWarnings;
std::map<std::string, StringList> projectWarnings;
@ -345,9 +337,23 @@ int main(int argc, char *argv[]) {
//
////////////////////////////////////////////////////////////////////////////
SET_GLOBAL_WARNINGS("-Wall", "-Wno-long-long", "-Wno-multichar", "-Wno-unknown-pragmas", "-Wno-reorder",
"-Wpointer-arith", "-Wcast-qual", "-Wcast-align", "-Wshadow", "-Wimplicit",
"-Wnon-virtual-dtor", "-Wwrite-strings", "-fno-rtti", "-fno-exceptions", "-fcheck-new");
globalWarnings.push_back("-Wall");
globalWarnings.push_back("-Wno-long-long");
globalWarnings.push_back("-Wno-multichar");
globalWarnings.push_back("-Wno-unknown-pragmas");
globalWarnings.push_back("-Wno-reorder");
globalWarnings.push_back("-Wpointer-arith");
globalWarnings.push_back("-Wcast-qual");
globalWarnings.push_back("-Wcast-align");
globalWarnings.push_back("-Wshadow");
globalWarnings.push_back("-Wimplicit");
globalWarnings.push_back("-Wnon-virtual-dtor");
globalWarnings.push_back("-Wwrite-strings");
// The following are not warnings at all... We should consider adding them to
// a different list of parameters.
globalWarnings.push_back("-fno-rtti");
globalWarnings.push_back("-fno-exceptions");
globalWarnings.push_back("-fcheck-new");
provider = new CreateProjectTool::CodeBlocksProvider(globalWarnings, projectWarnings);
@ -424,12 +430,35 @@ int main(int argc, char *argv[]) {
//
////////////////////////////////////////////////////////////////////////////
SET_GLOBAL_WARNINGS("4068", "4100", "4103", "4127", "4244", "4250", "4310", "4351", "4512", "4702", "4706", "4800", "4996", "6204", "6211", "6385", "6386");
SET_WARNINGS("agi", "4510", "4610");
SET_WARNINGS("agos", "4511");
SET_WARNINGS("lure", "4189", "4355");
SET_WARNINGS("kyra", "4355");
SET_WARNINGS("m4", "4355");
globalWarnings.push_back("4068");
globalWarnings.push_back("4100");
globalWarnings.push_back("4103");
globalWarnings.push_back("4127");
globalWarnings.push_back("4244");
globalWarnings.push_back("4250");
globalWarnings.push_back("4310");
globalWarnings.push_back("4351");
globalWarnings.push_back("4512");
globalWarnings.push_back("4702");
globalWarnings.push_back("4706");
globalWarnings.push_back("4800");
globalWarnings.push_back("4996");
globalWarnings.push_back("6204");
globalWarnings.push_back("6211");
globalWarnings.push_back("6385");
globalWarnings.push_back("6386");
projectWarnings["agi"].push_back("4510");
projectWarnings["agi"].push_back("4610");
projectWarnings["agos"].push_back("4511");
projectWarnings["lure"].push_back("4189");
projectWarnings["lure"].push_back("4355");
projectWarnings["kyra"].push_back("4355");
projectWarnings["m4"].push_back("4355");
if (msvcVersion == 8 || msvcVersion == 9)
provider = new CreateProjectTool::VisualStudioProvider(globalWarnings, projectWarnings, msvcVersion);
@ -714,6 +743,7 @@ const Feature s_features[] = {
{ "opengl", "USE_OPENGL", "opengl32", true, "OpenGL support" },
{ "indeo3", "USE_INDEO3", "", true, "Indeo3 codec support"},
{ "translation", "USE_TRANSLATION", "", true, "Translation support" },
{ "vkeybd", "ENABLE_VKEYBD", "", false, "Virtual keyboard support"},
{ "langdetect", "USE_DETECTLANG", "", true, "System language detection support" } // This feature actually depends on "translation", there
// is just no current way of properly detecting this...
};
@ -802,9 +832,10 @@ bool producesObjectFile(const std::string &fileName) {
* Checks whether the give file in the specified directory is present in the given
* file list.
*
* This function does as special match against the file list. It will not take file
* extensions into consideration, when the extension of a file in the specified
* directory is one of "h", "cpp", "c" or "asm".
* This function does as special match against the file list. Object files (.o) are
* excluded by default and it will not take file extensions into consideration,
* when the extension of a file in the specified directory is one of "h", "cpp",
* "c" or "asm".
*
* @param dir Parent directory of the file.
* @param fileName File name to match.
@ -834,7 +865,9 @@ bool isInList(const std::string &dir, const std::string &fileName, const StringL
}
const std::string lastPathComponent = getLastPathComponent(*i);
if (!producesObjectFile(fileName) && extensionName != "h") {
if (extensionName == "o") {
return false;
} else if (!producesObjectFile(fileName) && extensionName != "h") {
if (fileName == lastPathComponent)
return true;
} else {