Skip to content

Commit bc73e13

Browse files
authored
Merge pull request #1740 from CesiumGS/update-native
Update cesium-native and doc
2 parents ca73c60 + 255e71c commit bc73e13

File tree

5 files changed

+38
-8
lines changed

5 files changed

+38
-8
lines changed

Documentation/developer-setup-windows-gotchas.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,30 @@ With that, all builds invoked by Unreal Build Tool should use the chosen compile
4646

4747
If you've followed the instructions above, and Unreal Build Tool is now building Cesium for Unreal with v14.38 of the compiler, then you will likely get linker errors because the cesium-native and third-party dependencies are both still built with the newer version of the compiler.
4848

49-
vcpkg has hard-coded logic to choose the very latest version of the compiler that you have installed. It completely ignores all the usual ways that different compiler versions can be selected, such as setting the defaults file (`"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.props"`), setting environment variables or running the `vcvarsall` script. The _only_ way to choose a compiler for vcpkg to use, as far as we know, is by explicitly specifying it in a vcpkg triplet file. So, to build with 14.38, edit the `extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake` file in the `cesium-unreal` repo and add this line to the end of it:
49+
vcpkg has hard-coded logic to choose the very latest version of the compiler that you have installed. It completely ignores all the usual ways that different compiler versions can be selected, such as setting the defaults file (`"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.props"`), setting environment variables or running the `vcvarsall` script.
50+
51+
The easiest way to select a compiler for vcpkg to use is to set the `VCPKG_PLATFORM_TOOLSET_VERSION` environment variable. Despite the name, this is not built-in vcpkg functionality, but is instead something that our `x64-windows-unreal.cmake` triplet file looks for explicitly. To set it, run the following in a PowerShell window:
52+
53+
```powershell
54+
$env:VCPKG_PLATFORM_TOOLSET_VERSION = "14.38"
55+
```
56+
57+
Or in a CMD prompt, run:
58+
59+
```bat
60+
set VCPKG_PLATFORM_TOOLSET_VERSION=14.38
61+
```
62+
63+
This environment variable must be set before running CMake to configure the `cesium-native` project.
64+
65+
Alternatively, you can explicitly specify the toolset version in the vcpkg triplet file. To build with 14.38, edit the `extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake` file in the `cesium-unreal` repo and add this line to the end of it:
5066

5167
```
5268
set(VCPKG_PLATFORM_TOOLSET_VERSION "14.38")
5369
```
5470

55-
Be careful not to commit this change!
71+
> [!warning]
72+
> Be careful not to commit this change if you edit the triplet file directly! Using the environment variable is safer.
5673
5774
vcpkg won't always automatically rebuild everything it needs to rebuild after making this change. To force a rebuild, delete the following:
5875

@@ -105,7 +122,8 @@ It should look like this (though your names and `visualStudio` properties may be
105122
"toolset": "host=x64,version=14.38"
106123
},
107124
"environmentVariables": {
108-
"VCToolsVersion": "14.38.33130"
125+
"VCToolsVersion": "14.38.33130",
126+
"VCPKG_PLATFORM_TOOLSET_VERSION": "14.38"
109127
}
110128
},
111129
{
@@ -119,7 +137,8 @@ It should look like this (though your names and `visualStudio` properties may be
119137
"toolset": "host=x64,version=14.44"
120138
},
121139
"environmentVariables": {
122-
"VCToolsVersion": "14.44.35207"
140+
"VCToolsVersion": "14.44.35207",
141+
"VCPKG_PLATFORM_TOOLSET_VERSION": "14.44"
123142
}
124143
},
125144
...

Source/CesiumEditor/CesiumEditor.Build.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target)
7575

7676
PublicAdditionalLibraries.AddRange(allLibs);
7777

78+
// On Linux, cpp-httplib uses getaddrinfo_a, which is in the anl library.
79+
if (Target.Platform == UnrealTargetPlatform.Linux)
80+
{
81+
PublicSystemLibraries.Add("anl");
82+
}
83+
7884
PublicDependencyModuleNames.AddRange(
7985
new string[]
8086
{

Source/CesiumEditor/Private/CesiumIonSession.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ void CesiumIonSession::connect() {
117117
}
118118

119119
if (!ionApiUrl) {
120-
promise.reject(std::runtime_error(fmt::format(
120+
promise.reject(std::runtime_error(
121121
"Failed to retrieve API URL from the config.json file at the "
122-
"specified Ion server URL: {}",
123-
ionServerUrl)));
122+
"specified Ion server URL: " +
123+
ionServerUrl));
124124
return promise.getFuture();
125125
}
126126

Source/CesiumRuntime/CesiumRuntime.Build.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target)
7676
string[] allLibs = Directory.Exists(libPath) ? Directory.GetFiles(libPath, libSearchPattern) : new string[0];
7777

7878
PublicAdditionalLibraries.AddRange(allLibs);
79+
// On Linux, cpp-httplib uses getaddrinfo_a, which is in the anl library.
80+
if (Target.Platform == UnrealTargetPlatform.Linux)
81+
{
82+
PublicSystemLibraries.Add("anl");
83+
}
7984

8085
PublicDependencyModuleNames.AddRange(
8186
new string[]

extern/cesium-native

Submodule cesium-native updated 45 files

0 commit comments

Comments
 (0)