aboutsummaryrefslogtreecommitdiff
path: root/devtools/create_project
diff options
context:
space:
mode:
authorSupSuper2019-07-01 03:06:07 +0100
committerFilippos Karapetis2019-07-02 01:02:27 +0300
commit69cb2ef728ab96bf820532a504655e7bc687d17a (patch)
tree296f2586fb0c9e0f2f5f8721363943d6e8b3f02d /devtools/create_project
parent7e6143a641f9749b0c5167526ca1827ebc2adebd (diff)
downloadscummvm-rg350-69cb2ef728ab96bf820532a504655e7bc687d17a.tar.gz
scummvm-rg350-69cb2ef728ab96bf820532a504655e7bc687d17a.tar.bz2
scummvm-rg350-69cb2ef728ab96bf820532a504655e7bc687d17a.zip
CREATE_PROJECT: Use stricter checks for Win32 dependencies
Instead of checking the project type, check the define. winmm and winsparkle are only required on Windows.
Diffstat (limited to 'devtools/create_project')
-rw-r--r--devtools/create_project/create_project.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index e85769c203..f705686a97 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -366,6 +366,7 @@ int main(int argc, char *argv[]) {
StringList featureDefines = getFeatureDefines(setup.features);
setup.defines.splice(setup.defines.begin(), featureDefines);
+ bool backendWin32 = false;
if (projectType == kProjectXcode) {
setup.defines.push_back("POSIX");
// Define both MACOSX, and IPHONE, but only one of them will be associated to the
@@ -376,13 +377,14 @@ int main(int argc, char *argv[]) {
setup.defines.push_back("MACOSX");
setup.defines.push_back("IPHONE");
} else if (projectType == kProjectMSVC || projectType == kProjectCodeBlocks) {
- // Windows only has support for the SDL backend, so we hardcode it here (along with winmm)
setup.defines.push_back("WIN32");
+ backendWin32 = true;
} else {
// As a last resort, select the backend files to build based on the platform used to build create_project.
// This is broken when cross compiling.
#if defined(_WIN32) || defined(WIN32)
setup.defines.push_back("WIN32");
+ backendWin32 = true;
#else
setup.defines.push_back("POSIX");
#endif
@@ -402,13 +404,13 @@ int main(int argc, char *argv[]) {
if (updatesEnabled) {
setup.defines.push_back("USE_SPARKLE");
- if (projectType != kProjectXcode)
+ if (backendWin32)
setup.libraries.push_back("winsparkle");
else
setup.libraries.push_back("sparkle");
}
- if (projectType == kProjectMSVC) {
+ if (backendWin32) {
if (curlEnabled) {
setup.defines.push_back("CURL_STATICLIB");
setup.libraries.push_back("ws2_32");
@@ -419,6 +421,7 @@ int main(int argc, char *argv[]) {
if (sdlnetEnabled) {
setup.libraries.push_back("iphlpapi");
}
+ setup.libraries.push_back("winmm");
}
setup.defines.push_back("SDL_BACKEND");
@@ -433,7 +436,6 @@ int main(int argc, char *argv[]) {
setup.defines.push_back("USE_SDL2");
setup.libraries.push_back("sdl2");
}
- setup.libraries.push_back("winmm");
// Add additional project-specific library
#ifdef ADDITIONAL_LIBRARY