diff options
Diffstat (limited to 'devtools/create_project')
-rw-r--r-- | devtools/create_project/create_project.cpp | 13 | ||||
-rw-r--r-- | devtools/create_project/create_project.h | 2 | ||||
-rw-r--r-- | devtools/create_project/msbuild.cpp | 2 | ||||
-rw-r--r-- | devtools/create_project/xcode.cpp | 15 |
4 files changed, 23 insertions, 9 deletions
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index adfe75c624..0242af1cfb 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 0211f88711..1e417d485b 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 a804205c42..2c6a89543f 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 ac7a1d0617..bfe7f522f0 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"); |