[Scummvm-cvs-logs] scummvm master -> dfaf97dda7e8e3533f6e43ffa718fa26c8007fc6

lordhoto lordhoto at gmail.com
Thu Mar 24 01:26:30 CET 2016


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
567a6b4712 DEVTOOLS: Slight formatting fix.
dfaf97dda7 DEVTOOLS: Improve SDL2 support in create_project.


Commit: 567a6b4712426958249c5686d3d4fb7ddbb8e3cc
    https://github.com/scummvm/scummvm/commit/567a6b4712426958249c5686d3d4fb7ddbb8e3cc
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2016-03-24T01:26:05+01:00

Commit Message:
DEVTOOLS: Slight formatting fix.

Changed paths:
    devtools/create_project/create_project.h



diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index fb207f3..0211f88 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -229,7 +229,7 @@ struct BuildSetup {
 	StringList testDirs;  ///< List of all folders containing tests
 
 	bool devTools;         ///< Generate project files for the tools
-	bool tests;             ///< Generate project files for the tests
+	bool tests;            ///< Generate project files for the tests
 	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
 


Commit: dfaf97dda7e8e3533f6e43ffa718fa26c8007fc6
    https://github.com/scummvm/scummvm/commit/dfaf97dda7e8e3533f6e43ffa718fa26c8007fc6
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2016-03-24T01:26:05+01:00

Commit Message:
DEVTOOLS: Improve SDL2 support in create_project.

This adapts MSBuild and XCode project generators to output project files which
can be used to build the SDL backend with SDL2 easily.

Changed paths:
    devtools/create_project/create_project.cpp
    devtools/create_project/create_project.h
    devtools/create_project/msbuild.cpp
    devtools/create_project/xcode.cpp



diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index adfe75c..0242af1 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -125,7 +125,6 @@ int main(int argc, char *argv[]) {
 
 	ProjectType projectType = kProjectNone;
 	int msvcVersion = 12;
-	bool useSDL2 = false;
 
 	// Parse command line arguments
 	using std::cout;
@@ -269,7 +268,7 @@ int main(int argc, char *argv[]) {
 		} else if (!std::strcmp(argv[i], "--tests")) {
 			setup.tests = true;
 		} else if (!std::strcmp(argv[i], "--sdl2")) {
-			useSDL2 = true;
+			setup.useSDL2 = true;
 		} else {
 			std::cerr << "ERROR: Unknown parameter \"" << argv[i] << "\"\n";
 			return -1;
@@ -349,11 +348,15 @@ int main(int argc, char *argv[]) {
 		setup.defines.push_back("IPHONE");
 	}
 	setup.defines.push_back("SDL_BACKEND");
-	if (!useSDL2) {
-		cout << "\nLinking to SDL 1.2\n\n";
+	if (!setup.useSDL2) {
+		cout << "\nBuilding against SDL 1.2\n\n";
 		setup.libraries.push_back("sdl");
 	} else {
-		cout << "\nLinking to SDL 2.0\n\n";
+		cout << "\nBuilding against SDL 2.0\n\n";
+		// TODO: This also defines USE_SDL2 in the preprocessor, we don't do
+		// this in our configure/make based build system. Adapt create_project
+		// to replicate this behavior.
+		setup.defines.push_back("USE_SDL2");
 		setup.libraries.push_back("sdl2");
 	}
 	setup.libraries.push_back("winmm");
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index 0211f88..1e417d4 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -232,12 +232,14 @@ struct BuildSetup {
 	bool tests;            ///< Generate project files for the tests
 	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
+	bool useSDL2;          ///< Whether to use SDL2 or not.
 
 	BuildSetup() {
 		devTools        = false;
 		tests           = false;
 		runBuildEvents  = false;
 		createInstaller = false;
+		useSDL2         = false;
 	}
 };
 
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index a804205..2c6a895 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -366,7 +366,7 @@ void MSBuildProvider::outputGlobalPropFile(const BuildSetup &setup, std::ofstrea
 	              "\t\t<_PropertySheetDisplayName>" << setup.projectDescription << "_Global</_PropertySheetDisplayName>\n"
 	              "\t\t<ExecutablePath>$(" << LIBS_DEFINE << ")\\bin;$(" << LIBS_DEFINE << ")\\bin\\" << (bits == 32 ? "x86" : "x64") << ";$(ExecutablePath)</ExecutablePath>\n"
 	              "\t\t<LibraryPath>$(" << LIBS_DEFINE << ")\\lib\\" << (bits == 32 ? "x86" : "x64") << ";$(" << LIBS_DEFINE << ")\\lib\\" << (bits == 32 ? "x86" : "x64") << "\\$(Configuration);$(LibraryPath)</LibraryPath>\n"
-	              "\t\t<IncludePath>$(" << LIBS_DEFINE << ")\\include;$(" << LIBS_DEFINE << ")\\include\\SDL;$(IncludePath)</IncludePath>\n"
+	              "\t\t<IncludePath>$(" << LIBS_DEFINE << ")\\include;$(" << LIBS_DEFINE << ")\\include\\" << (setup.useSDL2 ? "SDL2" : "SDL") << ";$(IncludePath)</IncludePath>\n"
 	              "\t\t<OutDir>$(Configuration)" << bits << "\\</OutDir>\n"
 	              "\t\t<IntDir>$(Configuration)" << bits << "\\$(ProjectName)\\</IntDir>\n"
 	              "\t</PropertyGroup>\n"
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index ac7a1d0..bfe7f52 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -927,7 +927,11 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
 	ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, kSettingsNoQuote | kSettingsAsList, 5);
 	ADD_SETTING_QUOTE(scummvmOSX_Debug, "GCC_VERSION", "");
 	ValueList scummvmOSX_HeaderPaths;
-	scummvmOSX_HeaderPaths.push_back("/opt/local/include/SDL");
+	if (setup.useSDL2) {
+		scummvmOSX_HeaderPaths.push_back("/opt/local/include/SDL2");
+	} else {
+		scummvmOSX_HeaderPaths.push_back("/opt/local/include/SDL");
+	}
 	scummvmOSX_HeaderPaths.push_back("/opt/local/include");
 	scummvmOSX_HeaderPaths.push_back("/opt/local/include/freetype2");
 	scummvmOSX_HeaderPaths.push_back("include/");
@@ -943,7 +947,6 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
 	ADD_SETTING_LIST(scummvmOSX_Debug, "LIBRARY_SEARCH_PATHS", scummvmOSX_LibPaths, kSettingsNoQuote | kSettingsAsList, 5);
 	ADD_SETTING_QUOTE(scummvmOSX_Debug, "OTHER_CFLAGS", "");
 	ValueList scummvmOSX_LdFlags;
-	scummvmOSX_LdFlags.push_back("-lSDLmain");
 	scummvmOSX_LdFlags.push_back("-logg");
 	scummvmOSX_LdFlags.push_back("-lpng");
 	scummvmOSX_LdFlags.push_back("-ljpeg");
@@ -953,7 +956,13 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
 	scummvmOSX_LdFlags.push_back("-lvorbis");
 	scummvmOSX_LdFlags.push_back("-lmad");
 	scummvmOSX_LdFlags.push_back("-lFLAC");
-	scummvmOSX_LdFlags.push_back("-lSDL");
+	if (setup.useSDL2) {
+		scummvmOSX_LdFlags.push_back("-lSDL2main");
+		scummvmOSX_LdFlags.push_back("-lSDL2");
+	} else {
+		scummvmOSX_LdFlags.push_back("-lSDLmain");
+		scummvmOSX_LdFlags.push_back("-lSDL");
+	}
 	scummvmOSX_LdFlags.push_back("-lz");
 	ADD_SETTING_LIST(scummvmOSX_Debug, "OTHER_LDFLAGS", scummvmOSX_LdFlags, kSettingsAsList, 5);
 	ADD_SETTING(scummvmOSX_Debug, "PREBINDING", "NO");






More information about the Scummvm-git-logs mailing list