From 8a3fc359b21cb9e83244bf869e6ae22ae98bb95d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 28 Apr 2020 08:56:51 +0200 Subject: [PATCH] DEVTOOLS: Modified macros, so they are less error-prone. Code generation for libsdl_net was always performed. The condition did not work as expected. Macros are dangerous. --- devtools/create_project/xcode.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index f0573392952..e7ffda91785 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -404,14 +404,14 @@ void XcodeProvider::setupCopyFilesBuildPhase() { // Nothing to do here } -#define DEF_SYSFRAMEWORK(framework) properties[framework".framework"] = FileProperty("wrapper.framework", framework".framework", "System/Library/Frameworks/" framework ".framework", "SDKROOT"); \ - ADD_SETTING_ORDER_NOVALUE(children, getHash(framework".framework"), framework".framework", fwOrder++); +#define DEF_SYSFRAMEWORK(framework) { properties[framework".framework"] = FileProperty("wrapper.framework", framework".framework", "System/Library/Frameworks/" framework ".framework", "SDKROOT"); \ + ADD_SETTING_ORDER_NOVALUE(children, getHash(framework".framework"), framework".framework", fwOrder++); } -#define DEF_SYSTBD(lib) properties[lib".tbd"] = FileProperty("sourcecode.text-based-dylib-definition", lib".tbd", "usr/lib/" lib ".tbd", "SDKROOT"); \ - ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".tbd"), lib".tbd", fwOrder++); +#define DEF_SYSTBD(lib) { properties[lib".tbd"] = FileProperty("sourcecode.text-based-dylib-definition", lib".tbd", "usr/lib/" lib ".tbd", "SDKROOT"); \ + ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".tbd"), lib".tbd", fwOrder++); } -#define DEF_LOCALLIB_STATIC_PATH(path,lib,absolute) properties[lib".a"] = FileProperty("archive.ar", lib ".a", path, (absolute ? "\"\"" : "\"\"")); \ - ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".a"), lib".a", fwOrder++); +#define DEF_LOCALLIB_STATIC_PATH(path,lib,absolute) { properties[lib".a"] = FileProperty("archive.ar", lib ".a", path, (absolute ? "\"\"" : "\"\"")); \ + ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".a"), lib".a", fwOrder++); } #define DEF_LOCALLIB_STATIC(lib) DEF_LOCALLIB_STATIC_PATH(lib ".a", lib, false) @@ -498,13 +498,15 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) { if (setup.useSDL2) { DEF_LOCALLIB_STATIC("libSDL2main"); DEF_LOCALLIB_STATIC("libSDL2"); - if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET")) + if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET")) { DEF_LOCALLIB_STATIC("libSDL2_net"); + } } else { DEF_LOCALLIB_STATIC("libSDLmain"); DEF_LOCALLIB_STATIC("libSDL"); - if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET")) + if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET")) { DEF_LOCALLIB_STATIC("libSDL_net"); + } } frameworksGroup->_properties["children"] = children;