XCode 13.3 breaks compatibility with UE4.27.2

Hi,
I’m opening this discussion based on my own experience, as I couldn’t find any reference on the issue.

I’ve been working on a project using UE4.27.2 on a Mac, with macOS Monterey. Last month XCode was updated from version 13.2.1 to 13.3. This update makes UE4.27.2 projects incompatible with the compiler due an error on the references:

  • Unused Variables Warning blocks the execution of the Editor, in relation to a env. variable (WITH_EDITOR) on the UE Engine source code.
  • This variable seems to be set on Editor’s runtime (??).
  • It is needed to be included in order to compile project’s code. But, without a functional build, Editor cannot be launched.
  • This produces a loop, in which the project is no longer able to be compiled or executed.

More details on my previous Q&A thread: https://forums.unrealengine.com/t/macos-xcode-editor-fails-compiling-bc-unused-variables/521469/2

I was able to reproduce the error with my own, several-weeks-development project, and with fresh, new ones, created with a reinstalled version of the engine.

Easy workaround: reinstalling previous XCode version, which is not optimal…

Is someone else having this issue?

1 Like

Sorry I can’t help, but I am also having this issue

I’ve been able to reproduce with several versions of Unreal Engine, and have reinstalled xcode multiple times, even reinstalling my os (MacOS 12.3.1)

This has been mentioned elsewhere, but bringing the details to this thread:

Two new warnings in clang need to be silenced in order to get the editor to build. The flags have to be added to a UE build file, since the Xcode settings don’t make it all the way down to where clang is actually invoked. There are several places in the many layers of the UE build system where flags are checked, propogated and/or set (UnrealBuildTool.xml and ApplePlatformCompilerPreSetup.h, for example) but the latest compatibility fixes in the release branch are in MacToolChain.cs so I made these changes there, too. Here’s my clang13.patch file:

227a228,234
> 			// clang 13.00 has new warnings.
> 			if (GetClangVersion().Major >= 13)
> 			{
>             	Result += " -Wno-unused-but-set-variable";
>             	Result += " -Wno-ordered-compare-function-pointers";
> 			}			
> 

Patched like this:

% cd Engine/Source/Programs/UnrealBuildTool/Platform/Mac
% patch MacToolChain.cs < clang13.patch
3 Likes