Skip to content

Commit 9e67e04

Browse files
committed
Updated MacOS instructions for UE 5.4.
1 parent ade54ed commit 9e67e04

File tree

1 file changed

+13
-82
lines changed

1 file changed

+13
-82
lines changed

Documentation/developer-setup-osx.md

Lines changed: 13 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ Detailed instructions for setting up a Cesium for Unreal development environment
66
# Prerequisities
77

88
- Install CMake (version 3.15 or newer) from https://cmake.org/install/
9-
- Install Xcode 14.2+ from https://developer.apple.com/xcode/resources/
9+
- Install Xcode 14.1+ from https://developer.apple.com/xcode/resources/
1010
- For best JPEG-decoding performance, you must have [nasm](https://www.nasm.us/) installed so that CMake can find it. Everything will work fine without it, just slower.
1111
- Install the minimum supported version of Unreal Engine (version 5.4 as of this writing) from https://www.unrealengine.com/en-US/download
1212

13+
These instructions are intended for Unreal Engine 5.4. The process is similar for newer versions of Unreal Engine. Supported Xcode versions are specified in `/Users/Shared/Epic Games/UE_5.4/Engine/Config/Apple/Apple_SDK.json`.
14+
1315
# Cloning the git repos
1416

1517
The following illustrates the recommended directory layout for developers:
@@ -35,88 +37,14 @@ git clone --recursive https://github.com/CesiumGS/cesium-unreal.git
3537
git submodule update --init --recursive
3638
```
3739

38-
# Setting up Xcode
39-
40-
Unreal Engine 5.3 requires a version of Xcode _no later_ than Xcode 15.x. This means that Xcode 16, which is the earliest version supported on macOS 15.3 Sequoia, cannot be used to build a UE 5.3 project without some tricks. You will see an error like this when you attempt to generate project files:
41-
42-
> Exception while generating include data for UnrealEditor: Platform Mac is not a valid platform to build. Check that the SDK is installed properly.
43-
44-
We have a few options:
45-
46-
1. Use an earlier version of macOS
47-
2. Use a later version of Unreal Engine
48-
3. [Hack UnrealBuildTool to allow us to build for UE 5.3 using Xcode 16](#modify-unrealbuildtool-for-xcode-16)
49-
4. [Hack Xcode 15.4 to run on macOS 15.2 Sequoia](#modify-xcode-for-sequoia)
50-
51-
## Modify UnrealBuildTool for Xcode 16
52-
53-
The source code for the UnrealBuildTool is installed with Unreal Engine, which makes it easy to modify it for our purposes. The file to edit in Unreal Engine 5.3 is here (or equivalent on your system):
54-
55-
```
56-
/Users/Shared/Epic Games/UE_5.3/Engine/Source/Programs/UnrealBuildTool/Platform/Mac/ApplePlatformSDK.Versions.cs
57-
```
58-
59-
Find a line in that file that looks like this:
60-
61-
```
62-
MaxVersion = "15.9.9";
63-
```
64-
65-
If you have Xcode 16, change it to:
66-
67-
```
68-
MaxVersion = "16.9.9";
69-
```
70-
71-
Now we need to build our modifications into a new binary, which we can do by running:
72-
73-
```
74-
cd "/Users/Shared/Epic Games/UE_5.3/Engine/Source/Programs/UnrealBuildTool"
75-
"/Users/Shared/Epic Games/UE_5.3/Engine/Binaries/ThirdParty/DotNet/6.0.302/mac-x64/dotnet" build UnrealBuildTool.csproj
76-
```
77-
78-
> [!note]
79-
> The path to the `dotnet` executable may be different in different Unreal Engine versions. You can also install a system `dotnet` if desired with `brew install dotnet`.
80-
81-
This will build UnrealBuildTool to the place all of Unreal's build scripts expect to find it. You should now be able to [generate project files](#building-cesium-for-unreal) successfully.
82-
83-
However, because this version of Unreal Engine has not been tested on this Xcode version, you may run into compiler errors, and these may be easy or difficult to fix. With Unreal Engine 5.3 and Xcode 16.2, you'll likely see errors like this:
84-
85-
> /Users/Shared/Epic Games/UE_5.3/Engine/Source/Runtime/RenderCore/Public/ShaderParameterStructDeclaration.h:22:3: encoding prefix 'u' on an unevaluated string literal has no effect and is incompatible with c++2c [-Werror,-Winvalid-unevaluated-string]
86-
87-
We can "fix" this by suppressing this warning. Open `/Users/Shared/Epic Games/UE_5.3/Engine/Source/Runtime/Core/Public/Apple/ApplePlatformCompilerPreSetup.h` and add a line to disable this warning:
88-
89-
```
90-
#pragma clang diagnostic ignored "-Winvalid-unevaluated-string"
91-
```
92-
93-
## Modify Xcode for Sequoia
94-
95-
It's possible to run Xcode 15.4 on macOS 15.3 Sequoia, and probably later versions:
96-
97-
* Download Xcode 15.4 from https://developer.apple.com/download/all/.
98-
* Extract the download to your home directory:
99-
100-
```
101-
cd
102-
xip -x ./Downloads/Xcode_15.4.xip
103-
mv Xcode.app Xcode_15.4.app
104-
```
105-
106-
* Launch this version of Xcode:
107-
108-
```
109-
./Xcode_15.4.app/Contents/MacOS/Xcode
110-
```
111-
112-
* Xcode should launch and ask you to select or create a project. Choose `Xcode` on the menu at the top and then `Settings`. Click the `Locations` tab.
113-
* Under `Command Line Tools` choose `Xcode_15 15.4`.
114-
11540
# Building cesium-native
11641

11742
The cesium-native libraries and their dependencies use CMake and must be built separately from Cesium for Unreal. Cesium for Unreal supports both Intel and Apple Silicon processors. In development, we usually just want to build for the host's architecture, which is done as follows:
11843

44+
(It may be helpful to place these commands in a shell script for future use.)
45+
11946
```
47+
export UNREAL_ENGINE_ROOT='/Users/Shared/Epic Games/UE_5.4'
12048
cd ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/extern
12149
cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug
12250
cmake --build build --target install --parallel 14
@@ -125,11 +53,13 @@ cmake --build build --target install --parallel 14
12553
Or to build a Release version:
12654

12755
```
56+
export UNREAL_ENGINE_ROOT='/Users/Shared/Epic Games/UE_5.4'
12857
cd ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/extern
12958
cmake -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo
13059
cmake --build build --target install --parallel 14
13160
```
13261

62+
13363
This will install the built libraries to one of these subdirectories of `~/dev/cesium-unreal-samples/Plugins/cesium-unreal/Source/ThirdParty/lib/`, depending on your configuration and processor architecture:
13464

13565
* `Darwin-arm64-Debug` - Debug configuration for Apple Silicon.
@@ -190,6 +120,7 @@ Configure the CMake project in the `~/dev/cesium-unreal-samples/Plugins/cesium-u
190120
Execute the following commands to build and install a Release version of cesium-native:
191121

192122
```
123+
export UNREAL_ENGINE_ROOT='/Users/Shared/Epic Games/UE_5.4'
193124
cd ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/extern
194125
cmake -B build-ios -S . -GXcode -DCMAKE_TOOLCHAIN_FILE="unreal-ios-toolchain.cmake" -DCMAKE_BUILD_TYPE=Release
195126
cmake --build build-ios --target install --config Release --parallel 14
@@ -210,23 +141,23 @@ Now we can generate Xcode project files for the Samples project and the plugin:
210141

211142
```
212143
cd ~/dev/cesium-unreal-samples
213-
"/Users/Shared/Epic Games/UE_5.3/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.sh" -game -project="$PWD/CesiumForUnrealSamples.uproject"
144+
"/Users/Shared/Epic Games/UE_5.4/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.sh" -game -project="$PWD/CesiumForUnrealSamples.uproject"
214145
```
215146

216147
You may see an error message like this:
217148

218149
> Your Mac is set to use CommandLineTools for its build tools (/Library/Developer/CommandLineTools). Unreal expects Xcode as the build tools. Please install Xcode if it's not already, then do one of the following:
219150
> - Run Xcode, go to Settings, and in the Locations tab, choose your Xcode in Command Line Tools dropdown.
220151
> - In Terminal, run 'sudo xcode-select -s /Applications/Xcode.app' (or an alternate location if you installed Xcode to a non-standard location)
221-
> Either way, you will need to enter your Mac password.
152+
> Either way, you will need to enter your Mac password.
222153
223154
In which case, do what it says.
224155

225156
If you see a message like this:
226157

227158
> Exception while generating include data for UnrealEditor: Platform Mac is not a valid platform to build. Check that the SDK is installed properly.
228159
229-
It probably means Unreal doesn't like your Xcode version. Be sure that Xcode is installed and that you have followed the [Xcode setup instructions](#setting-up-xcode).
160+
It probably means Unreal doesn't like your Xcode version. Be sure that a supported version of Xcode is installed.
230161

231162
If the project file generation succeeds, you should see a file named `CesiumForUnrealSamples (Mac).xcworkspace` in the same directory as your uproject. Double-click it to open Xcode.
232163

@@ -247,7 +178,7 @@ To get a call stack from a crash on an iOS device...
247178
- Copy this file to a separate directory.
248179
- Convert it to a .crash file using https://github.com/tomieq/AppleCrashScripts and convertFromJSON.swift. The input path must be a relative path, not an absolute one. So run it in the directory where you copied the ips file above.
249180
- `swift ~/github/AppleCrashScripts/convertFromJSON.swift -i dev-IOS-DebugGame-2025-02-06-204209.ips -o dev-IOS-DebugGame-2025-02-06-204209.crash`
250-
- Run symbolicatecrash, which comes with Xcode but is buried here /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/
181+
- Run `symbolicatecrash`, which comes with Xcode but is buried here /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/
251182
- `export PATH=$PATH:/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/`
252183
- `export DEVELOPER_DIR=$(xcode-select --print-path)`
253184
- `symbolicatecrash ./dev-IOS-DebugGame-2025-02-06-204209.crash`

0 commit comments

Comments
 (0)