vault backup: 2023-07-04 14:16:27
This commit is contained in:
parent
0562c0ee8d
commit
998441899f
@ -62,7 +62,10 @@ https://github.com/trulyspinach/SMCAMDProcessor/releases/tag/0.7.1
|
|||||||
|
|
||||||
## ATOMIC_VAR_INIT错误
|
## ATOMIC_VAR_INIT错误
|
||||||
https://forums.unrealengine.com/t/cannot-build-ue-5-1-1-from-source-on-macos-ventura-13-3-1-xcode-14-3/885545
|
https://forums.unrealengine.com/t/cannot-build-ue-5-1-1-from-source-on-macos-ventura-13-3-1-xcode-14-3/885545
|
||||||
macOS 13.4 Xcode 14.3编译UE5.1会报错,解决方法是:
|
macOS 13.4 Xcode 14.3编译UE5.1会报错,其原因是:
|
||||||
|
>So it seems the error is related to the deprecation of `ATOMIC_VAR_INIT` [since C++20 2](https://en.cppreference.com/w/cpp/atomic/ATOMIC_VAR_INIT). I gather [from this table 3](https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since_SwiftUI_framework)_2) that Xcode 14.3 includes a clang patch version bump from 14.0.0 to 14.0.3, and a llvm major version bump from 14.0.0 to 15.0.0. With my limited understanding of clang and llvm, I would guess that llvm 15 compiles at C++20, and therefore throws the build error, whereas the build is successful with Xcode 14.2.
|
||||||
|
|
||||||
|
解决方法是:
|
||||||
- ShaderCompileWorker.target.cs添加下面的代码。
|
- ShaderCompileWorker.target.cs添加下面的代码。
|
||||||
- UnrealEditor.Target.cs添加下面的代码(去掉bOverrideBuildEnvironment那一行)。
|
- UnrealEditor.Target.cs添加下面的代码(去掉bOverrideBuildEnvironment那一行)。
|
||||||
|
|
||||||
@ -85,5 +88,47 @@ public class YourGameTarget : TargetRules
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
我对文件做了一些修改`Engine/Source/Programs/UnrealBuildTool/Platform/Mac/MacToolChain.cs`,错误消失了。
|
||||||
|
```c++
|
||||||
|
if (CompilerVersionGreaterOrEqual(14, 0, 0))
|
||||||
|
{
|
||||||
|
Arguments.Add("-Wno-deprecated-pragma");
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
功能齐全:
|
||||||
|
```csharp
|
||||||
|
protected override void GetCompileArguments_Global(CppCompileEnvironment CompileEnvironment, List<string> Arguments)
|
||||||
|
{
|
||||||
|
base.GetCompileArguments_Global(CompileEnvironment, Arguments);
|
||||||
|
|
||||||
|
Arguments.Add("-fasm-blocks");
|
||||||
|
|
||||||
|
if (CompileEnvironment.bEnableOSX109Support)
|
||||||
|
{
|
||||||
|
Arguments.Add("-faligned-new"); // aligned operator new is supported only on macOS 10.14 and above
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pass through architecture and OS info
|
||||||
|
Arguments.Add("" + FormatArchitectureArg(CompileEnvironment.Architecture));
|
||||||
|
Arguments.Add($"-isysroot \"{SDKPath}\"");
|
||||||
|
Arguments.Add("-mmacosx-version-min=" + (CompileEnvironment.bEnableOSX109Support ? "10.9" : Settings.MacOSVersion));
|
||||||
|
|
||||||
|
List<string> FrameworksSearchPaths = new List<string>();
|
||||||
|
foreach (UEBuildFramework Framework in CompileEnvironment.AdditionalFrameworks)
|
||||||
|
{
|
||||||
|
FileReference FrameworkPath = new FileReference(Path.GetFullPath(Framework.Name));
|
||||||
|
if (!FrameworksSearchPaths.Contains(FrameworkPath.Directory.FullName))
|
||||||
|
{
|
||||||
|
Arguments.Add($"-F \"{NormalizeCommandLinePath(FrameworkPath.Directory)}\"");
|
||||||
|
FrameworksSearchPaths.Add(FrameworkPath.Directory.FullName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (CompilerVersionGreaterOrEqual(14, 0, 0))
|
||||||
|
{
|
||||||
|
Arguments.Add("-Wno-deprecated-pragma");
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
Loading…
x
Reference in New Issue
Block a user