From c8433462e8a5ed58b961f8ce28bb52217c6ba41d Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 6 Jun 2024 20:59:07 +1000 Subject: [PATCH 001/119] Use the vcpkg-enabled version of cesium-native. --- Source/CesiumEditor/CesiumEditor.Build.cs | 81 +++++-------- Source/CesiumRuntime/CesiumRuntime.Build.cs | 109 ++++-------------- .../Private/CesiumEncodedFeaturesMetadata.cpp | 1 - .../Private/CesiumEncodedMetadataUtility.cpp | 1 - .../Private/CesiumFlyToComponent.cpp | 2 +- .../Private/CesiumGlobeAnchorComponent.cpp | 2 +- .../Private/CesiumGltfComponent.cpp | 4 +- .../CesiumRuntime/Private/GeoTransforms.cpp | 2 + .../Private/GlobeAwareDefaultPawn.cpp | 3 +- Source/CesiumRuntime/Private/VecMath.cpp | 3 - extern/CMakeLists.txt | 18 ++- extern/cesium-native | 2 +- 12 files changed, 67 insertions(+), 161 deletions(-) diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs index 69c287dbc..ea8570e1c 100644 --- a/Source/CesiumEditor/CesiumEditor.Build.cs +++ b/Source/CesiumEditor/CesiumEditor.Build.cs @@ -26,71 +26,52 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) } ); - string libPrefix; - string libPostfix; string platform; - if (Target.Platform == UnrealTargetPlatform.Win64) { - platform = "Windows-x64"; - libPostfix = ".lib"; - libPrefix = ""; + string libSearchPattern; + if (Target.Platform == UnrealTargetPlatform.Win64) + { + platform = "Windows-AMD64-"; + libSearchPattern = "*.lib"; } - else if (Target.Platform == UnrealTargetPlatform.Mac) { - platform = "Darwin-x64"; - libPostfix = ".a"; - libPrefix = "lib"; + else if (Target.Platform == UnrealTargetPlatform.Mac) + { + platform = "Darwin-AMD64-"; + libSearchPattern = "lib*.a"; } - else if(Target.Platform == UnrealTargetPlatform.Android) { - platform = "Android-xaarch64"; - libPostfix = ".a"; - libPrefix = "lib"; + else if (Target.Platform == UnrealTargetPlatform.Android) + { + platform = "Android-ARM64-"; + libSearchPattern = "lib*.a"; } - else if(Target.Platform == UnrealTargetPlatform.Linux) { - platform = "Linux-x64"; - libPostfix = ".a"; - libPrefix = "lib"; + else if (Target.Platform == UnrealTargetPlatform.Linux) + { + platform = "Linux-AMD64-"; + libSearchPattern = "lib*.a"; } - else if(Target.Platform == UnrealTargetPlatform.IOS) { - platform = "iOS-xarm64"; - libPostfix = ".a"; - libPrefix = "lib"; + else if (Target.Platform == UnrealTargetPlatform.IOS) + { + platform = "iOS-ARM64-"; + libSearchPattern = "lib*.a"; } - else { - platform = "Unknown"; - libPostfix = ".Unknown"; - libPrefix = "Unknown"; + else + { + throw new InvalidOperationException("Cesium for Unreal does not support this platform."); } string libPath = Path.Combine(ModuleDirectory, "../ThirdParty/lib/" + platform); - string releasePostfix = ""; - string debugPostfix = "d"; - - bool preferDebug = (Target.Configuration == UnrealTargetConfiguration.Debug || Target.Configuration == UnrealTargetConfiguration.DebugGame); - string postfix = preferDebug ? debugPostfix : releasePostfix; - - string[] libs = new string[] + if (Target.Configuration == UnrealTargetConfiguration.Debug || Target.Configuration == UnrealTargetConfiguration.DebugGame) { - "CesiumIonClient", - "csprng" - }; - - if (preferDebug) - { - // We prefer Debug, but might still use Release if that's all that's available. - foreach (string lib in libs) + string libPathDebug = libPath + "Debug"; + if (Directory.Exists(libPathDebug)) { - string debugPath = Path.Combine(libPath, libPrefix + lib + debugPostfix + libPostfix); - if (!File.Exists(debugPath)) - { - Console.WriteLine("Using release build of cesium-native because a debug build is not available."); - preferDebug = false; - postfix = releasePostfix; - break; - } + libPath = libPathDebug; } } - PublicAdditionalLibraries.AddRange(libs.Select(lib => Path.Combine(libPath, libPrefix + lib + postfix + libPostfix))); + string[] allLibs = Directory.GetFiles(libPath, "*"); + + PublicAdditionalLibraries.AddRange(allLibs); PublicDependencyModuleNames.AddRange( new string[] diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index 394af8d5a..b1a95d3b7 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -26,119 +26,52 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) } ); - string libPrefix; - string libPostfix; string platform; + string libSearchPattern; if (Target.Platform == UnrealTargetPlatform.Win64) { - platform = "Windows-x64"; - libPostfix = ".lib"; - libPrefix = ""; + platform = "Windows-AMD64-"; + libSearchPattern = "*.lib"; } else if (Target.Platform == UnrealTargetPlatform.Mac) { - platform = "Darwin-x64"; - libPostfix = ".a"; - libPrefix = "lib"; + platform = "Darwin-AMD64-"; + libSearchPattern = "lib*.a"; } else if (Target.Platform == UnrealTargetPlatform.Android) { - platform = "Android-xaarch64"; - libPostfix = ".a"; - libPrefix = "lib"; + platform = "Android-ARM64-"; + libSearchPattern = "lib*.a"; } else if (Target.Platform == UnrealTargetPlatform.Linux) { - platform = "Linux-x64"; - libPostfix = ".a"; - libPrefix = "lib"; + platform = "Linux-AMD64-"; + libSearchPattern = "lib*.a"; } else if(Target.Platform == UnrealTargetPlatform.IOS) { - platform = "iOS-xarm64"; - libPostfix = ".a"; - libPrefix = "lib"; - } - else { - platform = "Unknown"; - libPostfix = ".Unknown"; - libPrefix = "Unknown"; - } - - string libPath = Path.Combine(ModuleDirectory, "../ThirdParty/lib/" + platform); - - string releasePostfix = ""; - string debugPostfix = "d"; - - bool preferDebug = (Target.Configuration == UnrealTargetConfiguration.Debug || Target.Configuration == UnrealTargetConfiguration.DebugGame); - string postfix = preferDebug ? debugPostfix : releasePostfix; - - string[] libs = new string[] - { - "async++", - "Cesium3DTiles", - "Cesium3DTilesContent", - "Cesium3DTilesReader", - "Cesium3DTilesSelection", - "CesiumAsync", - "CesiumIonClient", - "CesiumGeometry", - "CesiumGeospatial", - "CesiumGltfReader", - "CesiumGltfContent", - "CesiumGltf", - "CesiumJsonReader", - "CesiumRasterOverlays", - "CesiumQuantizedMeshTerrain", - "CesiumUtility", - "csprng", - "draco", - "ktx", - //"MikkTSpace", - "meshoptimizer", - "modp_b64", - "s2geometry", - "spdlog", - "sqlite3", - "tinyxml2", - "turbojpeg", - "uriparser", - "webpdecoder", - }; - - // Use our own copy of MikkTSpace on Android. - if (Target.Platform == UnrealTargetPlatform.Android || Target.Platform == UnrealTargetPlatform.IOS) - { - libs = libs.Concat(new string[] { "MikkTSpace" }).ToArray(); - PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "../ThirdParty/include/mikktspace")); - } - - if (Target.Platform == UnrealTargetPlatform.Win64) - { - libs = libs.Concat(new string[] { "tidy_static", "zlibstatic" }).ToArray(); + platform = "iOS-ARM64-"; + libSearchPattern = "lib*.a"; } else { - libs = libs.Concat(new string[] { "tidy", "z" }).ToArray(); + throw new InvalidOperationException("Cesium for Unreal does not support this platform."); } - if (preferDebug) + string libPath = Path.Combine(ModuleDirectory, "../ThirdParty/lib/" + platform); + + if (Target.Configuration == UnrealTargetConfiguration.Debug || Target.Configuration == UnrealTargetConfiguration.DebugGame) { - // We prefer Debug, but might still use Release if that's all that's available. - foreach (string lib in libs) + string libPathDebug = libPath + "Debug"; + if (Directory.Exists(libPathDebug)) { - string debugPath = Path.Combine(libPath, libPrefix + lib + debugPostfix + libPostfix); - if (!File.Exists(debugPath)) - { - Console.WriteLine("Using release build of cesium-native because a debug build is not available."); - preferDebug = false; - postfix = releasePostfix; - break; - } + libPath = libPathDebug; } } - PublicAdditionalLibraries.AddRange(libs.Select(lib => Path.Combine(libPath, libPrefix + lib + postfix + libPostfix))); + string[] allLibs = Directory.GetFiles(libPath, "*"); + + PublicAdditionalLibraries.AddRange(allLibs); PublicDependencyModuleNames.AddRange( new string[] diff --git a/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.cpp b/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.cpp index d419da552..872d35f0b 100644 --- a/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.cpp +++ b/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.cpp @@ -18,7 +18,6 @@ #include "UnrealMetadataConversions.h" #include #include -#include #include #include diff --git a/Source/CesiumRuntime/Private/CesiumEncodedMetadataUtility.cpp b/Source/CesiumRuntime/Private/CesiumEncodedMetadataUtility.cpp index 53fe9a576..a9d989dd8 100644 --- a/Source/CesiumRuntime/Private/CesiumEncodedMetadataUtility.cpp +++ b/Source/CesiumRuntime/Private/CesiumEncodedMetadataUtility.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include using namespace CesiumTextureUtility; diff --git a/Source/CesiumRuntime/Private/CesiumFlyToComponent.cpp b/Source/CesiumRuntime/Private/CesiumFlyToComponent.cpp index cd8997afd..8153bf752 100644 --- a/Source/CesiumRuntime/Private/CesiumFlyToComponent.cpp +++ b/Source/CesiumRuntime/Private/CesiumFlyToComponent.cpp @@ -10,7 +10,7 @@ #include "UObject/ConstructorHelpers.h" #include "VecMath.h" -#include +#include UCesiumFlyToComponent::UCesiumFlyToComponent() { // Structure to hold one-time initialization diff --git a/Source/CesiumRuntime/Private/CesiumGlobeAnchorComponent.cpp b/Source/CesiumRuntime/Private/CesiumGlobeAnchorComponent.cpp index fe39cc884..97bede427 100644 --- a/Source/CesiumRuntime/Private/CesiumGlobeAnchorComponent.cpp +++ b/Source/CesiumRuntime/Private/CesiumGlobeAnchorComponent.cpp @@ -9,7 +9,7 @@ #include "Components/SceneComponent.h" #include "GameFramework/Actor.h" #include "VecMath.h" -#include +#include // These are the "changes" that can happen to this component, how it detects // them, and what it does about them: diff --git a/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp b/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp index bb649175a..6245bbff8 100644 --- a/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp +++ b/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp @@ -1939,7 +1939,7 @@ static void loadInstancingData( quatView[i].value[0], quatView[i].value[1], quatView[i].value[2]); - instanceTransforms[i] = instanceTransforms[i] * glm::toMat4(quat); + instanceTransforms[i] = instanceTransforms[i] * glm::mat4_cast(quat); } } else if constexpr (is_int_quat_v) { for (int64_t i = 0; i < count; ++i) { @@ -1948,7 +1948,7 @@ static void loadInstancingData( val[j] = GltfNormalized(quatView[i].value[j]); } glm::dquat quat(val[3], val[0], val[1], val[2]); - instanceTransforms[i] = instanceTransforms[i] * glm::toMat4(quat); + instanceTransforms[i] = instanceTransforms[i] * glm::mat4_cast(quat); } } }); diff --git a/Source/CesiumRuntime/Private/GeoTransforms.cpp b/Source/CesiumRuntime/Private/GeoTransforms.cpp index 5b75af9d2..647f80c4d 100644 --- a/Source/CesiumRuntime/Private/GeoTransforms.cpp +++ b/Source/CesiumRuntime/Private/GeoTransforms.cpp @@ -7,6 +7,8 @@ #include "CesiumTransforms.h" #include "VecMath.h" #include + +#define GLM_ENABLE_EXPERIMENTAL #include using namespace CesiumGeospatial; diff --git a/Source/CesiumRuntime/Private/GlobeAwareDefaultPawn.cpp b/Source/CesiumRuntime/Private/GlobeAwareDefaultPawn.cpp index 675e57640..2f5770dde 100644 --- a/Source/CesiumRuntime/Private/GlobeAwareDefaultPawn.cpp +++ b/Source/CesiumRuntime/Private/GlobeAwareDefaultPawn.cpp @@ -21,8 +21,7 @@ #include #include #include -#include -#include +#include #if WITH_EDITOR #include "Editor.h" diff --git a/Source/CesiumRuntime/Private/VecMath.cpp b/Source/CesiumRuntime/Private/VecMath.cpp index 1ac8f5f80..87d46a352 100644 --- a/Source/CesiumRuntime/Private/VecMath.cpp +++ b/Source/CesiumRuntime/Private/VecMath.cpp @@ -5,10 +5,7 @@ #include "CesiumUtility/Math.h" #include "Math/Quat.h" #include "Math/RotationMatrix.h" -#include #include -#include -#include glm::dmat4 VecMath::createMatrix4D(const FMatrix& m) noexcept { return glm::dmat4( diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index c38c16a4d..22f20a189 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -37,26 +37,18 @@ set(PRIVATE_CESIUM_SQLITE ON) set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL) set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/../Source/ThirdParty) -set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_SYSTEM_NAME}-x${CESIUM_ARCHITECTURE}) +set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}-$,Debug,Release>) # Always define this, since Unreal does in debug anyway # We don't want any mismatches, especially with class member ordering add_compile_definitions(NDEBUG) -set(CESIUM_DEBUG_POSTFIX "d") -set(CESIUM_RELEASE_POSTFIX "") - -set(CMAKE_DEBUG_POSTFIX ${CESIUM_DEBUG_POSTFIX}) -set(CMAKE_RELEASE_POSTFIX ${CESIUM_RELEASE_POSTFIX}) -set(CMAKE_MINSIZEREL_POSTFIX ${CESIUM_RELEASE_POSTFIX}) -set(CMAKE_RELWITHDEBINFO_POSTFIX ${CESIUM_RELEASE_POSTFIX}) - # On Mac and Linux, Unreal uses -fvisibility-ms-compat. # On Android, it uses -fvisibility=hidden if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-ms-compat -fvisibility-inlines-hidden") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Android") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidde\n -fvisibility-inlines-hidden") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "iOS") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") @@ -93,10 +85,14 @@ if (CESIUM_USE_UNREAL_TRACING) list(APPEND CESIUM_EXTRA_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/include") endif() +if(WIN32) + set(VCPKG_TRIPLET "x64-windows-unreal") +endif() + add_subdirectory(cesium-native) # cesium-native doesn't require this header to be public, but Cesium for Unreal wants to use it. -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cesium-native/extern/stb/stb_image_resize.h TYPE INCLUDE) +#install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cesium-native/extern/stb/stb_image_resize.h TYPE INCLUDE) # Unreal Engine doesn't include MikkTSpace on Android. # So add our own. diff --git a/extern/cesium-native b/extern/cesium-native index 43187540a..bac574c13 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 43187540a5199d3b5fa8693fca90a1b81bf73c80 +Subproject commit bac574c13dec58420a72564d4c653f796f7b3cbf From 903bac0d7e2967e850c0d815f82e74f2b6fef942 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 09:56:27 +1000 Subject: [PATCH 002/119] Use libSearchPattern. --- Source/CesiumEditor/CesiumEditor.Build.cs | 2 +- Source/CesiumRuntime/CesiumRuntime.Build.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs index ea8570e1c..df02d7dd3 100644 --- a/Source/CesiumEditor/CesiumEditor.Build.cs +++ b/Source/CesiumEditor/CesiumEditor.Build.cs @@ -69,7 +69,7 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) } } - string[] allLibs = Directory.GetFiles(libPath, "*"); + string[] allLibs = Directory.GetFiles(libPath, libSearchPattern); PublicAdditionalLibraries.AddRange(allLibs); diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index b1a95d3b7..c68e45607 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -69,7 +69,7 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) } } - string[] allLibs = Directory.GetFiles(libPath, "*"); + string[] allLibs = Directory.GetFiles(libPath, libSearchPattern); PublicAdditionalLibraries.AddRange(allLibs); From 45c54d64473a0386d0ccabe2e0b4648ce55acf84 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 10:16:15 +1000 Subject: [PATCH 003/119] Add unmodified ktx port from the 2024.02.14 label of microsoft/vcpkg. --- .../ktx/0001-Use-vcpkg-zstd.patch | 122 ++++++++++++++++++ .../ktx/0002-Fix-versioning.patch | 17 +++ .../vcpkg-overlays/ktx/0003-mkversion.patch | 13 ++ extern/vcpkg-overlays/ktx/0004-quirks.patch | 21 +++ .../ktx/0005-no-vendored-libs.patch | 17 +++ extern/vcpkg-overlays/ktx/portfile.cmake | 82 ++++++++++++ extern/vcpkg-overlays/ktx/vcpkg.json | 37 ++++++ 7 files changed, 309 insertions(+) create mode 100644 extern/vcpkg-overlays/ktx/0001-Use-vcpkg-zstd.patch create mode 100644 extern/vcpkg-overlays/ktx/0002-Fix-versioning.patch create mode 100644 extern/vcpkg-overlays/ktx/0003-mkversion.patch create mode 100644 extern/vcpkg-overlays/ktx/0004-quirks.patch create mode 100644 extern/vcpkg-overlays/ktx/0005-no-vendored-libs.patch create mode 100644 extern/vcpkg-overlays/ktx/portfile.cmake create mode 100644 extern/vcpkg-overlays/ktx/vcpkg.json diff --git a/extern/vcpkg-overlays/ktx/0001-Use-vcpkg-zstd.patch b/extern/vcpkg-overlays/ktx/0001-Use-vcpkg-zstd.patch new file mode 100644 index 000000000..71a587bd6 --- /dev/null +++ b/extern/vcpkg-overlays/ktx/0001-Use-vcpkg-zstd.patch @@ -0,0 +1,122 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9a56491..d7ca937 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -345,7 +345,6 @@ set(KTX_MAIN_SRC + lib/basisu/transcoder/basisu_transcoder.cpp + lib/basisu/transcoder/basisu_transcoder.h + lib/basisu/transcoder/basisu.h +- lib/basisu/zstd/zstd.c + lib/checkheader.c + lib/dfdutils/createdfd.c + lib/dfdutils/colourspaces.c +@@ -532,7 +531,6 @@ macro(common_libktx_settings target enable_write library_type) + $ + + $ +- $ + + $ + $ +@@ -627,6 +625,11 @@ macro(common_libktx_settings target enable_write library_type) + target_compile_definitions(${target} PUBLIC KTX_FEATURE_KTX2) + endif() + ++ # Use vcpkg zstd ++ find_package(zstd CONFIG REQUIRED) ++ set(ZSTD_LIBRARIES "$,zstd::libzstd_shared,zstd::libzstd_static>") ++ target_link_libraries(${target} PRIVATE ${ZSTD_LIBRARIES}) ++ + if(WIN32) + if(MINGW) + # Check if the Threads package is provided; if using Mingw it MIGHT be +diff --git a/cmake/KtxConfig.cmake b/cmake/KtxConfig.cmake +index 6386ba2..537bf4f 100644 +--- a/cmake/KtxConfig.cmake ++++ b/cmake/KtxConfig.cmake +@@ -1,7 +1,8 @@ + # Copyright 2015-2020 The Khronos Group Inc. + # SPDX-License-Identifier: Apache-2.0 + +-# include(CMakeFindDependencyMacro) +-# find_dependency() ++include(CMakeFindDependencyMacro) ++find_dependency(Threads) ++find_dependency(zstd CONFIG) + + include("${CMAKE_CURRENT_LIST_DIR}/KtxTargets.cmake") +diff --git a/lib/basisu/CMakeLists.txt b/lib/basisu/CMakeLists.txt +index 492233a..152ceb5 100644 +--- a/lib/basisu/CMakeLists.txt ++++ b/lib/basisu/CMakeLists.txt +@@ -145,9 +145,6 @@ set(BASISU_SRC_LIST ${COMMON_SRC_LIST} + transcoder/basisu_transcoder.cpp + ) + +-if (ZSTD) +- set(BASISU_SRC_LIST ${BASISU_SRC_LIST} zstd/zstd.c) +-endif() + + if (APPLE) + set(BIN_DIRECTORY "bin_osx") +@@ -165,6 +162,10 @@ else() + target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=0) + endif() + ++if(ZSTD_LIBRARIES) ++ target_link_libraries(basisu ${ZSTD_LIBRARIES}) ++endif() ++ + if (NOT MSVC) + # For Non-Windows builds, let cmake try and find the system OpenCL headers/libs for us. + if (OPENCL_FOUND) +diff --git a/lib/basisu/webgl/encoder/CMakeLists.txt b/lib/basisu/webgl/encoder/CMakeLists.txt +index 588d91b..a337b13 100644 +--- a/lib/basisu/webgl/encoder/CMakeLists.txt ++++ b/lib/basisu/webgl/encoder/CMakeLists.txt +@@ -34,9 +34,6 @@ if (EMSCRIPTEN) + ) + + if (KTX2_ZSTANDARD) +- set(SRC_LIST ${SRC_LIST} +- ../../zstd/zstd.c +- ) + set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=1) + else() + set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=0) +@@ -55,6 +52,10 @@ if (EMSCRIPTEN) + target_compile_options(basis_encoder.js PRIVATE -fno-strict-aliasing -O3) + + target_include_directories(basis_encoder.js PRIVATE ../../transcoder) ++ ++ if(ZSTD_LIBRARIES) ++ target_link_libraries(basis_encoder.js ${ZSTD_LIBRARIES}) ++ endif() + + set_target_properties(basis_encoder.js PROPERTIES + OUTPUT_NAME "basis_encoder" +diff --git a/lib/basisu/webgl/transcoder/CMakeLists.txt b/lib/basisu/webgl/transcoder/CMakeLists.txt +index 372653d..5ebc3cf 100644 +--- a/lib/basisu/webgl/transcoder/CMakeLists.txt ++++ b/lib/basisu/webgl/transcoder/CMakeLists.txt +@@ -28,9 +28,6 @@ if (EMSCRIPTEN) + endif() + + if (KTX2_ZSTANDARD) +- set(SRC_LIST ${SRC_LIST} +- ../../zstd/zstddeclib.c +- ) + set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=1) + else() + set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=0) +@@ -44,6 +41,10 @@ if (EMSCRIPTEN) + target_compile_definitions(basis_transcoder.js PRIVATE NDEBUG BASISD_SUPPORT_UASTC=1 BASISD_SUPPORT_BC7=1 BASISD_SUPPORT_ATC=0 BASISD_SUPPORT_ASTC_HIGHER_OPAQUE_QUALITY=0 BASISD_SUPPORT_PVRTC2=0 BASISD_SUPPORT_FXT1=0 BASISD_SUPPORT_ETC2_EAC_RG11=0 BASISU_SUPPORT_ENCODING=0 ${KTX2_DEFINITION} ${ZSTD_DEFINITION} ) + target_compile_options(basis_transcoder.js PRIVATE -O3 -fno-strict-aliasing) + target_include_directories(basis_transcoder.js PRIVATE ../../transcoder) ++ ++ if(ZSTD_LIBRARIES) ++ target_link_libraries(basis_transcoder.js ${ZSTD_LIBRARIES}) ++ endif() + + set_target_properties(basis_transcoder.js PROPERTIES + OUTPUT_NAME "basis_transcoder" diff --git a/extern/vcpkg-overlays/ktx/0002-Fix-versioning.patch b/extern/vcpkg-overlays/ktx/0002-Fix-versioning.patch new file mode 100644 index 000000000..1e5098806 --- /dev/null +++ b/extern/vcpkg-overlays/ktx/0002-Fix-versioning.patch @@ -0,0 +1,17 @@ +diff --git a/cmake/version.cmake b/cmake/version.cmake +index 4094df1a..3b2af3bb 100644 +--- a/cmake/version.cmake ++++ b/cmake/version.cmake +@@ -108,8 +108,10 @@ function(generate_version _var ) + set(${_var} "${KTX_VERSION}" PARENT_SCOPE) + endfunction() + +-# Get latest tag +-git_describe_raw(KTX_VERSION_FULL --abbrev=0 --match v[0-9]*) ++if (!KTX_VERSION_FULL) ++ # Get latest tag ++ git_describe_raw(KTX_VERSION_FULL --abbrev=0 --match v[0-9]*) ++endif() + #message("KTX full version: ${KTX_VERSION_FULL}") + + # generate_version(TOKTX_VERSION tools/toktx) diff --git a/extern/vcpkg-overlays/ktx/0003-mkversion.patch b/extern/vcpkg-overlays/ktx/0003-mkversion.patch new file mode 100644 index 000000000..ee8b3c4af --- /dev/null +++ b/extern/vcpkg-overlays/ktx/0003-mkversion.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/version.cmake b/cmake/version.cmake +index 9a90622..0fc3521 100644 +--- a/cmake/version.cmake ++++ b/cmake/version.cmake +@@ -176,7 +176,7 @@ function( create_version_header dest_path target ) + add_custom_command( + OUTPUT ${version_h_output} + # On Windows this command has to be invoked by a shell in order to work +- COMMAND ${BASH_EXECUTABLE} -c "\"./mkversion\" \"-o\" \"version.h\" \"${dest_path}\"" ++ COMMAND "${BASH_EXECUTABLE}" -- ./mkversion -o version.h "${dest_path}" + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + COMMENT "Generate ${version_h_output}" + VERBATIM diff --git a/extern/vcpkg-overlays/ktx/0004-quirks.patch b/extern/vcpkg-overlays/ktx/0004-quirks.patch new file mode 100644 index 000000000..afc34236d --- /dev/null +++ b/extern/vcpkg-overlays/ktx/0004-quirks.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1500844..810914e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -263,7 +263,7 @@ if(MSVC) + # ";" argument separator is problematic. Can't use a GenEx `$:/WX> ) +- add_compile_options( $,/Gz,/O2> ) ++ add_compile_options( $,,/O2> ) + # Enable UTF-8 support + add_compile_options( $<$:/utf-8> ) + add_compile_options( $<$:/utf-8> ) +@@ -946,6 +946,7 @@ if(EMSCRIPTEN) + endif() + + add_library( objUtil STATIC ++ EXCLUDE_FROM_ALL + utils/argparser.cpp + utils/argparser.h + utils/ktxapp.h diff --git a/extern/vcpkg-overlays/ktx/0005-no-vendored-libs.patch b/extern/vcpkg-overlays/ktx/0005-no-vendored-libs.patch new file mode 100644 index 000000000..77cdd8518 --- /dev/null +++ b/extern/vcpkg-overlays/ktx/0005-no-vendored-libs.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d7ca937..ffcbe95 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1059,10 +1059,10 @@ endif() + # except for building the ktx library. + if((KTX_FEATURE_TOOLS OR KTX_FEATURE_TESTS) AND NOT TARGET fmt::fmt) + set(FMT_SYSTEM_HEADERS ON) +- add_subdirectory(other_projects/fmt) ++ find_package(fmt CONFIG REQUIRED) + endif() + if(KTX_FEATURE_TOOLS AND NOT TARGET cxxopts::cxxopts) +- add_subdirectory(other_projects/cxxopts) ++ find_package(cxxopts CONFIG REQUIRED) + endif() + + # Tools diff --git a/extern/vcpkg-overlays/ktx/portfile.cmake b/extern/vcpkg-overlays/ktx/portfile.cmake new file mode 100644 index 000000000..2079a0350 --- /dev/null +++ b/extern/vcpkg-overlays/ktx/portfile.cmake @@ -0,0 +1,82 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KhronosGroup/KTX-Software + REF "v${VERSION}" + SHA512 5a89f8986464705ec36ac1becaddd0ff335e4c3c235468aaef0e963fcfeda4c0d669a086b91e61c16a3ae9e1fa5bf456dccf12cc65720e1a22e7cc0f30552541 + HEAD_REF master + PATCHES + 0001-Use-vcpkg-zstd.patch + 0002-Fix-versioning.patch + 0003-mkversion.patch + 0004-quirks.patch + 0005-no-vendored-libs.patch +) +file(REMOVE "${SOURCE_PATH}/other_include/zstd_errors.h") + +vcpkg_list(SET OPTIONS) +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_acquire_msys(MSYS_ROOT + PACKAGES + bash + DIRECT_PACKAGES + # Required for "getopt" + "https://repo.msys2.org/msys/x86_64/util-linux-2.35.2-3-x86_64.pkg.tar.zst" + da26540881cd5734072717133307e5d1a27a60468d3656885507833b80f24088c5382eaa0234b30bdd9e8484a6638b4514623f5327f10b19eed36f12158e8edb + # Required for "dos2unix" + "https://mirror.msys2.org/msys/x86_64/dos2unix-7.5.1-1-x86_64.pkg.tar.zst" + 83d85e6ccea746ef9e8153a0d605e774dbe7efc0ee952804acfee4ffd7e3b0386a353b45ff989dd99bc3ce75968209fea3d246ad2af88bbb5c4eca12fc5a8f92 + ) + vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") + vcpkg_list(APPEND OPTIONS "-DBASH_EXECUTABLE=${MSYS_ROOT}/usr/bin/bash.exe") +endif() + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tools KTX_FEATURE_TOOLS + vulkan KTX_FEATURE_VK_UPLOAD +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DKTX_VERSION_FULL=v${VERSION} + -DKTX_FEATURE_TESTS=OFF + -DKTX_FEATURE_LOADTEST_APPS=OFF + -DKTX_FEATURE_STATIC_LIBRARY=${ENABLE_STATIC} + ${FEATURE_OPTIONS} + ${OPTIONS} + # Do not regenerate headers (needs more dependencies) + -DCMAKE_DISABLE_FIND_PACKAGE_Vulkan=1 + DISABLE_PARALLEL_CONFIGURE +) + +vcpkg_cmake_install() + +if(tools IN_LIST FEATURES) + vcpkg_copy_tools( + TOOL_NAMES + ktx + toktx + ktxsc + ktxinfo + ktx2ktx2 + ktx2check + AUTO_CLEAN + ) +else() + vcpkg_copy_pdbs() +endif() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ktx) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +file(GLOB LICENSE_FILES "${SOURCE_PATH}/LICENSES/*") +file(COPY ${LICENSE_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSES") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md") diff --git a/extern/vcpkg-overlays/ktx/vcpkg.json b/extern/vcpkg-overlays/ktx/vcpkg.json new file mode 100644 index 000000000..102e28131 --- /dev/null +++ b/extern/vcpkg-overlays/ktx/vcpkg.json @@ -0,0 +1,37 @@ +{ + "name": "ktx", + "version-semver": "4.3.0-beta1", + "port-version": 1, + "description": [ + "The Khronos KTX library and tools.", + "Functions for writing and reading KTX files, and instantiating OpenGL®, OpenGL ES™️ and Vulkan® textures from them." + ], + "homepage": "https://github.com/KhronosGroup/KTX-Software", + "license": null, + "supports": "arm64 | x64 | !windows", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zstd" + ], + "features": { + "tools": { + "description": "Build tools", + "supports": "!android", + "dependencies": [ + "cxxopts", + "fmt" + ] + }, + "vulkan": { + "description": "Build Vulkan support", + "supports": "!emscripten" + } + } +} From 109d2c515bfa4582356127c1358747b87c84801e Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 10:19:26 +1000 Subject: [PATCH 004/119] Add our patch to the ktx vcpkg port. --- .../ktx/CESIUM-0001-do-not-define-_DEBUG.patch | 13 +++++++++++++ extern/vcpkg-overlays/ktx/portfile.cmake | 1 + 2 files changed, 14 insertions(+) create mode 100644 extern/vcpkg-overlays/ktx/CESIUM-0001-do-not-define-_DEBUG.patch diff --git a/extern/vcpkg-overlays/ktx/CESIUM-0001-do-not-define-_DEBUG.patch b/extern/vcpkg-overlays/ktx/CESIUM-0001-do-not-define-_DEBUG.patch new file mode 100644 index 000000000..d3c382566 --- /dev/null +++ b/extern/vcpkg-overlays/ktx/CESIUM-0001-do-not-define-_DEBUG.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ffcbe95..7b13753 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -490,7 +490,7 @@ macro(common_libktx_settings target enable_write library_type) + target_compile_definitions( + ${target} + PUBLIC +- "$<$:_DEBUG;DEBUG>" ++ #"$<$:_DEBUG;DEBUG>" + PRIVATE + LIBKTX + ) diff --git a/extern/vcpkg-overlays/ktx/portfile.cmake b/extern/vcpkg-overlays/ktx/portfile.cmake index 2079a0350..79bd2c043 100644 --- a/extern/vcpkg-overlays/ktx/portfile.cmake +++ b/extern/vcpkg-overlays/ktx/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_from_github( 0003-mkversion.patch 0004-quirks.patch 0005-no-vendored-libs.patch + CESIUM-0001-do-not-define-_DEBUG.patch ) file(REMOVE "${SOURCE_PATH}/other_include/zstd_errors.h") From 3c1246860a0780c8806fb86c7d8b0f5e874cefae Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 12:13:04 +1000 Subject: [PATCH 005/119] Move some changes previously in cesium-native to cesium-unreal. --- extern/CMakeLists.txt | 6 +++++- extern/cesium-native | 2 +- extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 22f20a189..0b6cc8905 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -48,7 +48,7 @@ add_compile_definitions(NDEBUG) if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-ms-compat -fvisibility-inlines-hidden") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Android") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidde\n -fvisibility-inlines-hidden") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "iOS") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") @@ -85,6 +85,10 @@ if (CESIUM_USE_UNREAL_TRACING) list(APPEND CESIUM_EXTRA_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/include") endif() +# vcpkg setup +set(ENV{VCPKG_OVERLAY_PORTS} "${CMAKE_CURRENT_LIST_DIR}/vcpkg-overlays") +set(ENV{VCPKG_OVERLAY_TRIPLETS} "${CMAKE_CURRENT_LIST_DIR}/vcpkg-overlays/triplets") + if(WIN32) set(VCPKG_TRIPLET "x64-windows-unreal") endif() diff --git a/extern/cesium-native b/extern/cesium-native index bac574c13..2c5f0b326 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit bac574c13dec58420a72564d4c653f796f7b3cbf +Subproject commit 2c5f0b32689348791b1499fc6ff4889db904bf10 diff --git a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake new file mode 100644 index 000000000..5f6ba217d --- /dev/null +++ b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake @@ -0,0 +1,5 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CXX_FLAGS "/MD /Zp8") +set(VCPKG_C_FLAGS "/MD /Zp8") From 2b64650cb888e29ffd748a03907fa2b3af43b065 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 14:11:12 +1000 Subject: [PATCH 006/119] Fix release build. --- Source/CesiumEditor/CesiumEditor.Build.cs | 10 +++++++--- Source/CesiumRuntime/CesiumRuntime.Build.cs | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs index df02d7dd3..878a16798 100644 --- a/Source/CesiumEditor/CesiumEditor.Build.cs +++ b/Source/CesiumEditor/CesiumEditor.Build.cs @@ -58,17 +58,21 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) throw new InvalidOperationException("Cesium for Unreal does not support this platform."); } - string libPath = Path.Combine(ModuleDirectory, "../ThirdParty/lib/" + platform); + string libPathBase = Path.Combine(ModuleDirectory, "../ThirdParty/lib/" + platform); + string libPathDebug = libPathBase + "Debug"; + string libPathRelease = libPathBase + "Release"; + bool useDebug = false; if (Target.Configuration == UnrealTargetConfiguration.Debug || Target.Configuration == UnrealTargetConfiguration.DebugGame) { - string libPathDebug = libPath + "Debug"; if (Directory.Exists(libPathDebug)) { - libPath = libPathDebug; + useDebug = true; } } + string libPath = useDebug ? libPathDebug : libPathRelease; + string[] allLibs = Directory.GetFiles(libPath, libSearchPattern); PublicAdditionalLibraries.AddRange(allLibs); diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index c68e45607..c86ed6666 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -58,17 +58,21 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) throw new InvalidOperationException("Cesium for Unreal does not support this platform."); } - string libPath = Path.Combine(ModuleDirectory, "../ThirdParty/lib/" + platform); + string libPathBase = Path.Combine(ModuleDirectory, "../ThirdParty/lib/" + platform); + string libPathDebug = libPathBase + "Debug"; + string libPathRelease = libPathBase + "Release"; + bool useDebug = false; if (Target.Configuration == UnrealTargetConfiguration.Debug || Target.Configuration == UnrealTargetConfiguration.DebugGame) { - string libPathDebug = libPath + "Debug"; if (Directory.Exists(libPathDebug)) { - libPath = libPathDebug; + useDebug = true; } } + string libPath = useDebug ? libPathDebug : libPathRelease; + string[] allLibs = Directory.GetFiles(libPath, libSearchPattern); PublicAdditionalLibraries.AddRange(allLibs); From 711e120c04d45f510ed77ece2244d652b0669f40 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 16:49:56 +1000 Subject: [PATCH 007/119] Update cesium-native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 2c5f0b326..3797ba1e8 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 2c5f0b32689348791b1499fc6ff4889db904bf10 +Subproject commit 3797ba1e830f3800f9d3da75f0adcc6c130a719f From e33a412b98d2f5d1b02b23affe25084b1dc75ed0 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 17:32:36 +1000 Subject: [PATCH 008/119] First crack at vcpkg / Android support. --- .github/workflows/buildAndroid.yml | 1 + extern/cesium-native | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index 01f800abf..2bf3890f3 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -56,6 +56,7 @@ jobs: run: | # CMake gets confused by the Windows backslashes $env:ANDROID_NDK_ROOT=$env:ANDROID_NDK_ROOT.replace('\', '/') + $env:ANDROID_NDK_HOME=$env:ANDROID_NDK_ROOT cd extern cmake -B build-android -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-android-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release cmake --build build-android --config Release --target install -j8 diff --git a/extern/cesium-native b/extern/cesium-native index 3797ba1e8..35d419a2e 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 3797ba1e830f3800f9d3da75f0adcc6c130a719f +Subproject commit 35d419a2e47b6fd43f3990e209179894065a6cca From 6f2d53b1223033fe7748c323cb26a86ef148d4b4 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 17:49:54 +1000 Subject: [PATCH 009/119] Cache vcpkg. --- .github/workflows/buildWindows.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/buildWindows.yml b/.github/workflows/buildWindows.yml index fc7eb36cb..93e52b69b 100644 --- a/.github/workflows/buildWindows.yml +++ b/.github/workflows/buildWindows.yml @@ -69,6 +69,15 @@ jobs: if: ${{ inputs.extra-choco-packages }} run: | choco install -y ${{ inputs.extra-choco-packages }} + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: /.ezvcpkg + key: vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }}-${{ hashFiles('CMakeLists.txt') }} + restore-keys: | + vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }}-${{ hashFiles('CMakeLists.txt') }} + vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }} + vcpkg-${{ inputs.runner-label }} - name: Set environment variables run: | $env:CESIUM_UNREAL_VERSION=$env:GITHUB_REF_NAME From 82dbba19990d6f641e413826db17ea856908b2fe Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 17:52:58 +1000 Subject: [PATCH 010/119] Better vcpkg cache key. --- .github/workflows/buildWindows.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildWindows.yml b/.github/workflows/buildWindows.yml index 93e52b69b..ce3b2d3fb 100644 --- a/.github/workflows/buildWindows.yml +++ b/.github/workflows/buildWindows.yml @@ -73,9 +73,10 @@ jobs: uses: actions/cache@v4 with: path: /.ezvcpkg - key: vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }}-${{ hashFiles('CMakeLists.txt') }} + key: vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} restore-keys: | - vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }}-${{ hashFiles('CMakeLists.txt') }} + vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} + vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }} vcpkg-${{ inputs.runner-label }} - name: Set environment variables From 053417f2d4baee842ccbd00048eaea175a0359c3 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 17:55:28 +1000 Subject: [PATCH 011/119] Fix variable usage in cache key. --- .github/workflows/buildWindows.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildWindows.yml b/.github/workflows/buildWindows.yml index ce3b2d3fb..9c924f049 100644 --- a/.github/workflows/buildWindows.yml +++ b/.github/workflows/buildWindows.yml @@ -73,11 +73,11 @@ jobs: uses: actions/cache@v4 with: path: /.ezvcpkg - key: vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} + key: vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} restore-keys: | - vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} - vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} - vcpkg-${{ inputs.runner-label }}-${{ unreal-engine-version }} + vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} + vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} + vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }} vcpkg-${{ inputs.runner-label }} - name: Set environment variables run: | From a2e9cf882861067857752223cb957ae99a28faac Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 19:40:59 +1000 Subject: [PATCH 012/119] Add zlib-ng port from 2024.02.14 tag in microsoft/vcpkg repo. --- extern/vcpkg-overlays/zlib-ng/portfile.cmake | 25 ++++++++++++++++++++ extern/vcpkg-overlays/zlib-ng/vcpkg.json | 13 ++++++++++ 2 files changed, 38 insertions(+) create mode 100644 extern/vcpkg-overlays/zlib-ng/portfile.cmake create mode 100644 extern/vcpkg-overlays/zlib-ng/vcpkg.json diff --git a/extern/vcpkg-overlays/zlib-ng/portfile.cmake b/extern/vcpkg-overlays/zlib-ng/portfile.cmake new file mode 100644 index 000000000..cbbf3092e --- /dev/null +++ b/extern/vcpkg-overlays/zlib-ng/portfile.cmake @@ -0,0 +1,25 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO zlib-ng/zlib-ng + REF "${VERSION}" + SHA512 9212d87c63a2da4e5355a7a1c75380aeba40fbd0ea3d71d3784cb3eac94237f9bea2a1b7993a08f39d4197725c4c133087d3a9d213d3944aa48a7559de2be920 + HEAD_REF develop +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + "-DZLIB_FULL_VERSION=${ZLIB_FULL_VERSION}" + -DZLIB_ENABLE_TESTS=OFF + -DWITH_NEW_STRATEGIES=ON + OPTIONS_RELEASE + -DWITH_OPTIM=ON +) +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/debug/include" +) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md") diff --git a/extern/vcpkg-overlays/zlib-ng/vcpkg.json b/extern/vcpkg-overlays/zlib-ng/vcpkg.json new file mode 100644 index 000000000..330500613 --- /dev/null +++ b/extern/vcpkg-overlays/zlib-ng/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "zlib-ng", + "version": "2.1.5", + "description": "zlib replacement with optimizations for 'next generation' systems", + "homepage": "https://github.com/zlib-ng/zlib-ng", + "license": "Zlib", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ] +} From 475c95a58ef87b3cf9a7e84bce1ccafc834cbe3d Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 21:00:44 +1000 Subject: [PATCH 013/119] Fix several problems with the Android build. --- extern/cesium-native | 2 +- extern/unreal-android-toolchain.cmake | 2 +- extern/vcpkg-overlays/zlib-ng/portfile.cmake | 13 ++++++++++++- extern/vcpkg-overlays/zlib-ng/vcpkg.json | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/extern/cesium-native b/extern/cesium-native index 35d419a2e..d7c9abe5a 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 35d419a2e47b6fd43f3990e209179894065a6cca +Subproject commit d7c9abe5ab01a1367a7eff18cef385adb6bd589a diff --git a/extern/unreal-android-toolchain.cmake b/extern/unreal-android-toolchain.cmake index bcb07302c..05c22af59 100644 --- a/extern/unreal-android-toolchain.cmake +++ b/extern/unreal-android-toolchain.cmake @@ -10,7 +10,7 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) SET(HTTPLIB_USE_OPENSSL_IF_AVAILABLE OFF) diff --git a/extern/vcpkg-overlays/zlib-ng/portfile.cmake b/extern/vcpkg-overlays/zlib-ng/portfile.cmake index cbbf3092e..c3261757e 100644 --- a/extern/vcpkg-overlays/zlib-ng/portfile.cmake +++ b/extern/vcpkg-overlays/zlib-ng/portfile.cmake @@ -2,7 +2,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO zlib-ng/zlib-ng REF "${VERSION}" - SHA512 9212d87c63a2da4e5355a7a1c75380aeba40fbd0ea3d71d3784cb3eac94237f9bea2a1b7993a08f39d4197725c4c133087d3a9d213d3944aa48a7559de2be920 + SHA512 59ef586c09b9a63788475abfd6dd59ed602316b38f543f801bea802ff8bec8b55a89bee90375b8bbffa3bdebc7d92a00903f4b7c94cdc1a53a36e2e1fd71d13a HEAD_REF develop ) @@ -12,6 +12,17 @@ vcpkg_cmake_configure( "-DZLIB_FULL_VERSION=${ZLIB_FULL_VERSION}" -DZLIB_ENABLE_TESTS=OFF -DWITH_NEW_STRATEGIES=ON + # Disable ARMv6 instructions. We don't need this because we only run on 64-bit ARM (v8), + # which has better instructions. zlib-ng has a bug that makes it try to use these v6 + # instructions even though they're not available. An attempt to fix it was made in this + # PR: https://github.com/zlib-ng/zlib-ng/pull/1617 + # But it doesn't work in our Android builds because the dependent option + # "NOT ARCH STREQUAL \"aarch64\"" that is meant to set `WITH_ARMV6` to FALSE is not + # triggered because our ARCH is `aarch64-none-linux-android21`. It's not clear if this + # is something quirky about our environment or if the fix is just not robust. + # Either way, forcing WITH_ARMV6=OFF here fixes the probelm and should be reasonable + # on all platforms that Cesium for Unreal supports. + -DWITH_ARMV6=OFF OPTIONS_RELEASE -DWITH_OPTIM=ON ) diff --git a/extern/vcpkg-overlays/zlib-ng/vcpkg.json b/extern/vcpkg-overlays/zlib-ng/vcpkg.json index 330500613..93df3a2d2 100644 --- a/extern/vcpkg-overlays/zlib-ng/vcpkg.json +++ b/extern/vcpkg-overlays/zlib-ng/vcpkg.json @@ -1,6 +1,6 @@ { "name": "zlib-ng", - "version": "2.1.5", + "version": "2.1.6", "description": "zlib replacement with optimizations for 'next generation' systems", "homepage": "https://github.com/zlib-ng/zlib-ng", "license": "Zlib", From 674cf4abfbbabc280e6dfa1a190b3b96748b79e7 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 21:29:10 +1000 Subject: [PATCH 014/119] Add vcpkg caching to Android, and always save it. --- .github/workflows/buildAndroid.yml | 11 +++++++++++ .github/workflows/buildWindows.yml | 1 + 2 files changed, 12 insertions(+) diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index 2bf3890f3..980a49674 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -43,6 +43,17 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: /.ezvcpkg + key: vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} + save-always: true + restore-keys: | + vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} + vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} + vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }} + vcpkg-${{ inputs.runner-label }} - name: Set environment variables run: | $env:CESIUM_UNREAL_VERSION=$env:GITHUB_REF_NAME diff --git a/.github/workflows/buildWindows.yml b/.github/workflows/buildWindows.yml index 9c924f049..f1e7e2f1c 100644 --- a/.github/workflows/buildWindows.yml +++ b/.github/workflows/buildWindows.yml @@ -74,6 +74,7 @@ jobs: with: path: /.ezvcpkg key: vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} + save-always: true restore-keys: | vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} From 860bb5b6d4e6884d06aeaeab699211e56ec6cba5 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 21:35:52 +1000 Subject: [PATCH 015/119] Maybe make some progress toward working Android and iOS. --- Source/CesiumEditor/CesiumEditor.Build.cs | 2 +- Source/CesiumRuntime/CesiumRuntime.Build.cs | 2 +- extern/unreal-ios-toolchain.cmake | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs index 878a16798..4a0be18db 100644 --- a/Source/CesiumEditor/CesiumEditor.Build.cs +++ b/Source/CesiumEditor/CesiumEditor.Build.cs @@ -40,7 +40,7 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) } else if (Target.Platform == UnrealTargetPlatform.Android) { - platform = "Android-ARM64-"; + platform = "Android-aarch64-"; libSearchPattern = "lib*.a"; } else if (Target.Platform == UnrealTargetPlatform.Linux) diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index c86ed6666..d0111abde 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -40,7 +40,7 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) } else if (Target.Platform == UnrealTargetPlatform.Android) { - platform = "Android-ARM64-"; + platform = "Android-aarch64-"; libSearchPattern = "lib*.a"; } else if (Target.Platform == UnrealTargetPlatform.Linux) diff --git a/extern/unreal-ios-toolchain.cmake b/extern/unreal-ios-toolchain.cmake index 524c89e17..5db525d6b 100644 --- a/extern/unreal-ios-toolchain.cmake +++ b/extern/unreal-ios-toolchain.cmake @@ -1,4 +1,5 @@ set(GENERATOR Xcode) set(CMAKE_SYSTEM_NAME iOS) set(CMAKE_OSX_ARCHITECTURES arm64) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) \ No newline at end of file +set(CMAKE_POSITION_INDEPENDENT_CODE ON) +SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) From 315010bc40c773c372669222031293828b7ddb0a Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 7 Jun 2024 22:16:33 +1000 Subject: [PATCH 016/119] Temporarily disable most of the Android build. To warm up the vcpkg cache. --- .github/workflows/buildAndroid.yml | 82 +++++++++++++++--------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index 980a49674..be9056bda 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -73,44 +73,44 @@ jobs: cmake --build build-android --config Release --target install -j8 cd .. rm -r -fo extern - - name: Install Unreal Engine - uses: ./.github/actions/install-unreal-windows - with: - unreal-engine-zip: ${{ inputs.unreal-engine-zip }} - unreal-program-name: ${{ inputs.unreal-program-name }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Overwrite plugin engine version - run: | - ((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.1.0"','"EngineVersion": "${{ inputs.unreal-engine-version }}"') | Set-Content -Path CesiumForUnreal.uplugin - - name: Customize BuildConfiguration.xml - run: | - mkdir -p "$env:USERPROFILE\AppData\Roaming\Unreal Engine\UnrealBuildTool" - # - We limit parallel actions because our builds use a lot more memory than UBT thinks they will. - # - We set the source code control Provider to None so UBT includes all files in the unity build. - Set-Content -Path "$env:USERPROFILE\AppData\Roaming\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml" -Value ' - - - 2 - - None - ' - - name: Build plugin - run: | - $env:NDKROOT=$env:ANDROID_NDK_ROOT - cd "D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Build/BatchFiles" - ./RunUAT.bat BuildPlugin -Plugin="$ENV:GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$ENV:GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Android -NoHostPlatform - - name: Print log - if: ${{ failure() }} - run: | - cat "C:\Users\runneradmin\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+Program+Files+Epic+Games+${{ inputs.unreal-program-name }}\UBT-UnrealGame-Android-Development.txt" - - name: Compress debug sections - run: | - dir packages/CesiumForUnreal/Intermediate/Build/Android/UnrealGame/Development/CesiumRuntime/*.o | Foreach-Object { & $ENV:ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objcopy.exe --compress-debug-sections $_.FullName } - dir packages/CesiumForUnreal/Intermediate/Build/Android/UnrealGame/Shipping/CesiumRuntime/*.o | Foreach-Object { & $ENV:ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objcopy.exe --compress-debug-sections $_.FullName } - - name: Publish plugin package artifact - if: ${{ success() }} - uses: actions/upload-artifact@v4 - with: - name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}} - path: packages + # - name: Install Unreal Engine + # uses: ./.github/actions/install-unreal-windows + # with: + # unreal-engine-zip: ${{ inputs.unreal-engine-zip }} + # unreal-program-name: ${{ inputs.unreal-program-name }} + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # - name: Overwrite plugin engine version + # run: | + # ((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.1.0"','"EngineVersion": "${{ inputs.unreal-engine-version }}"') | Set-Content -Path CesiumForUnreal.uplugin + # - name: Customize BuildConfiguration.xml + # run: | + # mkdir -p "$env:USERPROFILE\AppData\Roaming\Unreal Engine\UnrealBuildTool" + # # - We limit parallel actions because our builds use a lot more memory than UBT thinks they will. + # # - We set the source code control Provider to None so UBT includes all files in the unity build. + # Set-Content -Path "$env:USERPROFILE\AppData\Roaming\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml" -Value ' + # + # + # 2 + # + # None + # ' + # - name: Build plugin + # run: | + # $env:NDKROOT=$env:ANDROID_NDK_ROOT + # cd "D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Build/BatchFiles" + # ./RunUAT.bat BuildPlugin -Plugin="$ENV:GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$ENV:GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Android -NoHostPlatform + # - name: Print log + # if: ${{ failure() }} + # run: | + # cat "C:\Users\runneradmin\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+Program+Files+Epic+Games+${{ inputs.unreal-program-name }}\UBT-UnrealGame-Android-Development.txt" + # - name: Compress debug sections + # run: | + # dir packages/CesiumForUnreal/Intermediate/Build/Android/UnrealGame/Development/CesiumRuntime/*.o | Foreach-Object { & $ENV:ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objcopy.exe --compress-debug-sections $_.FullName } + # dir packages/CesiumForUnreal/Intermediate/Build/Android/UnrealGame/Shipping/CesiumRuntime/*.o | Foreach-Object { & $ENV:ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objcopy.exe --compress-debug-sections $_.FullName } + # - name: Publish plugin package artifact + # if: ${{ success() }} + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}} + # path: packages From 26cf067860ad8024fdecbb53372bd6f08a2121d9 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 8 Jun 2024 09:03:54 +1000 Subject: [PATCH 017/119] Better vcpkg cache warmup. --- .github/workflows/buildAndroid.yml | 4 ++-- .github/workflows/buildWindows.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index be9056bda..3128fcecc 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -47,9 +47,9 @@ jobs: uses: actions/cache@v4 with: path: /.ezvcpkg - key: vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} - save-always: true + key: vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 restore-keys: | + vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }} diff --git a/.github/workflows/buildWindows.yml b/.github/workflows/buildWindows.yml index f1e7e2f1c..0e734ba1d 100644 --- a/.github/workflows/buildWindows.yml +++ b/.github/workflows/buildWindows.yml @@ -73,9 +73,9 @@ jobs: uses: actions/cache@v4 with: path: /.ezvcpkg - key: vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} - save-always: true + key: vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 restore-keys: | + vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }} From 94e33751ee0c3d31a39f6504e81b26224e28ad27 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 8 Jun 2024 10:23:55 +1000 Subject: [PATCH 018/119] Better cache key. --- .github/workflows/buildAndroid.yml | 12 ++++++------ .github/workflows/buildWindows.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index 3128fcecc..f5cea6fa8 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -47,13 +47,13 @@ jobs: uses: actions/cache@v4 with: path: /.ezvcpkg - key: vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 + key: vcpkg-android-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 restore-keys: | - vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} - vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} - vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }} - vcpkg-${{ inputs.runner-label }} + vcpkg-android-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 + vcpkg-android-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} + vcpkg-android-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} + vcpkg-android-${{ inputs.unreal-engine-version }} + vcpkg-android- - name: Set environment variables run: | $env:CESIUM_UNREAL_VERSION=$env:GITHUB_REF_NAME diff --git a/.github/workflows/buildWindows.yml b/.github/workflows/buildWindows.yml index 0e734ba1d..87e383226 100644 --- a/.github/workflows/buildWindows.yml +++ b/.github/workflows/buildWindows.yml @@ -73,13 +73,13 @@ jobs: uses: actions/cache@v4 with: path: /.ezvcpkg - key: vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 + key: vcpkg-windows-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 restore-keys: | - vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} - vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} - vcpkg-${{ inputs.runner-label }}-${{ inputs.unreal-engine-version }} - vcpkg-${{ inputs.runner-label }} + vcpkg-windows-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 + vcpkg-windows-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} + vcpkg-windows-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} + vcpkg-windows-${{ inputs.unreal-engine-version }} + vcpkg-windows- - name: Set environment variables run: | $env:CESIUM_UNREAL_VERSION=$env:GITHUB_REF_NAME From 886882eaf6308d1a48d4f7812a1b4a5c90af5e23 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 8 Jun 2024 12:34:11 +1000 Subject: [PATCH 019/119] Restore full Android build. --- .github/workflows/buildAndroid.yml | 82 +++++++++++++++--------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index f5cea6fa8..e84cd848e 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -73,44 +73,44 @@ jobs: cmake --build build-android --config Release --target install -j8 cd .. rm -r -fo extern - # - name: Install Unreal Engine - # uses: ./.github/actions/install-unreal-windows - # with: - # unreal-engine-zip: ${{ inputs.unreal-engine-zip }} - # unreal-program-name: ${{ inputs.unreal-program-name }} - # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # - name: Overwrite plugin engine version - # run: | - # ((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.1.0"','"EngineVersion": "${{ inputs.unreal-engine-version }}"') | Set-Content -Path CesiumForUnreal.uplugin - # - name: Customize BuildConfiguration.xml - # run: | - # mkdir -p "$env:USERPROFILE\AppData\Roaming\Unreal Engine\UnrealBuildTool" - # # - We limit parallel actions because our builds use a lot more memory than UBT thinks they will. - # # - We set the source code control Provider to None so UBT includes all files in the unity build. - # Set-Content -Path "$env:USERPROFILE\AppData\Roaming\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml" -Value ' - # - # - # 2 - # - # None - # ' - # - name: Build plugin - # run: | - # $env:NDKROOT=$env:ANDROID_NDK_ROOT - # cd "D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Build/BatchFiles" - # ./RunUAT.bat BuildPlugin -Plugin="$ENV:GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$ENV:GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Android -NoHostPlatform - # - name: Print log - # if: ${{ failure() }} - # run: | - # cat "C:\Users\runneradmin\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+Program+Files+Epic+Games+${{ inputs.unreal-program-name }}\UBT-UnrealGame-Android-Development.txt" - # - name: Compress debug sections - # run: | - # dir packages/CesiumForUnreal/Intermediate/Build/Android/UnrealGame/Development/CesiumRuntime/*.o | Foreach-Object { & $ENV:ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objcopy.exe --compress-debug-sections $_.FullName } - # dir packages/CesiumForUnreal/Intermediate/Build/Android/UnrealGame/Shipping/CesiumRuntime/*.o | Foreach-Object { & $ENV:ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objcopy.exe --compress-debug-sections $_.FullName } - # - name: Publish plugin package artifact - # if: ${{ success() }} - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}} - # path: packages + - name: Install Unreal Engine + uses: ./.github/actions/install-unreal-windows + with: + unreal-engine-zip: ${{ inputs.unreal-engine-zip }} + unreal-program-name: ${{ inputs.unreal-program-name }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Overwrite plugin engine version + run: | + ((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.1.0"','"EngineVersion": "${{ inputs.unreal-engine-version }}"') | Set-Content -Path CesiumForUnreal.uplugin + - name: Customize BuildConfiguration.xml + run: | + mkdir -p "$env:USERPROFILE\AppData\Roaming\Unreal Engine\UnrealBuildTool" + # - We limit parallel actions because our builds use a lot more memory than UBT thinks they will. + # - We set the source code control Provider to None so UBT includes all files in the unity build. + Set-Content -Path "$env:USERPROFILE\AppData\Roaming\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml" -Value ' + + + 2 + + None + ' + - name: Build plugin + run: | + $env:NDKROOT=$env:ANDROID_NDK_ROOT + cd "D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Build/BatchFiles" + ./RunUAT.bat BuildPlugin -Plugin="$ENV:GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$ENV:GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Android -NoHostPlatform + - name: Print log + if: ${{ failure() }} + run: | + cat "C:\Users\runneradmin\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+Program+Files+Epic+Games+${{ inputs.unreal-program-name }}\UBT-UnrealGame-Android-Development.txt" + - name: Compress debug sections + run: | + dir packages/CesiumForUnreal/Intermediate/Build/Android/UnrealGame/Development/CesiumRuntime/*.o | Foreach-Object { & $ENV:ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objcopy.exe --compress-debug-sections $_.FullName } + dir packages/CesiumForUnreal/Intermediate/Build/Android/UnrealGame/Shipping/CesiumRuntime/*.o | Foreach-Object { & $ENV:ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objcopy.exe --compress-debug-sections $_.FullName } + - name: Publish plugin package artifact + if: ${{ success() }} + uses: actions/upload-artifact@v4 + with: + name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}} + path: packages From 8266b4cfae94dd5ebf5196303fb0d654c58e5108 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 10 Jun 2024 15:02:28 +1000 Subject: [PATCH 020/119] Re-add MikkTSpace PrivateIncludePath for Android / iOS. --- Source/CesiumRuntime/CesiumRuntime.Build.cs | 10 +++++++--- extern/CMakeLists.txt | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index d0111abde..80f2005ff 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -97,12 +97,16 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) } ); - // Use UE's MikkTSpace on non-Android - if (Target.Platform != UnrealTargetPlatform.Android) + // Use UE's MikkTSpace on most platforms, except Android and iOS. + // On those platforms, UE's isn't available, so we use our own. + if (Target.Platform != UnrealTargetPlatform.Android && Target.Platform != UnrealTargetPlatform.IOS) { PrivateDependencyModuleNames.Add("MikkTSpace"); } - + else + { + PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "../ThirdParty/include/mikktspace")); + } PublicDefinitions.AddRange( new string[] diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 0b6cc8905..1987ced5e 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -98,9 +98,9 @@ add_subdirectory(cesium-native) # cesium-native doesn't require this header to be public, but Cesium for Unreal wants to use it. #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cesium-native/extern/stb/stb_image_resize.h TYPE INCLUDE) -# Unreal Engine doesn't include MikkTSpace on Android. -# So add our own. if (ANDROID OR IOS) + # Unreal Engine doesn't include MikkTSpace on Android or iOS. + # So add our own. add_library(MikkTSpace MikkTSpace/mikktspace.c) set_target_properties(MikkTSpace PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/MikkTSpace/mikktspace.h") target_include_directories(MikkTSpace PUBLIC MikkTSpace) @@ -116,7 +116,7 @@ if (ANDROID OR IOS) endif() option(BUILD_SHARED_LIB OFF) -option( SUPPORT_CONSOLE_APP OFF) +option(SUPPORT_CONSOLE_APP OFF) set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}) add_subdirectory(tidy-html5) From 77893218b43c131e546cf891993023e59e0d659c Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 10 Jun 2024 21:15:41 +1000 Subject: [PATCH 021/119] Fix Linux vcpkg build. --- extern/CMakeLists.txt | 8 ++++++++ extern/cesium-native | 2 +- extern/unreal-linux-toolchain.cmake | 9 ++++++--- extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake | 6 ++++++ 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 1987ced5e..56538b4f9 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -91,6 +91,14 @@ set(ENV{VCPKG_OVERLAY_TRIPLETS} "${CMAKE_CURRENT_LIST_DIR}/vcpkg-overlays/triple if(WIN32) set(VCPKG_TRIPLET "x64-windows-unreal") +elseif(CMAKE_HOST_APPLE) + if (CMAKE_APPLE_SILICON_PROCESSOR STREQUAL "arm64") + set(VCPKG_TRIPLET "arm64-osx-unreal") + else() + set(VCPKG_TRIPLET "x64-osx-unreal") + endif() +elseif(CMAKE_HOST_LINUX) + set(VCPKG_TRIPLET "x64-linux-unreal") endif() add_subdirectory(cesium-native) diff --git a/extern/cesium-native b/extern/cesium-native index d7c9abe5a..2b32134b1 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit d7c9abe5ab01a1367a7eff18cef385adb6bd589a +Subproject commit 2b32134b16368a03b1406da0f658c3e5d5562792 diff --git a/extern/unreal-linux-toolchain.cmake b/extern/unreal-linux-toolchain.cmake index ef7c02796..0b646d705 100644 --- a/extern/unreal-linux-toolchain.cmake +++ b/extern/unreal-linux-toolchain.cmake @@ -1,19 +1,22 @@ SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_PROCESSOR x86_64) -SET(CMAKE_SYSROOT $ENV{UNREAL_ENGINE_COMPILER_DIR}) +SET(CMAKE_SYSROOT "$ENV{UNREAL_ENGINE_COMPILER_DIR}") SET(CMAKE_C_COMPILER $ENV{UNREAL_ENGINE_COMPILER_DIR}/bin/clang) SET(CMAKE_CXX_COMPILER $ENV{UNREAL_ENGINE_COMPILER_DIR}/bin/clang++) +SET(CMAKE_AR $ENV{UNREAL_ENGINE_COMPILER_DIR}/bin/llvm-ar) SET(CMAKE_BUILD_WITH_INSTALL_RPATH on) SET(CMAKE_POSITION_INDEPENDENT_CODE on) -SET(CMAKE_CXX_FLAGS "-nostdinc++ -I$ENV{UNREAL_ENGINE_LIBCXX_DIR}/include -I$ENV{UNREAL_ENGINE_LIBCXX_DIR}/include/c++/v1 -I$ENV{UNREAL_ENGINE_LIBCXX_DIR}/include/c++/v1") +# These were deduced by scouring Unreal's LinuxToolChain.cs. +SET(CMAKE_CXX_FLAGS "-nostdinc++ -I$ENV{UNREAL_ENGINE_LIBCXX_DIR}/include -I$ENV{UNREAL_ENGINE_LIBCXX_DIR}/include/c++/v1 -target x86_64-unknown-linux-gnu") +SET(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld -target x86_64-unknown-linux-gnu --sysroot=$ENV{UNREAL_ENGINE_COMPILER_DIR} -B$ENV{UNREAL_ENGINE_COMPILER_DIR}/usr/lib -B$ENV{UNREAL_ENGINE_COMPILER_DIR}/usr/lib64 -L$ENV{UNREAL_ENGINE_COMPILER_DIR}/usr/lib -L$ENV{UNREAL_ENGINE_COMPILER_DIR}/usr/lib64 -nodefaultlibs -L$ENV{UNREAL_ENGINE_LIBCXX_DIR}/lib/Unix/x86_64-unknown-linux-gnu/ $ENV{UNREAL_ENGINE_LIBCXX_DIR}/lib/Unix/x86_64-unknown-linux-gnu/libc++.a $ENV{UNREAL_ENGINE_LIBCXX_DIR}/lib/Unix/x86_64-unknown-linux-gnu/libc++abi.a -lm -lc -lpthread -lgcc_s -lgcc") # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) diff --git a/extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake new file mode 100644 index 000000000..582291768 --- /dev/null +++ b/extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake @@ -0,0 +1,6 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CMAKE_SYSTEM_NAME Linux) +set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/../../unreal-linux-toolchain.cmake) From b1544af1b19514afa18d9f6a2352c27f7a9d77c5 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 10 Jun 2024 21:46:04 +1000 Subject: [PATCH 022/119] Linux-AMD64 -> Linux-x86_64 --- Source/CesiumEditor/CesiumEditor.Build.cs | 2 +- Source/CesiumRuntime/CesiumRuntime.Build.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs index 4a0be18db..793203499 100644 --- a/Source/CesiumEditor/CesiumEditor.Build.cs +++ b/Source/CesiumEditor/CesiumEditor.Build.cs @@ -45,7 +45,7 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) } else if (Target.Platform == UnrealTargetPlatform.Linux) { - platform = "Linux-AMD64-"; + platform = "Linux-x86_64-"; libSearchPattern = "lib*.a"; } else if (Target.Platform == UnrealTargetPlatform.IOS) diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index 80f2005ff..5db500886 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -45,7 +45,7 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) } else if (Target.Platform == UnrealTargetPlatform.Linux) { - platform = "Linux-AMD64-"; + platform = "Linux-x86_64-"; libSearchPattern = "lib*.a"; } else if(Target.Platform == UnrealTargetPlatform.IOS) From cdac5788acd93bec5e55777da183e2753fb4c2eb Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 11 Jun 2024 08:13:19 +1000 Subject: [PATCH 023/119] Update cesium-native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 2b32134b1..da9514e28 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 2b32134b16368a03b1406da0f658c3e5d5562792 +Subproject commit da9514e280c9e98d07741d23a42532a44a31bc6f From 87f63992c0a3bf57ccf3cd5c2b573297be4e0ff6 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 11 Jun 2024 15:24:15 +1000 Subject: [PATCH 024/119] Hacky library rename, as an experiment. --- .github/workflows/buildLinux.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index 448cb2fcf..e71ad6ca2 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -74,6 +74,14 @@ jobs: cmake --build build --config Release --target install -j8 cd .. rm -rf extern + - name: Hackily rename libssl.a and libcrypto.a + run: | + # UnrealBuildTool has hard-coded logic to wrap these two libraries in --whole-archive + # which leads to linker errors. So rename these files to avoid this logic. + # Most likely this will just lead to linker errors later (at game package time), but + # let's try it and see. + mv $GITHUB_WORKSPACE/Source/ThirdParty/lib/lib/Linux-x86_64-Release/libssl.a $GITHUB_WORKSPACE/Source/ThirdParty/lib/lib/Linux-x86_64-Release/libcesium-ssl.a + mv $GITHUB_WORKSPACE/Source/ThirdParty/lib/lib/Linux-x86_64-Release/libcrypto.a $GITHUB_WORKSPACE/Source/ThirdParty/lib/lib/Linux-x86_64-Release/libcesium-crypto.a - name: Make more swap space available run: | sudo swapoff -a From e72c55dd54a53ba9ffd6e9f405543d94704a0a68 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 11 Jun 2024 16:57:00 +1000 Subject: [PATCH 025/119] Fix path in hack. --- .github/workflows/buildLinux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index e71ad6ca2..df2138e2f 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -80,8 +80,8 @@ jobs: # which leads to linker errors. So rename these files to avoid this logic. # Most likely this will just lead to linker errors later (at game package time), but # let's try it and see. - mv $GITHUB_WORKSPACE/Source/ThirdParty/lib/lib/Linux-x86_64-Release/libssl.a $GITHUB_WORKSPACE/Source/ThirdParty/lib/lib/Linux-x86_64-Release/libcesium-ssl.a - mv $GITHUB_WORKSPACE/Source/ThirdParty/lib/lib/Linux-x86_64-Release/libcrypto.a $GITHUB_WORKSPACE/Source/ThirdParty/lib/lib/Linux-x86_64-Release/libcesium-crypto.a + mv $GITHUB_WORKSPACE/Source/ThirdParty/lib/Linux-x86_64-Release/libssl.a $GITHUB_WORKSPACE/Source/ThirdParty/lib/Linux-x86_64-Release/libcesium-ssl.a + mv $GITHUB_WORKSPACE/Source/ThirdParty/lib/Linux-x86_64-Release/libcrypto.a $GITHUB_WORKSPACE/Source/ThirdParty/lib/Linux-x86_64-Release/libcesium-crypto.a - name: Make more swap space available run: | sudo swapoff -a From 3114793b95d9f8daabcce52dec910dfe30a92db2 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 11 Jun 2024 18:44:39 +1000 Subject: [PATCH 026/119] Use OpenSSL from Unreal Engine. This is likely to break platforms other than Linux. --- extern/unreal-linux-toolchain.cmake | 27 ++++++++++++++++++++ extern/vcpkg-overlays/openssl/portfile.cmake | 1 + extern/vcpkg-overlays/openssl/vcpkg.json | 5 ++++ 3 files changed, 33 insertions(+) create mode 100644 extern/vcpkg-overlays/openssl/portfile.cmake create mode 100644 extern/vcpkg-overlays/openssl/vcpkg.json diff --git a/extern/unreal-linux-toolchain.cmake b/extern/unreal-linux-toolchain.cmake index 0b646d705..131ba1d71 100644 --- a/extern/unreal-linux-toolchain.cmake +++ b/extern/unreal-linux-toolchain.cmake @@ -20,3 +20,30 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) +SET(UNREAL_ROOT_DIR_RELATIVE "$ENV{UNREAL_ENGINE_LIBCXX_DIR}/../../../../../") +FILE(REAL_PATH "${UNREAL_ROOT_DIR_RELATIVE}" UNREAL_ROOT_DIR) + +# Some old versions of UE used to have multiple versions of OpenSSL, with different versions used on different platforms. +# That is no longer the case in UE 5.2, 5.3, and 5.4, but the below logic may need to change if that ever happens again. +SET(OPENSSL_VERSIONS_DIR "${UNREAL_ROOT_DIR}/Engine/Source/ThirdParty/OpenSSL") +FILE(GLOB OPENSSL_POSSIBLE_ROOT_DIRS LIST_DIRECTORIES true "${OPENSSL_VERSIONS_DIR}/*") + +# Find the subdirectories, each of which should represent an OpenSSL version. +SET(OPENSSL_VERSION_DIRS "") +FOREACH(OPENSSL_POSSIBLE_ROOT_DIR IN LISTS OPENSSL_POSSIBLE_ROOT_DIRS) + IF(IS_DIRECTORY "${OPENSSL_POSSIBLE_ROOT_DIR}") + LIST(APPEND OPENSSL_VERSION_DIRS "${OPENSSL_POSSIBLE_ROOT_DIR}") + ENDIF() +ENDFOREACH() + +# There should be exactly one version, otherwise we don't know what to do. +LIST(LENGTH OPENSSL_VERSION_DIRS OPENSSL_VERSION_DIRS_LENGTH) +IF(NOT OPENSSL_VERSION_DIRS_LENGTH EQUAL 1) + MESSAGE(FATAL_ERROR "Could not deduce the OpenSSL root directory because there is not exactly one directory entry matching `${OPENSSL_VERSIONS_DIR}/1.1.1?`.") +ENDIF() + +LIST(GET OPENSSL_VERSION_DIRS 0 OPENSSL_ROOT_DIR) + +set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/include/Unix/x86_64-unknown-linux-gnu") +set(OPENSSL_CRYPTO_LIBRARY "${OPENSSL_ROOT_DIR}/lib/Unix/x86_64-unknown-linux-gnu/libcrypto.a") +set(OPENSSL_SSL_LIBRARY "${OPENSSL_ROOT_DIR}/lib/Unix/x86_64-unknown-linux-gnu/libssl.a") diff --git a/extern/vcpkg-overlays/openssl/portfile.cmake b/extern/vcpkg-overlays/openssl/portfile.cmake new file mode 100644 index 000000000..065116c27 --- /dev/null +++ b/extern/vcpkg-overlays/openssl/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/extern/vcpkg-overlays/openssl/vcpkg.json b/extern/vcpkg-overlays/openssl/vcpkg.json new file mode 100644 index 000000000..7801b9e41 --- /dev/null +++ b/extern/vcpkg-overlays/openssl/vcpkg.json @@ -0,0 +1,5 @@ +{ + "name": "openssl", + "version": "0.0.0", + "port-version": 0 +} From d568abd813c7db6a575ef5ce1d1957ccdd594c8e Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 11 Jun 2024 19:10:15 +1000 Subject: [PATCH 027/119] Remove a hack. --- .github/workflows/buildLinux.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index df2138e2f..448cb2fcf 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -74,14 +74,6 @@ jobs: cmake --build build --config Release --target install -j8 cd .. rm -rf extern - - name: Hackily rename libssl.a and libcrypto.a - run: | - # UnrealBuildTool has hard-coded logic to wrap these two libraries in --whole-archive - # which leads to linker errors. So rename these files to avoid this logic. - # Most likely this will just lead to linker errors later (at game package time), but - # let's try it and see. - mv $GITHUB_WORKSPACE/Source/ThirdParty/lib/Linux-x86_64-Release/libssl.a $GITHUB_WORKSPACE/Source/ThirdParty/lib/Linux-x86_64-Release/libcesium-ssl.a - mv $GITHUB_WORKSPACE/Source/ThirdParty/lib/Linux-x86_64-Release/libcrypto.a $GITHUB_WORKSPACE/Source/ThirdParty/lib/Linux-x86_64-Release/libcesium-crypto.a - name: Make more swap space available run: | sudo swapoff -a From 29b59f4c4703c1b8b329f7880e81a91b70492322 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 11 Jun 2024 20:55:30 +1000 Subject: [PATCH 028/119] Proper overlay port for Unreal OpenSSL. --- extern/CMakeLists.txt | 13 +++++ extern/unreal-linux-toolchain.cmake | 28 ----------- extern/vcpkg-overlays/openssl/libcrypto.pc.in | 11 +++++ extern/vcpkg-overlays/openssl/libssl.pc.in | 12 +++++ extern/vcpkg-overlays/openssl/openssl.pc.in | 10 ++++ extern/vcpkg-overlays/openssl/portfile.cmake | 48 +++++++++++++++++++ extern/vcpkg-overlays/triplets/common.cmake | 1 + .../triplets/x64-linux-unreal.cmake | 2 + .../triplets/x64-windows-unreal.cmake | 3 ++ 9 files changed, 100 insertions(+), 28 deletions(-) create mode 100644 extern/vcpkg-overlays/openssl/libcrypto.pc.in create mode 100644 extern/vcpkg-overlays/openssl/libssl.pc.in create mode 100644 extern/vcpkg-overlays/openssl/openssl.pc.in create mode 100644 extern/vcpkg-overlays/triplets/common.cmake diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 56538b4f9..faaf7d77c 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -6,6 +6,19 @@ project( LANGUAGES CXX C ) +if (DEFINED ENV{UNREAL_ENGINE_ROOT} AND NOT UNREAL_ENGINE_ROOT) + set(UNREAL_ENGINE_ROOT "$ENV{UNREAL_ENGINE_ROOT}") +endif() + +if (NOT UNREAL_ENGINE_ROOT) + message(FATAL_ERROR "Please specify the root of your Unreal Engine installation, either by setting the UNREAL_ENGINE_ROOT environment variable or with -DUNREAL_ENGINE_ROOT=path on the cmake command-line.") +endif() + +message(STATUS "Using Unreal Engine installation at: ${UNREAL_ENGINE_ROOT}") + +# Set the UE environment variable so it's inherited by vcpkg builds. +set(ENV{UNREAL_ENGINE_ROOT} "${UNREAL_ENGINE_ROOT}") + if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") set(CESIUM_ARCHITECTURE "aarch64") set(HTTPLIB_USE_OPENSSL_IF_AVAILABLE OFF) diff --git a/extern/unreal-linux-toolchain.cmake b/extern/unreal-linux-toolchain.cmake index 131ba1d71..ea7c2d433 100644 --- a/extern/unreal-linux-toolchain.cmake +++ b/extern/unreal-linux-toolchain.cmake @@ -19,31 +19,3 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) - -SET(UNREAL_ROOT_DIR_RELATIVE "$ENV{UNREAL_ENGINE_LIBCXX_DIR}/../../../../../") -FILE(REAL_PATH "${UNREAL_ROOT_DIR_RELATIVE}" UNREAL_ROOT_DIR) - -# Some old versions of UE used to have multiple versions of OpenSSL, with different versions used on different platforms. -# That is no longer the case in UE 5.2, 5.3, and 5.4, but the below logic may need to change if that ever happens again. -SET(OPENSSL_VERSIONS_DIR "${UNREAL_ROOT_DIR}/Engine/Source/ThirdParty/OpenSSL") -FILE(GLOB OPENSSL_POSSIBLE_ROOT_DIRS LIST_DIRECTORIES true "${OPENSSL_VERSIONS_DIR}/*") - -# Find the subdirectories, each of which should represent an OpenSSL version. -SET(OPENSSL_VERSION_DIRS "") -FOREACH(OPENSSL_POSSIBLE_ROOT_DIR IN LISTS OPENSSL_POSSIBLE_ROOT_DIRS) - IF(IS_DIRECTORY "${OPENSSL_POSSIBLE_ROOT_DIR}") - LIST(APPEND OPENSSL_VERSION_DIRS "${OPENSSL_POSSIBLE_ROOT_DIR}") - ENDIF() -ENDFOREACH() - -# There should be exactly one version, otherwise we don't know what to do. -LIST(LENGTH OPENSSL_VERSION_DIRS OPENSSL_VERSION_DIRS_LENGTH) -IF(NOT OPENSSL_VERSION_DIRS_LENGTH EQUAL 1) - MESSAGE(FATAL_ERROR "Could not deduce the OpenSSL root directory because there is not exactly one directory entry matching `${OPENSSL_VERSIONS_DIR}/1.1.1?`.") -ENDIF() - -LIST(GET OPENSSL_VERSION_DIRS 0 OPENSSL_ROOT_DIR) - -set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/include/Unix/x86_64-unknown-linux-gnu") -set(OPENSSL_CRYPTO_LIBRARY "${OPENSSL_ROOT_DIR}/lib/Unix/x86_64-unknown-linux-gnu/libcrypto.a") -set(OPENSSL_SSL_LIBRARY "${OPENSSL_ROOT_DIR}/lib/Unix/x86_64-unknown-linux-gnu/libssl.a") diff --git a/extern/vcpkg-overlays/openssl/libcrypto.pc.in b/extern/vcpkg-overlays/openssl/libcrypto.pc.in new file mode 100644 index 000000000..7fef482f6 --- /dev/null +++ b/extern/vcpkg-overlays/openssl/libcrypto.pc.in @@ -0,0 +1,11 @@ +prefix=${pcfiledir}/../.. +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include +Version: 3.2.1 +Name: OpenSSL-libcrypto +Description: OpenSSL cryptography library + + +Libs: "-L${libdir}" -llibcrypto +Cflags: -I"${includedir}" diff --git a/extern/vcpkg-overlays/openssl/libssl.pc.in b/extern/vcpkg-overlays/openssl/libssl.pc.in new file mode 100644 index 000000000..065fae7e1 --- /dev/null +++ b/extern/vcpkg-overlays/openssl/libssl.pc.in @@ -0,0 +1,12 @@ +prefix=${pcfiledir}/../.. +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include +Version: 3.2.1 +Name: OpenSSL-libssl +Description: Secure Sockets Layer and cryptography libraries + + +Libs: "-L${libdir}" -llibssl +Requires: libcrypto +Cflags: -I"${includedir}" diff --git a/extern/vcpkg-overlays/openssl/openssl.pc.in b/extern/vcpkg-overlays/openssl/openssl.pc.in new file mode 100644 index 000000000..d78cbb78f --- /dev/null +++ b/extern/vcpkg-overlays/openssl/openssl.pc.in @@ -0,0 +1,10 @@ +prefix=${pcfiledir}/../.. +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include +Version: 3.2.1 +Name: OpenSSL +Description: Secure Sockets Layer and cryptography libraries and tools + + +Requires: libssl libcrypto diff --git a/extern/vcpkg-overlays/openssl/portfile.cmake b/extern/vcpkg-overlays/openssl/portfile.cmake index 065116c27..77a5a755c 100644 --- a/extern/vcpkg-overlays/openssl/portfile.cmake +++ b/extern/vcpkg-overlays/openssl/portfile.cmake @@ -1 +1,49 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +message(STATUS "Using Unreal Engine installation at $ENV{UNREAL_ENGINE_ROOT}") + +# Some old versions of UE used to have multiple versions of OpenSSL, with different versions used on different platforms. +# That is no longer the case in UE 5.2, 5.3, and 5.4, but the below logic may need to change if that ever happens again. +set(OPENSSL_VERSIONS_DIR "$ENV{UNREAL_ENGINE_ROOT}/Engine/Source/ThirdParty/OpenSSL") +file(GLOB OPENSSL_POSSIBLE_ROOT_DIRS LIST_DIRECTORIES true "${OPENSSL_VERSIONS_DIR}/*") + +# Find the subdirectories, each of which should represent an OpenSSL version. +set(OPENSSL_VERSION_DIRS "") +foreach(OPENSSL_POSSIBLE_ROOT_DIR IN LISTS OPENSSL_POSSIBLE_ROOT_DIRS) + if(IS_DIRECTORY "${OPENSSL_POSSIBLE_ROOT_DIR}") + list(APPEND OPENSSL_VERSION_DIRS "${OPENSSL_POSSIBLE_ROOT_DIR}") + endif() +endforeach() + +# There should be exactly one version, otherwise we don't know what to do. +list(LENGTH OPENSSL_VERSION_DIRS OPENSSL_VERSION_DIRS_LENGTH) +if(NOT OPENSSL_VERSION_DIRS_LENGTH EQUAL 1) + message(FATAL_ERROR "Could not deduce the OpenSSL root directory because there is not exactly one directory matching `${OPENSSL_VERSIONS_DIR}/*`.") +endif() + +list(GET OPENSSL_VERSION_DIRS 0 OPENSSL_ROOT_DIR) + +if (VCPKG_TARGET_IS_ANDROID) +elseif (VCPKG_TARGET_IS_IOS) +elseif (VCPKG_TARGET_IS_OSX) +elseif (VCPKG_TARGET_IS_WINDOWS) +elseif (VCPKG_TARGET_IS_LINUX) + if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Unix/x86_64-unknown-linux-gnu") + set(OPENSSL_INCLUDE_PATH "${OPENSSL_ROOT_DIR}/include/Unix/x86_64-unknown-linux-gnu") + elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Unix/aarch64-unknown-linux-gnueabi") + set(OPENSSL_INCLUDE_PATH "${OPENSSL_ROOT_DIR}/include/Unix/aarch64-unknown-linux-gnueabi") + else() + message(FATAL_ERROR "Unknown Unreal / OpenSSL paths for Linux platform with architecture ${VCPKG_TARGET_ARCHITECTURE}.") + endif() +else() + message(FATAL_ERROR "Unknown Unreal / OpenSSL paths for VCPKG_CMAKE_SYSTEM_NAME ${VCPKG_CMAKE_SYSTEM_NAME}.") +endif() + +file(INSTALL "${OPENSSL_LIB_PATH}/" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") +file(INSTALL "${OPENSSL_INCLUDE_PATH}/" DESTINATION "${CURRENT_PACKAGES_DIR}/include") + +configure_file("${CMAKE_CURRENT_LIST_DIR}/libcrypto.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libcrypto.pc" @ONLY) +configure_file("${CMAKE_CURRENT_LIST_DIR}/libssl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libssl.pc" @ONLY) +configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/openssl.pc" @ONLY) diff --git a/extern/vcpkg-overlays/triplets/common.cmake b/extern/vcpkg-overlays/triplets/common.cmake new file mode 100644 index 000000000..9321729ca --- /dev/null +++ b/extern/vcpkg-overlays/triplets/common.cmake @@ -0,0 +1 @@ +set(VCPKG_ENV_PASSTHROUGH "UNREAL_ENGINE_ROOT") diff --git a/extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake index 582291768..eedfc6e1e 100644 --- a/extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake @@ -1,3 +1,5 @@ +include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") + set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) diff --git a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake index 5f6ba217d..f3255bd97 100644 --- a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake @@ -1,5 +1,8 @@ +include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") + set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CXX_FLAGS "/MD /Zp8") set(VCPKG_C_FLAGS "/MD /Zp8") +set(VCPKG_ENV_PASSTHROUGH "UNREAL_ENGINE_ROOT") From b73f00c93dfd97759c3fb10d80471b9d643fcfc9 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 11 Jun 2024 21:00:20 +1000 Subject: [PATCH 029/119] Add OpenSSL paths for other platforms. --- extern/vcpkg-overlays/openssl/portfile.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/extern/vcpkg-overlays/openssl/portfile.cmake b/extern/vcpkg-overlays/openssl/portfile.cmake index 77a5a755c..c467b8d27 100644 --- a/extern/vcpkg-overlays/openssl/portfile.cmake +++ b/extern/vcpkg-overlays/openssl/portfile.cmake @@ -24,9 +24,21 @@ endif() list(GET OPENSSL_VERSION_DIRS 0 OPENSSL_ROOT_DIR) if (VCPKG_TARGET_IS_ANDROID) + set(OPENSSL_INCLUDE_PATH "${OPENSSL_ROOT_DIR}/include/Android") + if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Android/x64") + elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Android/ARM64") + else() + message(FATAL_ERROR "Unknown Unreal / OpenSSL paths for Android platform with architecture ${VCPKG_TARGET_ARCHITECTURE}.") + endif() elseif (VCPKG_TARGET_IS_IOS) + message(FATAL_ERROR "TODO: Unreal / OpenSSL for iOS is not supported yet.") elseif (VCPKG_TARGET_IS_OSX) + message(FATAL_ERROR "TODO: Unreal / OpenSSL for macOS is not supported yet.") elseif (VCPKG_TARGET_IS_WINDOWS) + set(OPENSSL_INCLUDE_PATH "${OPENSSL_ROOT_DIR}/include/Win64/VS2015") + set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Win64/VS2015/Release") elseif (VCPKG_TARGET_IS_LINUX) if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Unix/x86_64-unknown-linux-gnu") From fdb6be61bc7fdcb34d3d534b3b9558c6112469f4 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 11 Jun 2024 21:08:11 +1000 Subject: [PATCH 030/119] Exclude libssl and libcrypto from CfUnreal build. --- Source/CesiumEditor/CesiumEditor.Build.cs | 4 ++++ Source/CesiumRuntime/CesiumRuntime.Build.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs index 793203499..9825d0c10 100644 --- a/Source/CesiumEditor/CesiumEditor.Build.cs +++ b/Source/CesiumEditor/CesiumEditor.Build.cs @@ -75,6 +75,10 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) string[] allLibs = Directory.GetFiles(libPath, libSearchPattern); + // Remove libssl and libcrypto because these come from Unreal Engine itself + // TODO: Exclude these from the cesium-native side instead of excluding them here. + allLibs = allLibs.Where(l => !l.Contains("libssl") && !l.Contains("libcrypto")).ToArray(); + PublicAdditionalLibraries.AddRange(allLibs); PublicDependencyModuleNames.AddRange( diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index 5db500886..f2044bc8b 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -75,6 +75,10 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) string[] allLibs = Directory.GetFiles(libPath, libSearchPattern); + // Remove libssl and libcrypto because these come from Unreal Engine itself + // TODO: Exclude these from the cesium-native side instead of excluding them here. + allLibs = allLibs.Where(l => !l.Contains("libssl") && !l.Contains("libcrypto")).ToArray(); + PublicAdditionalLibraries.AddRange(allLibs); PublicDependencyModuleNames.AddRange( From 9737a61ed458a8bd26445729e22fb0e2735c9a23 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 11 Jun 2024 21:20:56 +1000 Subject: [PATCH 031/119] Specify UNREAL_ENGINE_ROOT. --- .github/workflows/buildAndroid.yml | 15 ++++++++------- .github/workflows/buildLinux.yml | 6 +++--- .github/workflows/buildWindows.yml | 1 + 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index e84cd848e..1c734d80e 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -63,23 +63,24 @@ jobs: echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${ENV:BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $ENV:GITHUB_ENV - name: Install nasm uses: ilammy/setup-nasm@v1.5.1 + - name: Install Unreal Engine + uses: ./.github/actions/install-unreal-windows + with: + unreal-engine-zip: ${{ inputs.unreal-engine-zip }} + unreal-program-name: ${{ inputs.unreal-program-name }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Build cesium-native run: | # CMake gets confused by the Windows backslashes $env:ANDROID_NDK_ROOT=$env:ANDROID_NDK_ROOT.replace('\', '/') $env:ANDROID_NDK_HOME=$env:ANDROID_NDK_ROOT + $env:UNREAL_ENGINE_ROOT="D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}" cd extern cmake -B build-android -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-android-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release cmake --build build-android --config Release --target install -j8 cd .. rm -r -fo extern - - name: Install Unreal Engine - uses: ./.github/actions/install-unreal-windows - with: - unreal-engine-zip: ${{ inputs.unreal-engine-zip }} - unreal-program-name: ${{ inputs.unreal-program-name }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Overwrite plugin engine version run: | ((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.1.0"','"EngineVersion": "${{ inputs.unreal-engine-version }}"') | Set-Content -Path CesiumForUnreal.uplugin diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index 448cb2fcf..445e66566 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -63,12 +63,12 @@ jobs: run: | echo "CESIUM_UNREAL_VERSION=$GITHUB_REF_NAME" >> "$GITHUB_ENV" echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${{ inputs.upload-package-base-name }}-$GITHUB_REF_NAME" >> "$GITHUB_ENV" - echo "UNREAL_ENGINE_DIR=/mnt/work/${{ inputs.unreal-program-name }}" >> "$GITHUB_ENV" + echo "UNREAL_ENGINE_ROOT=/mnt/work/${{ inputs.unreal-program-name }}" >> "$GITHUB_ENV" echo "LINUX_MULTIARCH_ROOT=/mnt/work/${{ inputs.unreal-program-name }}/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/${{ inputs.clang-version }}/" >> "$GITHUB_ENV" - name: Build cesium-native run: | export UNREAL_ENGINE_COMPILER_DIR="${LINUX_MULTIARCH_ROOT}x86_64-unknown-linux-gnu" - export UNREAL_ENGINE_LIBCXX_DIR="${UNREAL_ENGINE_DIR}/Engine/Source/ThirdParty/Unix/LibCxx" + export UNREAL_ENGINE_LIBCXX_DIR="${UNREAL_ENGINE_ROOT}/Engine/Source/ThirdParty/Unix/LibCxx" cd extern cmake -B build -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-linux-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release cmake --build build --config Release --target install -j8 @@ -91,7 +91,7 @@ jobs: - name: Build plugin run: | sed -i 's/\"EngineVersion\": \"5.1.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin - cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles + cd $UNREAL_ENGINE_ROOT/Engine/Build/BatchFiles ./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Linux - name: Fix RPATH run: | diff --git a/.github/workflows/buildWindows.yml b/.github/workflows/buildWindows.yml index 87e383226..66261b33b 100644 --- a/.github/workflows/buildWindows.yml +++ b/.github/workflows/buildWindows.yml @@ -110,6 +110,7 @@ jobs: - name: Build cesium-native run: | cd extern + $env:UNREAL_ENGINE_ROOT="D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}" $toolchainOption=If ("${{ inputs.cmake-toolchain }}") {"-T ${{ inputs.cmake-toolchain }}"} Else {""} cmake -B build -S . -A "${{ inputs.cmake-platform }}" -G "${{ inputs.cmake-generator }}" $toolchainOption cmake --build build --config Release --target install -j8 From 727cdd5c4bc28ed922ad651be3f2a20e257ccee8 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 07:08:07 +1000 Subject: [PATCH 032/119] Fix Linux UE 5.3 / 5.4 build, hopefully. --- extern/vcpkg-overlays/openssl/portfile.cmake | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/extern/vcpkg-overlays/openssl/portfile.cmake b/extern/vcpkg-overlays/openssl/portfile.cmake index c467b8d27..b626ab17d 100644 --- a/extern/vcpkg-overlays/openssl/portfile.cmake +++ b/extern/vcpkg-overlays/openssl/portfile.cmake @@ -41,14 +41,22 @@ elseif (VCPKG_TARGET_IS_WINDOWS) set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Win64/VS2015/Release") elseif (VCPKG_TARGET_IS_LINUX) if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Unix/x86_64-unknown-linux-gnu") - set(OPENSSL_INCLUDE_PATH "${OPENSSL_ROOT_DIR}/include/Unix/x86_64-unknown-linux-gnu") + set(OPENSSL_PLATFORM "x86_64-unknown-linux-gnu") elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Unix/aarch64-unknown-linux-gnueabi") - set(OPENSSL_INCLUDE_PATH "${OPENSSL_ROOT_DIR}/include/Unix/aarch64-unknown-linux-gnueabi") + set(OPENSSL_PLATFORM "aarch64-unknown-linux-gnueabi") else() message(FATAL_ERROR "Unknown Unreal / OpenSSL paths for Linux platform with architecture ${VCPKG_TARGET_ARCHITECTURE}.") endif() + + set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Unix/${OPENSSL_PLATFORM}") + set(OPENSSL_INCLUDE_PATH "${OPENSSL_ROOT_DIR}/include/Unix") + + # UE 5.2 has a platform subdirectory under the OPENSSL_INCLUDE_PATH. + # UE 5.3 and 5.4 do not. Rather than check the UE version, we check for the existence of the + # openssl directory. + if (NOT EXISTS "${OPENSSL_INCLUDE_PATH}/openssl") + set(OPENSSL_INCLUDE_PATH "${OPENSSL_INCLUDE_PATH}/${OPENSSL_PLATFORM}") + endif() else() message(FATAL_ERROR "Unknown Unreal / OpenSSL paths for VCPKG_CMAKE_SYSTEM_NAME ${VCPKG_CMAKE_SYSTEM_NAME}.") endif() From 16903c5a2d431d00d6ba6205e42ff1e55de74137 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 07:45:02 +1000 Subject: [PATCH 033/119] Cache vcpkg on Linux, macOS, and iOS. --- .github/workflows/buildLinux.yml | 11 +++++++++++ .github/workflows/buildMac.yml | 11 +++++++++++ .github/workflows/buildiOS.yml | 11 +++++++++++ 3 files changed, 33 insertions(+) diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index 445e66566..ec96b3ce9 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -47,6 +47,17 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: /.ezvcpkg + key: vcpkg-linux-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 + restore-keys: | + vcpkg-linux-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 + vcpkg-linux-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} + vcpkg-linux-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} + vcpkg-linux-${{ inputs.unreal-engine-version }} + vcpkg-linux- - name: Install Unreal Engine uses: ./.github/actions/install-unreal-linux with: diff --git a/.github/workflows/buildMac.yml b/.github/workflows/buildMac.yml index 5756e2d6f..c3ac0bd46 100644 --- a/.github/workflows/buildMac.yml +++ b/.github/workflows/buildMac.yml @@ -44,6 +44,17 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: /.ezvcpkg + key: vcpkg-macos-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 + restore-keys: | + vcpkg-macos-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 + vcpkg-macos-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} + vcpkg-macos-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} + vcpkg-macos-${{ inputs.unreal-engine-version }} + vcpkg-macos- - name: Install Unreal Engine uses: ./.github/actions/install-unreal-macos with: diff --git a/.github/workflows/buildiOS.yml b/.github/workflows/buildiOS.yml index 846d8df99..4975e15b3 100644 --- a/.github/workflows/buildiOS.yml +++ b/.github/workflows/buildiOS.yml @@ -45,6 +45,17 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: /.ezvcpkg + key: vcpkg-ios-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 + restore-keys: | + vcpkg-ios-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 + vcpkg-ios-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} + vcpkg-ios-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} + vcpkg-ios-${{ inputs.unreal-engine-version }} + vcpkg-ios- - name: Set environment variables run: | export CESIUM_UNREAL_VERSION=$GITHUB_REF_NAME From 770eff7df473b123686a9d4a6d47ec7945676c65 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 09:27:18 +1000 Subject: [PATCH 034/119] First attempt at vcpkg on macOS. --- .github/workflows/buildMac.yml | 11 +++++------ Source/CesiumEditor/CesiumEditor.Build.cs | 2 +- Source/CesiumRuntime/CesiumRuntime.Build.cs | 2 +- extern/CMakeLists.txt | 8 +++++++- extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake | 2 ++ extern/vcpkg-overlays/triplets/osx-common.cmake | 4 ++++ extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake | 2 ++ 7 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake create mode 100644 extern/vcpkg-overlays/triplets/osx-common.cmake create mode 100644 extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake diff --git a/.github/workflows/buildMac.yml b/.github/workflows/buildMac.yml index c3ac0bd46..748df766e 100644 --- a/.github/workflows/buildMac.yml +++ b/.github/workflows/buildMac.yml @@ -75,18 +75,17 @@ jobs: run: | mkdir -p extern/build cd extern/build - INSTALL_LIBDIR=`cmake .. -LA | grep CMAKE_INSTALL_LIBDIR` - INSTALL_LIBDIR=${INSTALL_LIBDIR##CMAKE_INSTALL_LIBDIR:PATH=} + export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=arm64 cmake --build . -j4 --target install - mv $INSTALL_LIBDIR ${INSTALL_LIBDIR}-silicon cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 cmake --build . -j4 --target install - for f in ${INSTALL_LIBDIR}/*.a + for f in ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release/*.a do - lipo -create -output $f ${INSTALL_LIBDIR}-silicon/$(basename -- $f) $f + lipo -create -output $f ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-arm64-Release/$(basename -- $f) ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-universal-Release/$(basename -- $f) done - rm -r -f ${INSTALL_LIBDIR}-silicon + rm -r -f ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release + rm -r -f ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-arm64-Release cd ../.. rm -rf extern - name: Customize BuildConfiguration.xml diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs index 9825d0c10..5a4825d6d 100644 --- a/Source/CesiumEditor/CesiumEditor.Build.cs +++ b/Source/CesiumEditor/CesiumEditor.Build.cs @@ -35,7 +35,7 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) } else if (Target.Platform == UnrealTargetPlatform.Mac) { - platform = "Darwin-AMD64-"; + platform = "Darwin-universal-"; libSearchPattern = "lib*.a"; } else if (Target.Platform == UnrealTargetPlatform.Android) diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index f2044bc8b..3af64ed71 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -35,7 +35,7 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) } else if (Target.Platform == UnrealTargetPlatform.Mac) { - platform = "Darwin-AMD64-"; + platform = "Darwin-universal-"; libSearchPattern = "lib*.a"; } else if (Target.Platform == UnrealTargetPlatform.Android) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index faaf7d77c..794138cb8 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -11,7 +11,13 @@ if (DEFINED ENV{UNREAL_ENGINE_ROOT} AND NOT UNREAL_ENGINE_ROOT) endif() if (NOT UNREAL_ENGINE_ROOT) - message(FATAL_ERROR "Please specify the root of your Unreal Engine installation, either by setting the UNREAL_ENGINE_ROOT environment variable or with -DUNREAL_ENGINE_ROOT=path on the cmake command-line.") + # On Windows, try to use the default UE 5.2 location + set(WINDOWS_DEFAULT_UNREAL_INSTALLATION "C:/Program Files/Epic Games/UE_5.2") + if (WIN32 AND EXISTS "${WINDOWS_DEFAULT_UNREAL_INSTALLATION}") + set(UNREAL_ENGINE_ROOT "${WINDOWS_DEFAULT_UNREAL_INSTALLATION}") + else() + message(FATAL_ERROR "Please specify the root of your Unreal Engine installation, either by setting the UNREAL_ENGINE_ROOT environment variable or with -DUNREAL_ENGINE_ROOT=path on the cmake command-line.") + endif() endif() message(STATUS "Using Unreal Engine installation at: ${UNREAL_ENGINE_ROOT}") diff --git a/extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake new file mode 100644 index 000000000..50a907ab7 --- /dev/null +++ b/extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake @@ -0,0 +1,2 @@ +include("${CMAKE_CURRENT_LIST_DIR}/osx-common.cmake") +set(VCPKG_TARGET_ARCHITECTURE arm64) diff --git a/extern/vcpkg-overlays/triplets/osx-common.cmake b/extern/vcpkg-overlays/triplets/osx-common.cmake new file mode 100644 index 000000000..b72467b29 --- /dev/null +++ b/extern/vcpkg-overlays/triplets/osx-common.cmake @@ -0,0 +1,4 @@ +include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") + +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) diff --git a/extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake new file mode 100644 index 000000000..bc6a41d8c --- /dev/null +++ b/extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake @@ -0,0 +1,2 @@ +include("${CMAKE_CURRENT_LIST_DIR}/osx-common.cmake") +set(VCPKG_TARGET_ARCHITECTURE x64) From bc4ff80559c5b5b77121a742a97e7040f1c20357 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 11:57:13 +1000 Subject: [PATCH 035/119] Specify system name on macOS. --- extern/vcpkg-overlays/triplets/osx-common.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/extern/vcpkg-overlays/triplets/osx-common.cmake b/extern/vcpkg-overlays/triplets/osx-common.cmake index b72467b29..7ab4842dd 100644 --- a/extern/vcpkg-overlays/triplets/osx-common.cmake +++ b/extern/vcpkg-overlays/triplets/osx-common.cmake @@ -1,4 +1,5 @@ include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") +set(VCPKG_SYSTEM_NAME Darwin) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) From 139777d16fc731fa2297f81c71a87f16072e5bce Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 12:30:17 +1000 Subject: [PATCH 036/119] VCPKG_SYSTEM_NAME -> VCPKG_CMAKE_SYSTEM_NAME --- extern/vcpkg-overlays/triplets/osx-common.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/vcpkg-overlays/triplets/osx-common.cmake b/extern/vcpkg-overlays/triplets/osx-common.cmake index 7ab4842dd..3c6d53cfc 100644 --- a/extern/vcpkg-overlays/triplets/osx-common.cmake +++ b/extern/vcpkg-overlays/triplets/osx-common.cmake @@ -1,5 +1,5 @@ include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") -set(VCPKG_SYSTEM_NAME Darwin) +set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) From 4c5c5488d256ab37ba759450f34775b709ce35c0 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 13:07:10 +1000 Subject: [PATCH 037/119] Remove installation of msys2 during ktx build. This was causing build breakage because the repo.msys2.org URLs in the portfile.cmake are invalid (as of this writing). Also, they're not needed at all, at least for the way we use ktx. The library builds and installs just fine without. --- extern/vcpkg-overlays/ktx/portfile.cmake | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/extern/vcpkg-overlays/ktx/portfile.cmake b/extern/vcpkg-overlays/ktx/portfile.cmake index 79bd2c043..12b55650a 100644 --- a/extern/vcpkg-overlays/ktx/portfile.cmake +++ b/extern/vcpkg-overlays/ktx/portfile.cmake @@ -15,21 +15,21 @@ vcpkg_from_github( file(REMOVE "${SOURCE_PATH}/other_include/zstd_errors.h") vcpkg_list(SET OPTIONS) -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_acquire_msys(MSYS_ROOT - PACKAGES - bash - DIRECT_PACKAGES - # Required for "getopt" - "https://repo.msys2.org/msys/x86_64/util-linux-2.35.2-3-x86_64.pkg.tar.zst" - da26540881cd5734072717133307e5d1a27a60468d3656885507833b80f24088c5382eaa0234b30bdd9e8484a6638b4514623f5327f10b19eed36f12158e8edb - # Required for "dos2unix" - "https://mirror.msys2.org/msys/x86_64/dos2unix-7.5.1-1-x86_64.pkg.tar.zst" - 83d85e6ccea746ef9e8153a0d605e774dbe7efc0ee952804acfee4ffd7e3b0386a353b45ff989dd99bc3ce75968209fea3d246ad2af88bbb5c4eca12fc5a8f92 - ) - vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") - vcpkg_list(APPEND OPTIONS "-DBASH_EXECUTABLE=${MSYS_ROOT}/usr/bin/bash.exe") -endif() +# if(VCPKG_TARGET_IS_WINDOWS) +# vcpkg_acquire_msys(MSYS_ROOT +# PACKAGES +# bash +# DIRECT_PACKAGES +# # Required for "getopt" +# "https://repo.msys2.org/msys/x86_64/util-linux-2.35.2-3-x86_64.pkg.tar.zst" +# da26540881cd5734072717133307e5d1a27a60468d3656885507833b80f24088c5382eaa0234b30bdd9e8484a6638b4514623f5327f10b19eed36f12158e8edb +# # Required for "dos2unix" +# "https://mirror.msys2.org/msys/x86_64/dos2unix-7.5.1-1-x86_64.pkg.tar.zst" +# 83d85e6ccea746ef9e8153a0d605e774dbe7efc0ee952804acfee4ffd7e3b0386a353b45ff989dd99bc3ce75968209fea3d246ad2af88bbb5c4eca12fc5a8f92 +# ) +# vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") +# vcpkg_list(APPEND OPTIONS "-DBASH_EXECUTABLE=${MSYS_ROOT}/usr/bin/bash.exe") +# endif() string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC) From 66a58480d80ece8670c99e3c8d42baa13fac8177 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 13:17:22 +1000 Subject: [PATCH 038/119] UE OpenSSL paths on macOS / iOS. --- extern/vcpkg-overlays/openssl/portfile.cmake | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/extern/vcpkg-overlays/openssl/portfile.cmake b/extern/vcpkg-overlays/openssl/portfile.cmake index b626ab17d..144e296df 100644 --- a/extern/vcpkg-overlays/openssl/portfile.cmake +++ b/extern/vcpkg-overlays/openssl/portfile.cmake @@ -1,5 +1,18 @@ +# This port uses OpenSSL from Unreal Engine, instead of the normal vcpkg version. +# This is important for avoiding linker errors (multiply defined symbols) when +# building and packaging Unreal Engine games that include cesium-native. +# +# The environment variable `UNREAL_ENGINE_ROOT` must be set to the root of the +# Unreal Engine installation to use. It should use forward slashes even on Windows +# and it should _not_ end with a slash. +# For example: `C:/Program Files/Epic Games/UE_5.2` + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) +if (NOT DEFINED ENV{UNREAL_ENGINE_ROOT} + message(FATAL_ERROR "The environment variable `UNREAL_ENGINE_ROOT` must be defined.") +endif() + message(STATUS "Using Unreal Engine installation at $ENV{UNREAL_ENGINE_ROOT}") # Some old versions of UE used to have multiple versions of OpenSSL, with different versions used on different platforms. @@ -33,9 +46,11 @@ if (VCPKG_TARGET_IS_ANDROID) message(FATAL_ERROR "Unknown Unreal / OpenSSL paths for Android platform with architecture ${VCPKG_TARGET_ARCHITECTURE}.") endif() elseif (VCPKG_TARGET_IS_IOS) - message(FATAL_ERROR "TODO: Unreal / OpenSSL for iOS is not supported yet.") + set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/IOS") + set(OPENSSL_INCLUDE_PATH "${OPENSSL_ROOT_DIR}/include/IOS") elseif (VCPKG_TARGET_IS_OSX) - message(FATAL_ERROR "TODO: Unreal / OpenSSL for macOS is not supported yet.") + set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Mac") + set(OPENSSL_INCLUDE_PATH "${OPENSSL_ROOT_DIR}/include/Mac") elseif (VCPKG_TARGET_IS_WINDOWS) set(OPENSSL_INCLUDE_PATH "${OPENSSL_ROOT_DIR}/include/Win64/VS2015") set(OPENSSL_LIB_PATH "${OPENSSL_ROOT_DIR}/lib/Win64/VS2015/Release") From 1e5cf5cf6cfd6de69a080f6efb57c56927cde9fe Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 13:24:44 +1000 Subject: [PATCH 039/119] Add asyncplusplus overlay port. So far it is just a copy of the official vcpkg 2024.02.14 version. --- .../asyncplusplus/portfile.cmake | 21 +++++++++++++++++++ .../vcpkg-overlays/asyncplusplus/vcpkg.json | 18 ++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 extern/vcpkg-overlays/asyncplusplus/portfile.cmake create mode 100644 extern/vcpkg-overlays/asyncplusplus/vcpkg.json diff --git a/extern/vcpkg-overlays/asyncplusplus/portfile.cmake b/extern/vcpkg-overlays/asyncplusplus/portfile.cmake new file mode 100644 index 000000000..cd8bf8b61 --- /dev/null +++ b/extern/vcpkg-overlays/asyncplusplus/portfile.cmake @@ -0,0 +1,21 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Amanieu/asyncplusplus + REF 172ca3f8e0df1b3f7f5ee8b8244e4ac67258b0d8 # v1.1 + SHA512 fd95b3349ceed4cab5cb0e146d2ccfe77c85318303015cf513037fc69c1ade7cfdb3dc81de8a90846c4387c5e31f5a70a64da770547c201dfe24d2c181be1933 + HEAD_REF master +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH cmake PACKAGE_NAME async++) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/extern/vcpkg-overlays/asyncplusplus/vcpkg.json b/extern/vcpkg-overlays/asyncplusplus/vcpkg.json new file mode 100644 index 000000000..6b5977655 --- /dev/null +++ b/extern/vcpkg-overlays/asyncplusplus/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "asyncplusplus", + "version": "1.1", + "port-version": 2, + "description": "Async++ is a lightweight concurrency framework for C++11", + "license": "MIT", + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} From d5bb5752e1611d10a4114d862e8d627578eed0c8 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 13:32:23 +1000 Subject: [PATCH 040/119] Use a version of Async++ with a required fix for C++20 support. Specifically this fix: https://github.com/Amanieu/asyncplusplus/pull/47 Unfortunately, 2.5 years later, a new official version including that fix still hasn't been released. --- extern/vcpkg-overlays/asyncplusplus/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extern/vcpkg-overlays/asyncplusplus/portfile.cmake b/extern/vcpkg-overlays/asyncplusplus/portfile.cmake index cd8bf8b61..54b343b25 100644 --- a/extern/vcpkg-overlays/asyncplusplus/portfile.cmake +++ b/extern/vcpkg-overlays/asyncplusplus/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Amanieu/asyncplusplus - REF 172ca3f8e0df1b3f7f5ee8b8244e4ac67258b0d8 # v1.1 - SHA512 fd95b3349ceed4cab5cb0e146d2ccfe77c85318303015cf513037fc69c1ade7cfdb3dc81de8a90846c4387c5e31f5a70a64da770547c201dfe24d2c181be1933 + REF 4159da79e20ad6d0eb1f13baa0f10e989edd9fba + SHA512 a7b099ce24184aa56e843d4858228196f8220374585a375a9c0d944832bd68c8aabd6b2efde5aacbb9c73f9dd8e942e97262be04550205b3fbea44d8b972d78e HEAD_REF master ) From 610bbddf9e6de60cb808941b1ed880a1b1146c76 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 14:01:52 +1000 Subject: [PATCH 041/119] Fix typo. --- extern/vcpkg-overlays/openssl/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/vcpkg-overlays/openssl/portfile.cmake b/extern/vcpkg-overlays/openssl/portfile.cmake index 144e296df..def5db6a0 100644 --- a/extern/vcpkg-overlays/openssl/portfile.cmake +++ b/extern/vcpkg-overlays/openssl/portfile.cmake @@ -9,7 +9,7 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled) -if (NOT DEFINED ENV{UNREAL_ENGINE_ROOT} +if (NOT DEFINED ENV{UNREAL_ENGINE_ROOT}) message(FATAL_ERROR "The environment variable `UNREAL_ENGINE_ROOT` must be defined.") endif() From 0268d89b9f761550cfb748fee65740aff44e5550 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 15:14:25 +1000 Subject: [PATCH 042/119] Better macOS CPU architecture selection. --- extern/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 794138cb8..1b158a375 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -111,11 +111,7 @@ set(ENV{VCPKG_OVERLAY_TRIPLETS} "${CMAKE_CURRENT_LIST_DIR}/vcpkg-overlays/triple if(WIN32) set(VCPKG_TRIPLET "x64-windows-unreal") elseif(CMAKE_HOST_APPLE) - if (CMAKE_APPLE_SILICON_PROCESSOR STREQUAL "arm64") - set(VCPKG_TRIPLET "arm64-osx-unreal") - else() - set(VCPKG_TRIPLET "x64-osx-unreal") - endif() + set(VCPKG_TRIPLET "${CMAKE_OSX_ARCHITECTURES}-osx-unreal") elseif(CMAKE_HOST_LINUX) set(VCPKG_TRIPLET "x64-linux-unreal") endif() From f07c2377c775e11c8ac25ecad546e65bcaa7f31b Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 15:20:53 +1000 Subject: [PATCH 043/119] Better CPU arch selection, attempt universal (not optimistic). --- extern/CMakeLists.txt | 7 ++++++- extern/vcpkg-overlays/triplets/universal-osx-unreal.cmake | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 extern/vcpkg-overlays/triplets/universal-osx-unreal.cmake diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 1b158a375..a5be4f3b9 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -111,7 +111,12 @@ set(ENV{VCPKG_OVERLAY_TRIPLETS} "${CMAKE_CURRENT_LIST_DIR}/vcpkg-overlays/triple if(WIN32) set(VCPKG_TRIPLET "x64-windows-unreal") elseif(CMAKE_HOST_APPLE) - set(VCPKG_TRIPLET "${CMAKE_OSX_ARCHITECTURES}-osx-unreal") + list(LENGTH CMAKE_OSX_ARCHITECTURES CMAKE_OSX_ARCHITECTURES_COUNT) + if(CMAKE_OSX_ARCHITECTURES_COUNT GREATER 1) + set(VCPKG_TRIPLET "universal-osx-unreal") + else() + set(VCPKG_TRIPLET "${CMAKE_OSX_ARCHITECTURES}-osx-unreal") + endif() elseif(CMAKE_HOST_LINUX) set(VCPKG_TRIPLET "x64-linux-unreal") endif() diff --git a/extern/vcpkg-overlays/triplets/universal-osx-unreal.cmake b/extern/vcpkg-overlays/triplets/universal-osx-unreal.cmake new file mode 100644 index 000000000..5a865d4e5 --- /dev/null +++ b/extern/vcpkg-overlays/triplets/universal-osx-unreal.cmake @@ -0,0 +1,2 @@ +include("${CMAKE_CURRENT_LIST_DIR}/osx-common.cmake") +set(VCPKG_OSX_ARCHITECTURES "arm64;x86_x64") From 6321d1c7dd399cbad003cb3f1e9e39a27982a63a Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 16:03:14 +1000 Subject: [PATCH 044/119] Improve vcpkg caching on CI. Use a hash of the vcpkg.json files in vcpkg-overlays to completely invalidate the cache, because otherwise vcpkg will never pick up any changes. --- .github/actions/vcpkg-cache/action.yml | 12 ++++++++++++ .github/workflows/buildAndroid.yml | 13 ++----------- .github/workflows/buildLinux.yml | 13 ++----------- .github/workflows/buildMac.yml | 13 ++----------- .github/workflows/buildWindows.yml | 13 ++----------- .github/workflows/buildiOS.yml | 13 ++----------- 6 files changed, 22 insertions(+), 55 deletions(-) create mode 100644 .github/actions/vcpkg-cache/action.yml diff --git a/.github/actions/vcpkg-cache/action.yml b/.github/actions/vcpkg-cache/action.yml new file mode 100644 index 000000000..9d324dc36 --- /dev/null +++ b/.github/actions/vcpkg-cache/action.yml @@ -0,0 +1,12 @@ +name: Configure vcpkg caching +runs: + using: composite + steps: + - name: Cache vcpkg artifacts + uses: actions/cache@v4 + with: + path: /.ezvcpkg + key: vcpkg-${{ github.job }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} + restore-keys: | + vcpkg-${{ github.job }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} + vcpkg-${{ github.job }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}- diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index 1c734d80e..5e17e420c 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -43,17 +43,8 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - - name: Cache vcpkg artifacts - uses: actions/cache@v4 - with: - path: /.ezvcpkg - key: vcpkg-android-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - restore-keys: | - vcpkg-android-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - vcpkg-android-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} - vcpkg-android-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} - vcpkg-android-${{ inputs.unreal-engine-version }} - vcpkg-android- + - name: Configure vcpkg caching + uses: ./.github/actions/vcpkg-cache - name: Set environment variables run: | $env:CESIUM_UNREAL_VERSION=$env:GITHUB_REF_NAME diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index ec96b3ce9..6bc15f6ec 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -47,17 +47,8 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - - name: Cache vcpkg artifacts - uses: actions/cache@v4 - with: - path: /.ezvcpkg - key: vcpkg-linux-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - restore-keys: | - vcpkg-linux-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - vcpkg-linux-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} - vcpkg-linux-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} - vcpkg-linux-${{ inputs.unreal-engine-version }} - vcpkg-linux- + - name: Configure vcpkg caching + uses: ./.github/actions/vcpkg-cache - name: Install Unreal Engine uses: ./.github/actions/install-unreal-linux with: diff --git a/.github/workflows/buildMac.yml b/.github/workflows/buildMac.yml index 748df766e..917e97bbd 100644 --- a/.github/workflows/buildMac.yml +++ b/.github/workflows/buildMac.yml @@ -44,17 +44,8 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - - name: Cache vcpkg artifacts - uses: actions/cache@v4 - with: - path: /.ezvcpkg - key: vcpkg-macos-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - restore-keys: | - vcpkg-macos-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - vcpkg-macos-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} - vcpkg-macos-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} - vcpkg-macos-${{ inputs.unreal-engine-version }} - vcpkg-macos- + - name: Configure vcpkg caching + uses: ./.github/actions/vcpkg-cache - name: Install Unreal Engine uses: ./.github/actions/install-unreal-macos with: diff --git a/.github/workflows/buildWindows.yml b/.github/workflows/buildWindows.yml index 66261b33b..c3f34cb24 100644 --- a/.github/workflows/buildWindows.yml +++ b/.github/workflows/buildWindows.yml @@ -69,17 +69,8 @@ jobs: if: ${{ inputs.extra-choco-packages }} run: | choco install -y ${{ inputs.extra-choco-packages }} - - name: Cache vcpkg artifacts - uses: actions/cache@v4 - with: - path: /.ezvcpkg - key: vcpkg-windows-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - restore-keys: | - vcpkg-windows-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - vcpkg-windows-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} - vcpkg-windows-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} - vcpkg-windows-${{ inputs.unreal-engine-version }} - vcpkg-windows- + - name: Configure vcpkg caching + uses: ./.github/actions/vcpkg-cache - name: Set environment variables run: | $env:CESIUM_UNREAL_VERSION=$env:GITHUB_REF_NAME diff --git a/.github/workflows/buildiOS.yml b/.github/workflows/buildiOS.yml index 4975e15b3..aec28c2a6 100644 --- a/.github/workflows/buildiOS.yml +++ b/.github/workflows/buildiOS.yml @@ -45,17 +45,8 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - - name: Cache vcpkg artifacts - uses: actions/cache@v4 - with: - path: /.ezvcpkg - key: vcpkg-ios-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - restore-keys: | - vcpkg-ios-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }}-1 - vcpkg-ios-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }}-${{ hashFiles('extern/CMakeLists.txt') }} - vcpkg-ios-${{ inputs.unreal-engine-version }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt') }} - vcpkg-ios-${{ inputs.unreal-engine-version }} - vcpkg-ios- + - name: Configure vcpkg caching + uses: ./.github/actions/vcpkg-cache - name: Set environment variables run: | export CESIUM_UNREAL_VERSION=$GITHUB_REF_NAME From 912eefdad09f862e4b95e3e8c26d3aa9b9ae2777 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 17:02:09 +1000 Subject: [PATCH 045/119] Android triplet. --- extern/CMakeLists.txt | 36 ++++++++++++++----- .../triplets/arm64-android-unreal.cmake | 7 ++++ 2 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index a5be4f3b9..2a949b7c0 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -108,17 +108,35 @@ endif() set(ENV{VCPKG_OVERLAY_PORTS} "${CMAKE_CURRENT_LIST_DIR}/vcpkg-overlays") set(ENV{VCPKG_OVERLAY_TRIPLETS} "${CMAKE_CURRENT_LIST_DIR}/vcpkg-overlays/triplets") -if(WIN32) - set(VCPKG_TRIPLET "x64-windows-unreal") -elseif(CMAKE_HOST_APPLE) - list(LENGTH CMAKE_OSX_ARCHITECTURES CMAKE_OSX_ARCHITECTURES_COUNT) - if(CMAKE_OSX_ARCHITECTURES_COUNT GREATER 1) - set(VCPKG_TRIPLET "universal-osx-unreal") +if (NOT VCPKG_TRIPLET) + if(DEFINED ENV{VCPKG_TRIPLET}) + set(VCPKG_TRIPLET $ENV{VCPKG_TRIPLET}) + elseif (CMAKE_HOST_WIN32) + set(VCPKG_TRIPLET "x64-windows") + elseif(CMAKE_HOST_APPLE) + list(LENGTH CMAKE_OSX_ARCHITECTURES CMAKE_OSX_ARCHITECTURES_COUNT) + if(CMAKE_OSX_ARCHITECTURES_COUNT GREATER 1) + set(VCPKG_TRIPLET "universal-osx") + else() + set(VCPKG_TRIPLET "${CMAKE_OSX_ARCHITECTURES}-osx") + endif() + elseif(CMAKE_HOST_LINUX) + set(VCPKG_TRIPLET "x64-linux") else() - set(VCPKG_TRIPLET "${CMAKE_OSX_ARCHITECTURES}-osx-unreal") + message(FATAL_ERROR "Cannot guess an appropriate value for VCPKG_TRIPLET because the operating system is unknown. Please set it manually.") endif() -elseif(CMAKE_HOST_LINUX) - set(VCPKG_TRIPLET "x64-linux-unreal") + + set(VCPKG_HOST_TRIPLET "${VCPKG_TRIPLET}") + + if(ANDROID OR IOS) + if(ANDROID) + set(VCPKG_TRIPLET "arm64-android") + else() + set(VCPKG_TRIPLET "arm64-ios") + endif() + endif() + + set(VCPKG_TRIPLET "${VCPKG_TRIPLET}-unreal") endif() add_subdirectory(cesium-native) diff --git a/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake new file mode 100644 index 000000000..728425b65 --- /dev/null +++ b/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake @@ -0,0 +1,7 @@ +include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME Android) +set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/../../unreal-android-toolchain.cmake) +set(VCPKG_ENV_PASSTHROUGH "${VCPKG_ENV_PASSTHROUGH};ANDROID_NDK_ROOT") From 2a60eaa63b68e29691c63ad332e6335f700c17f5 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 17:21:51 +1000 Subject: [PATCH 046/119] Pass cache ID explicitly. Since it doesn't appear to be possible to get the caller job id from a called workflow. --- .github/actions/vcpkg-cache/action.yml | 10 +++++++--- .github/workflows/buildAndroid.yml | 2 ++ .github/workflows/buildLinux.yml | 2 ++ .github/workflows/buildMac.yml | 2 ++ .github/workflows/buildWindows.yml | 2 ++ .github/workflows/buildiOS.yml | 2 ++ 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/actions/vcpkg-cache/action.yml b/.github/actions/vcpkg-cache/action.yml index 9d324dc36..b63785d7b 100644 --- a/.github/actions/vcpkg-cache/action.yml +++ b/.github/actions/vcpkg-cache/action.yml @@ -1,4 +1,8 @@ name: Configure vcpkg caching +inputs: + id: + required: true + type: string runs: using: composite steps: @@ -6,7 +10,7 @@ runs: uses: actions/cache@v4 with: path: /.ezvcpkg - key: vcpkg-${{ github.job }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} + key: vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} restore-keys: | - vcpkg-${{ github.job }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} - vcpkg-${{ github.job }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}- + vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} + vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}- diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index 5e17e420c..55d7f0dc5 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -45,6 +45,8 @@ jobs: submodules: recursive - name: Configure vcpkg caching uses: ./.github/actions/vcpkg-cache + with: + id: ${{ inputs.upload-package-base-name }} - name: Set environment variables run: | $env:CESIUM_UNREAL_VERSION=$env:GITHUB_REF_NAME diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index 6bc15f6ec..775189c22 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -49,6 +49,8 @@ jobs: submodules: recursive - name: Configure vcpkg caching uses: ./.github/actions/vcpkg-cache + with: + id: ${{ inputs.upload-package-base-name }} - name: Install Unreal Engine uses: ./.github/actions/install-unreal-linux with: diff --git a/.github/workflows/buildMac.yml b/.github/workflows/buildMac.yml index 917e97bbd..53038a704 100644 --- a/.github/workflows/buildMac.yml +++ b/.github/workflows/buildMac.yml @@ -46,6 +46,8 @@ jobs: submodules: recursive - name: Configure vcpkg caching uses: ./.github/actions/vcpkg-cache + with: + id: ${{ inputs.upload-package-base-name }} - name: Install Unreal Engine uses: ./.github/actions/install-unreal-macos with: diff --git a/.github/workflows/buildWindows.yml b/.github/workflows/buildWindows.yml index c3f34cb24..107e45511 100644 --- a/.github/workflows/buildWindows.yml +++ b/.github/workflows/buildWindows.yml @@ -71,6 +71,8 @@ jobs: choco install -y ${{ inputs.extra-choco-packages }} - name: Configure vcpkg caching uses: ./.github/actions/vcpkg-cache + with: + id: ${{ inputs.upload-package-base-name }} - name: Set environment variables run: | $env:CESIUM_UNREAL_VERSION=$env:GITHUB_REF_NAME diff --git a/.github/workflows/buildiOS.yml b/.github/workflows/buildiOS.yml index aec28c2a6..4e66a32f2 100644 --- a/.github/workflows/buildiOS.yml +++ b/.github/workflows/buildiOS.yml @@ -47,6 +47,8 @@ jobs: submodules: recursive - name: Configure vcpkg caching uses: ./.github/actions/vcpkg-cache + with: + id: ${{ inputs.upload-package-base-name }} - name: Set environment variables run: | export CESIUM_UNREAL_VERSION=$GITHUB_REF_NAME From c81df698371ddab2b3ec6f432ef8620c55efb6d0 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 17:25:13 +1000 Subject: [PATCH 047/119] Remove redundant restore-key. --- .github/actions/vcpkg-cache/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/vcpkg-cache/action.yml b/.github/actions/vcpkg-cache/action.yml index b63785d7b..f85591288 100644 --- a/.github/actions/vcpkg-cache/action.yml +++ b/.github/actions/vcpkg-cache/action.yml @@ -12,5 +12,4 @@ runs: path: /.ezvcpkg key: vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} restore-keys: | - vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}- From b85c2cafdc55a8930929ce11d1570b0a5c56c33d Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 17:48:14 +1000 Subject: [PATCH 048/119] Flesh out android triplet. --- extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake index 728425b65..7c8cb6781 100644 --- a/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake @@ -1,7 +1,11 @@ include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") + set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME Android) +set(VCPKG_MAKE_BUILD_TRIPLET "--host=aarch64-linux-android") +set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=arm64-v8a) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/../../unreal-android-toolchain.cmake) set(VCPKG_ENV_PASSTHROUGH "${VCPKG_ENV_PASSTHROUGH};ANDROID_NDK_ROOT") From 9b1447ee51e40e190f8436a2b934ab2fdef95060 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 18:04:23 +1000 Subject: [PATCH 049/119] libwebp inexplicably requires ANDROID_NDK to be set. --- extern/unreal-android-toolchain.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/extern/unreal-android-toolchain.cmake b/extern/unreal-android-toolchain.cmake index 05c22af59..86b7c6159 100644 --- a/extern/unreal-android-toolchain.cmake +++ b/extern/unreal-android-toolchain.cmake @@ -3,6 +3,7 @@ SET(CMAKE_SYSTEM_VERSION 21) SET(CMAKE_ANDROID_ARCH_ABI arm64-v8a) SET(CMAKE_ANDROID_NDK "$ENV{ANDROID_NDK_ROOT}") +SET(ANDROID_NDK "$ENV{ANDROID_NDK_ROOT}") SET(CMAKE_ANDROID_STL_TYPE c++_shared) # search for programs in the build host directories From 818199ec5f9df0f80b852ce8dd236ee7faafad63 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 18:11:10 +1000 Subject: [PATCH 050/119] Maybe better without an explicit android toolchain. --- extern/unreal-android-toolchain.cmake | 1 - extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/extern/unreal-android-toolchain.cmake b/extern/unreal-android-toolchain.cmake index 86b7c6159..05c22af59 100644 --- a/extern/unreal-android-toolchain.cmake +++ b/extern/unreal-android-toolchain.cmake @@ -3,7 +3,6 @@ SET(CMAKE_SYSTEM_VERSION 21) SET(CMAKE_ANDROID_ARCH_ABI arm64-v8a) SET(CMAKE_ANDROID_NDK "$ENV{ANDROID_NDK_ROOT}") -SET(ANDROID_NDK "$ENV{ANDROID_NDK_ROOT}") SET(CMAKE_ANDROID_STL_TYPE c++_shared) # search for programs in the build host directories diff --git a/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake index 7c8cb6781..a45ceed20 100644 --- a/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake @@ -6,6 +6,4 @@ set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME Android) set(VCPKG_MAKE_BUILD_TRIPLET "--host=aarch64-linux-android") set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=arm64-v8a) - -set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/../../unreal-android-toolchain.cmake) -set(VCPKG_ENV_PASSTHROUGH "${VCPKG_ENV_PASSTHROUGH};ANDROID_NDK_ROOT") +set(VCPKG_CMAKE_SYSTEM_VERSION 21) From 8a83611b8c1d91c8bc71b63a38ae2be3db87be81 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 19:22:02 +1000 Subject: [PATCH 051/119] Update cesium-native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index da9514e28..20afe091e 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit da9514e280c9e98d07741d23a42532a44a31bc6f +Subproject commit 20afe091ee60c0a33a932ac421a6c9e01a6ce948 From c1e5fa4cd900ab358b7f353a1afeb0a91a75b919 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 20:51:05 +1000 Subject: [PATCH 052/119] Specify VCPKG_OSX_ARCHITECTURES in macOS triplets. --- extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake | 1 + extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake | 1 + 2 files changed, 2 insertions(+) diff --git a/extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake index 50a907ab7..40c1e1ffc 100644 --- a/extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake @@ -1,2 +1,3 @@ include("${CMAKE_CURRENT_LIST_DIR}/osx-common.cmake") set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_OSX_ARCHITECTURES arm64) diff --git a/extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake index bc6a41d8c..4c8f98dc0 100644 --- a/extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake @@ -1,2 +1,3 @@ include("${CMAKE_CURRENT_LIST_DIR}/osx-common.cmake") set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_OSX_ARCHITECTURES x86_64) From 6b1e2248ba7b4e989391c4a973a483a001728b76 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 20:53:25 +1000 Subject: [PATCH 053/119] Specify UNREAL_ENGINE_ROOT on iOS. --- .github/workflows/buildiOS.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/buildiOS.yml b/.github/workflows/buildiOS.yml index 4e66a32f2..5a96f2a8c 100644 --- a/.github/workflows/buildiOS.yml +++ b/.github/workflows/buildiOS.yml @@ -69,6 +69,7 @@ jobs: run: | mkdir -p extern/build-ios cd extern + export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} cmake -B build-ios -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=15 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release cmake --build build-ios -j4 --target install --config Release cd .. From f2c1701d67225fd1371abb7f2d6c9cdfc20945d7 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 21:29:09 +1000 Subject: [PATCH 054/119] Add arm64-ios-unreal triplet. --- extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake diff --git a/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake new file mode 100644 index 000000000..dcbc72de6 --- /dev/null +++ b/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake @@ -0,0 +1,6 @@ +include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") + +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME iOS) From 33acbc53d3e534f8209cd96b0300138054a273b4 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 12 Jun 2024 21:45:12 +1000 Subject: [PATCH 055/119] Set CMAKE_SYSTEM_PROCESSOR on macOS. --- .github/workflows/buildMac.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildMac.yml b/.github/workflows/buildMac.yml index 53038a704..c279533cd 100644 --- a/.github/workflows/buildMac.yml +++ b/.github/workflows/buildMac.yml @@ -69,9 +69,9 @@ jobs: mkdir -p extern/build cd extern/build export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=arm64 + cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_SYSTEM_PROCESSOR=arm64 cmake --build . -j4 --target install - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 + cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_PROCESSOR=x86_64 cmake --build . -j4 --target install for f in ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release/*.a do From 12a8723c115c8000f93faed1c039345150771d0d Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 13 Jun 2024 07:57:11 +1000 Subject: [PATCH 056/119] Another go at robust VCPKG_TRIPLET detection logic. --- extern/CMakeLists.txt | 33 +++++++-------------------------- extern/cesium-native | 2 +- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 2a949b7c0..b91ab9ff2 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -108,35 +108,16 @@ endif() set(ENV{VCPKG_OVERLAY_PORTS} "${CMAKE_CURRENT_LIST_DIR}/vcpkg-overlays") set(ENV{VCPKG_OVERLAY_TRIPLETS} "${CMAKE_CURRENT_LIST_DIR}/vcpkg-overlays/triplets") +include(${CMAKE_CURRENT_SOURCE_DIR}/cesium-native/cmake/detect-vcpkg-triplet.cmake) + if (NOT VCPKG_TRIPLET) - if(DEFINED ENV{VCPKG_TRIPLET}) - set(VCPKG_TRIPLET $ENV{VCPKG_TRIPLET}) - elseif (CMAKE_HOST_WIN32) - set(VCPKG_TRIPLET "x64-windows") - elseif(CMAKE_HOST_APPLE) - list(LENGTH CMAKE_OSX_ARCHITECTURES CMAKE_OSX_ARCHITECTURES_COUNT) - if(CMAKE_OSX_ARCHITECTURES_COUNT GREATER 1) - set(VCPKG_TRIPLET "universal-osx") - else() - set(VCPKG_TRIPLET "${CMAKE_OSX_ARCHITECTURES}-osx") - endif() - elseif(CMAKE_HOST_LINUX) - set(VCPKG_TRIPLET "x64-linux") + if (DEFINED ENV{VCPKG_TRIPLET}) + set(VCPKG_TRIPLET "$ENV{VCPKG_TRIPLET}") + elseif(DETECTED_VCPKG_TRIPLET_ERROR) + message(FATAL_ERROR "${DETECTED_VCPKG_TRIPLET_ERROR}") else() - message(FATAL_ERROR "Cannot guess an appropriate value for VCPKG_TRIPLET because the operating system is unknown. Please set it manually.") + set(VCPKG_TRIPLET "${DETECTED_VCPKG_TRIPLET}-unreal") endif() - - set(VCPKG_HOST_TRIPLET "${VCPKG_TRIPLET}") - - if(ANDROID OR IOS) - if(ANDROID) - set(VCPKG_TRIPLET "arm64-android") - else() - set(VCPKG_TRIPLET "arm64-ios") - endif() - endif() - - set(VCPKG_TRIPLET "${VCPKG_TRIPLET}-unreal") endif() add_subdirectory(cesium-native) diff --git a/extern/cesium-native b/extern/cesium-native index 20afe091e..f21014a37 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 20afe091ee60c0a33a932ac421a6c9e01a6ce948 +Subproject commit f21014a3755b8d51c89c0fea16708973ca37b83c From bca5167415527d3a8e929106fcd815ca4e776a9e Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 13 Jun 2024 08:13:12 +1000 Subject: [PATCH 057/119] Use toolchain file on iOS, flesh out iOS triplet. --- .github/workflows/buildiOS.yml | 2 +- extern/unreal-ios-toolchain.cmake | 1 + extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildiOS.yml b/.github/workflows/buildiOS.yml index 5a96f2a8c..0865e3ca9 100644 --- a/.github/workflows/buildiOS.yml +++ b/.github/workflows/buildiOS.yml @@ -70,7 +70,7 @@ jobs: mkdir -p extern/build-ios cd extern export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} - cmake -B build-ios -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=15 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release + cmake -B build-ios -S . -GXcode -DCMAKE_TOOLCHAIN_FILE="unreal-ios-toolchain.cmake" -DCMAKE_BUILD_TYPE=Release cmake --build build-ios -j4 --target install --config Release cd .. rm -rf extern diff --git a/extern/unreal-ios-toolchain.cmake b/extern/unreal-ios-toolchain.cmake index 5db525d6b..68ed150bf 100644 --- a/extern/unreal-ios-toolchain.cmake +++ b/extern/unreal-ios-toolchain.cmake @@ -1,5 +1,6 @@ set(GENERATOR Xcode) set(CMAKE_SYSTEM_NAME iOS) set(CMAKE_OSX_ARCHITECTURES arm64) +set(CMAKE_OSX_DEPLOYMENT_TARGET 15) set(CMAKE_POSITION_INDEPENDENT_CODE ON) SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) diff --git a/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake index dcbc72de6..be13201c2 100644 --- a/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake @@ -4,3 +4,4 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME iOS) +set(VCPKG_OSX_DEPLOYMENT_TARGET 15) From 1cb60fcd7af975ec12e0055b958fe5e223aa5887 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 13 Jun 2024 08:54:22 +1000 Subject: [PATCH 058/119] Don't try to set properties on non-existent target. --- extern/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index b91ab9ff2..967d912ed 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -135,11 +135,6 @@ if (ANDROID OR IOS) LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mikktspace ) - - if (IOS) - # ktx tags itself as a FRAMEWORK on iOS, which causes linker errors. Undo that. - set_target_properties(ktx PROPERTIES FRAMEWORK FALSE) - endif() endif() option(BUILD_SHARED_LIB OFF) From b7a67b15c187559de440b6d6ffb0a688c7cf6f7a Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 13 Jun 2024 09:35:15 +1000 Subject: [PATCH 059/119] Specify CMAKE_SYSTEM_NAME=Darwin when building on macOS. This should be the default, but apparently when this is _not_ provided, CMake helpfully ignores the CMAKE_SYSTEM_PROCESSOR=arm64 that _is_ specified on the command line. At least according to: https://stackoverflow.com/questions/61893309/cmake-system-processor-value-in-toolchain-file-not-visible-in-top-level-cmakelis --- .github/workflows/buildMac.yml | 4 ++-- extern/cesium-native | 2 +- extern/vcpkg-overlays/triplets/osx-common.cmake | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/buildMac.yml b/.github/workflows/buildMac.yml index c279533cd..b844bce75 100644 --- a/.github/workflows/buildMac.yml +++ b/.github/workflows/buildMac.yml @@ -69,9 +69,9 @@ jobs: mkdir -p extern/build cd extern/build export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_SYSTEM_PROCESSOR=arm64 + cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=arm64 cmake --build . -j4 --target install - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_PROCESSOR=x86_64 + cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=x86_64 cmake --build . -j4 --target install for f in ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release/*.a do diff --git a/extern/cesium-native b/extern/cesium-native index f21014a37..44987e806 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit f21014a3755b8d51c89c0fea16708973ca37b83c +Subproject commit 44987e806f6f9f90db9ca38da4a8450bac6c539d diff --git a/extern/vcpkg-overlays/triplets/osx-common.cmake b/extern/vcpkg-overlays/triplets/osx-common.cmake index 3c6d53cfc..177e0c1aa 100644 --- a/extern/vcpkg-overlays/triplets/osx-common.cmake +++ b/extern/vcpkg-overlays/triplets/osx-common.cmake @@ -3,3 +3,4 @@ include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15) From bf6da8e42d1690963268989e19957d1f0a41e0d0 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 13 Jun 2024 09:54:11 +1000 Subject: [PATCH 060/119] Don't let ktx be a framework on iOS. --- .../ktx/CESIUM-0002-not-a-framework.patch | 17 +++++++++++++++++ extern/vcpkg-overlays/ktx/portfile.cmake | 1 + 2 files changed, 18 insertions(+) create mode 100644 extern/vcpkg-overlays/ktx/CESIUM-0002-not-a-framework.patch diff --git a/extern/vcpkg-overlays/ktx/CESIUM-0002-not-a-framework.patch b/extern/vcpkg-overlays/ktx/CESIUM-0002-not-a-framework.patch new file mode 100644 index 000000000..4458110f4 --- /dev/null +++ b/extern/vcpkg-overlays/ktx/CESIUM-0002-not-a-framework.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7b13753..b62b849 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -474,9 +474,9 @@ macro(common_libktx_settings target enable_write library_type) + + ) + if(IOS) +- set_target_properties(${target} PROPERTIES +- FRAMEWORK TRUE +- ) ++# set_target_properties(${target} PROPERTIES ++# FRAMEWORK TRUE ++# ) + endif() + + if( NOT ${library_type} STREQUAL STATIC ) diff --git a/extern/vcpkg-overlays/ktx/portfile.cmake b/extern/vcpkg-overlays/ktx/portfile.cmake index 12b55650a..5cd081b44 100644 --- a/extern/vcpkg-overlays/ktx/portfile.cmake +++ b/extern/vcpkg-overlays/ktx/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_from_github( 0004-quirks.patch 0005-no-vendored-libs.patch CESIUM-0001-do-not-define-_DEBUG.patch + CESIUM-0002-not-a-framework.patch ) file(REMOVE "${SOURCE_PATH}/other_include/zstd_errors.h") From a01ff2f0b7f9e01797e3ff3257f91a3b2220dc38 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 13 Jun 2024 12:11:39 +1000 Subject: [PATCH 061/119] More fixes for KTX build on iOS, build macOS to separate dirs. --- .github/workflows/buildMac.yml | 8 +++-- .../CESIUM-0003-ios-normal-header-path.patch | 30 +++++++++++++++++++ extern/vcpkg-overlays/ktx/portfile.cmake | 1 + 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 extern/vcpkg-overlays/ktx/CESIUM-0003-ios-normal-header-path.patch diff --git a/.github/workflows/buildMac.yml b/.github/workflows/buildMac.yml index b844bce75..1fdfce8a5 100644 --- a/.github/workflows/buildMac.yml +++ b/.github/workflows/buildMac.yml @@ -66,13 +66,17 @@ jobs: uses: ilammy/setup-nasm@v1.5.1 - name: Build cesium-native run: | - mkdir -p extern/build - cd extern/build export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} + mkdir -p extern/build-arm64 + cd extern/build-arm64 cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=arm64 cmake --build . -j4 --target install + cd .. + mkdir -p build-x64 + cd build-x64 cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=x86_64 cmake --build . -j4 --target install + mkdir -p ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-universal-Release for f in ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release/*.a do lipo -create -output $f ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-arm64-Release/$(basename -- $f) ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-universal-Release/$(basename -- $f) diff --git a/extern/vcpkg-overlays/ktx/CESIUM-0003-ios-normal-header-path.patch b/extern/vcpkg-overlays/ktx/CESIUM-0003-ios-normal-header-path.patch new file mode 100644 index 000000000..6ad9c9771 --- /dev/null +++ b/extern/vcpkg-overlays/ktx/CESIUM-0003-ios-normal-header-path.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b62b849..d8c4745 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1133,18 +1133,18 @@ endif() + # Use of this to install KHR/khr_df.h is due to CMake's failure to + # preserve the include source folder hierarchy. + # See https://gitlab.kitware.com/cmake/cmake/-/issues/16739. +-if (IOS) +- set_source_files_properties( +- include/KHR/khr_df.h +- PROPERTIES MACOSX_PACKAGE_LOCATION Headers/KHR +- ) +-else() ++# if (IOS) ++# set_source_files_properties( ++# include/KHR/khr_df.h ++# PROPERTIES MACOSX_PACKAGE_LOCATION Headers/KHR ++# ) ++# else() + include(GNUInstallDirs) + install(FILES include/KHR/khr_df.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/KHR + COMPONENT dev + ) +-endif() ++# endif() + + install(EXPORT KTXTargets + FILE KtxTargets.cmake diff --git a/extern/vcpkg-overlays/ktx/portfile.cmake b/extern/vcpkg-overlays/ktx/portfile.cmake index 5cd081b44..40c64bbf2 100644 --- a/extern/vcpkg-overlays/ktx/portfile.cmake +++ b/extern/vcpkg-overlays/ktx/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( 0005-no-vendored-libs.patch CESIUM-0001-do-not-define-_DEBUG.patch CESIUM-0002-not-a-framework.patch + CESIUM-0003-ios-normal-header-path.patch ) file(REMOVE "${SOURCE_PATH}/other_include/zstd_errors.h") From 3173f8eddb0e211af74193760a4e14489aae2841 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 13 Jun 2024 12:50:59 +1000 Subject: [PATCH 062/119] Explicitly set CMAKE_SYSTEM_PROCESSOR in iOS toolchain. --- extern/unreal-ios-toolchain.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/extern/unreal-ios-toolchain.cmake b/extern/unreal-ios-toolchain.cmake index 68ed150bf..61bcd85e8 100644 --- a/extern/unreal-ios-toolchain.cmake +++ b/extern/unreal-ios-toolchain.cmake @@ -1,6 +1,7 @@ set(GENERATOR Xcode) set(CMAKE_SYSTEM_NAME iOS) set(CMAKE_OSX_ARCHITECTURES arm64) +set(CMAKE_SYSTEM_PROCESSOR arm64) set(CMAKE_OSX_DEPLOYMENT_TARGET 15) set(CMAKE_POSITION_INDEPENDENT_CODE ON) SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) From 60d373a44921af4d4a8d99516bc569a25474cbe2 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 13 Jun 2024 12:58:03 +1000 Subject: [PATCH 063/119] Use the lipo tool correctly. --- .github/workflows/buildMac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildMac.yml b/.github/workflows/buildMac.yml index 1fdfce8a5..1ae67cfe5 100644 --- a/.github/workflows/buildMac.yml +++ b/.github/workflows/buildMac.yml @@ -79,7 +79,7 @@ jobs: mkdir -p ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-universal-Release for f in ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release/*.a do - lipo -create -output $f ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-arm64-Release/$(basename -- $f) ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-universal-Release/$(basename -- $f) + lipo -create -output ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-universal-Release/$(basename -- $f) ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-arm64-Release/$(basename -- $f) ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release/$(basename -- $f) done rm -r -f ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release rm -r -f ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-arm64-Release From 25c88e1557394bba011074bd8993f480d3acce41 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 13 Jun 2024 14:21:42 +1000 Subject: [PATCH 064/119] Fix vcpkg cache path for non-Windows. Hopefully it will work on Windows as well. --- .github/actions/vcpkg-cache/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/vcpkg-cache/action.yml b/.github/actions/vcpkg-cache/action.yml index f85591288..04c3786bd 100644 --- a/.github/actions/vcpkg-cache/action.yml +++ b/.github/actions/vcpkg-cache/action.yml @@ -9,7 +9,7 @@ runs: - name: Cache vcpkg artifacts uses: actions/cache@v4 with: - path: /.ezvcpkg + path: ~/.ezvcpkg key: vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} restore-keys: | vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}- From 83211435414d881ba7ff47435798897bd9d165a3 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 13 Jun 2024 14:42:53 +1000 Subject: [PATCH 065/119] Don't try to lipo-together identical libraries. Such as the libssl.a from the Unreal installation, which is already universal. --- .github/workflows/buildMac.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildMac.yml b/.github/workflows/buildMac.yml index 1ae67cfe5..fa9342691 100644 --- a/.github/workflows/buildMac.yml +++ b/.github/workflows/buildMac.yml @@ -79,7 +79,15 @@ jobs: mkdir -p ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-universal-Release for f in ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release/*.a do - lipo -create -output ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-universal-Release/$(basename -- $f) ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-arm64-Release/$(basename -- $f) ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release/$(basename -- $f) + arm64f=${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-arm64-Release/$(basename -- $f) + x64f=${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release/$(basename -- $f) + universalf=${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-universal-Release/$(basename -- $f) + if diff $arm64f $x64f; then + # arm64 and x64 files are identical, so just copy one to the universal directory. + cp $arm64f $universalf + else + lipo -create -output $universalf $arm64f $x64f + fi done rm -r -f ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release rm -r -f ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-arm64-Release From 7ef5e8f2096613494a58025ea8eb9993584fcbbb Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 13 Jun 2024 15:50:01 +1000 Subject: [PATCH 066/119] Try again to fix the cache path. --- .github/actions/vcpkg-cache/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/vcpkg-cache/action.yml b/.github/actions/vcpkg-cache/action.yml index 04c3786bd..941c5e754 100644 --- a/.github/actions/vcpkg-cache/action.yml +++ b/.github/actions/vcpkg-cache/action.yml @@ -9,7 +9,7 @@ runs: - name: Cache vcpkg artifacts uses: actions/cache@v4 with: - path: ~/.ezvcpkg + path: ${{ runner.os == 'Windows' && '/.ezvcpkg' || '~/.ezvcpkg' }} key: vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} restore-keys: | vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}- From 2a358fa41f73d3295e8b976519267b8d523812ad Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 14 Jun 2024 07:11:06 +1000 Subject: [PATCH 067/119] Improve triplet organization. --- extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake | 2 +- extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake | 2 +- extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake | 2 +- extern/vcpkg-overlays/triplets/{ => shared}/common.cmake | 0 extern/vcpkg-overlays/triplets/{ => shared}/osx-common.cmake | 0 extern/vcpkg-overlays/triplets/universal-osx-unreal.cmake | 2 -- extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake | 2 +- extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake | 2 +- extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake | 2 +- 9 files changed, 6 insertions(+), 8 deletions(-) rename extern/vcpkg-overlays/triplets/{ => shared}/common.cmake (100%) rename extern/vcpkg-overlays/triplets/{ => shared}/osx-common.cmake (100%) delete mode 100644 extern/vcpkg-overlays/triplets/universal-osx-unreal.cmake diff --git a/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake index a45ceed20..8dcec1dc3 100644 --- a/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake @@ -1,4 +1,4 @@ -include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/shared/common.cmake") set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) diff --git a/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake index be13201c2..ef884ac13 100644 --- a/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake @@ -1,4 +1,4 @@ -include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/shared/common.cmake") set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) diff --git a/extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake index 40c1e1ffc..8b28c5c70 100644 --- a/extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/arm64-osx-unreal.cmake @@ -1,3 +1,3 @@ -include("${CMAKE_CURRENT_LIST_DIR}/osx-common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/shared/osx-common.cmake") set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_OSX_ARCHITECTURES arm64) diff --git a/extern/vcpkg-overlays/triplets/common.cmake b/extern/vcpkg-overlays/triplets/shared/common.cmake similarity index 100% rename from extern/vcpkg-overlays/triplets/common.cmake rename to extern/vcpkg-overlays/triplets/shared/common.cmake diff --git a/extern/vcpkg-overlays/triplets/osx-common.cmake b/extern/vcpkg-overlays/triplets/shared/osx-common.cmake similarity index 100% rename from extern/vcpkg-overlays/triplets/osx-common.cmake rename to extern/vcpkg-overlays/triplets/shared/osx-common.cmake diff --git a/extern/vcpkg-overlays/triplets/universal-osx-unreal.cmake b/extern/vcpkg-overlays/triplets/universal-osx-unreal.cmake deleted file mode 100644 index 5a865d4e5..000000000 --- a/extern/vcpkg-overlays/triplets/universal-osx-unreal.cmake +++ /dev/null @@ -1,2 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/osx-common.cmake") -set(VCPKG_OSX_ARCHITECTURES "arm64;x86_x64") diff --git a/extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake index eedfc6e1e..052db2469 100644 --- a/extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/x64-linux-unreal.cmake @@ -1,4 +1,4 @@ -include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/shared/common.cmake") set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) diff --git a/extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake index 4c8f98dc0..2b1af43ff 100644 --- a/extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/x64-osx-unreal.cmake @@ -1,3 +1,3 @@ -include("${CMAKE_CURRENT_LIST_DIR}/osx-common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/shared/osx-common.cmake") set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_OSX_ARCHITECTURES x86_64) diff --git a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake index f3255bd97..7fa64d868 100644 --- a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake @@ -1,4 +1,4 @@ -include("${CMAKE_CURRENT_LIST_DIR}/common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/shared/common.cmake") set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) From fd1625f28693541309358f355176f1b8ec0e1e59 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 14 Jun 2024 07:35:50 +1000 Subject: [PATCH 068/119] Add visibility-related flags to triplets. To hopefully fix large number of linker warnings on macOS. --- extern/unreal-linux-toolchain.cmake | 3 ++- .../triplets/arm64-android-unreal.cmake | 5 +++++ .../triplets/arm64-ios-unreal.cmake | 5 +++++ .../triplets/shared/osx-common.cmake | 4 ++++ .../triplets/x64-windows-unreal.cmake | 15 +++++++++++++-- 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/extern/unreal-linux-toolchain.cmake b/extern/unreal-linux-toolchain.cmake index ea7c2d433..3ae2d8eb4 100644 --- a/extern/unreal-linux-toolchain.cmake +++ b/extern/unreal-linux-toolchain.cmake @@ -10,7 +10,8 @@ SET(CMAKE_BUILD_WITH_INSTALL_RPATH on) SET(CMAKE_POSITION_INDEPENDENT_CODE on) # These were deduced by scouring Unreal's LinuxToolChain.cs. -SET(CMAKE_CXX_FLAGS "-nostdinc++ -I$ENV{UNREAL_ENGINE_LIBCXX_DIR}/include -I$ENV{UNREAL_ENGINE_LIBCXX_DIR}/include/c++/v1 -target x86_64-unknown-linux-gnu") +SET(CMAKE_C_FLAGS "-fvisibility-ms-compat -fvisibility-inlines-hidden") +SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -nostdinc++ -I$ENV{UNREAL_ENGINE_LIBCXX_DIR}/include -I$ENV{UNREAL_ENGINE_LIBCXX_DIR}/include/c++/v1 -target x86_64-unknown-linux-gnu") SET(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld -target x86_64-unknown-linux-gnu --sysroot=$ENV{UNREAL_ENGINE_COMPILER_DIR} -B$ENV{UNREAL_ENGINE_COMPILER_DIR}/usr/lib -B$ENV{UNREAL_ENGINE_COMPILER_DIR}/usr/lib64 -L$ENV{UNREAL_ENGINE_COMPILER_DIR}/usr/lib -L$ENV{UNREAL_ENGINE_COMPILER_DIR}/usr/lib64 -nodefaultlibs -L$ENV{UNREAL_ENGINE_LIBCXX_DIR}/lib/Unix/x86_64-unknown-linux-gnu/ $ENV{UNREAL_ENGINE_LIBCXX_DIR}/lib/Unix/x86_64-unknown-linux-gnu/libc++.a $ENV{UNREAL_ENGINE_LIBCXX_DIR}/lib/Unix/x86_64-unknown-linux-gnu/libc++abi.a -lm -lc -lpthread -lgcc_s -lgcc") # search for programs in the build host directories diff --git a/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake index 8dcec1dc3..e7e44d9df 100644 --- a/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/arm64-android-unreal.cmake @@ -7,3 +7,8 @@ set(VCPKG_CMAKE_SYSTEM_NAME Android) set(VCPKG_MAKE_BUILD_TRIPLET "--host=aarch64-linux-android") set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=arm64-v8a) set(VCPKG_CMAKE_SYSTEM_VERSION 21) + +# From Unreal Build Tool: +# https://github.com/EpicGames/UnrealEngine/blob/5.2.1-release/Engine/Source/Programs/UnrealBuildTool/Platform/Android/AndroidToolChain.cs +set(VCPKG_CXX_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden") +set(VCPKG_C_FLAGS "${VCPKG_CXX_FLAGS}") diff --git a/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake b/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake index ef884ac13..0048c4b25 100644 --- a/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/arm64-ios-unreal.cmake @@ -5,3 +5,8 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME iOS) set(VCPKG_OSX_DEPLOYMENT_TARGET 15) + +# From Unreal Build Tool: +# https://github.com/EpicGames/UnrealEngine/blob/5.2.1-release/Engine/Source/Programs/UnrealBuildTool/Platform/IOS/IOSToolChain.cs +set(VCPKG_CXX_FLAGS "-fvisibility=hidden") +set(VCPKG_C_FLAGS "${VCPKG_CXX_FLAGS}") diff --git a/extern/vcpkg-overlays/triplets/shared/osx-common.cmake b/extern/vcpkg-overlays/triplets/shared/osx-common.cmake index 177e0c1aa..48f654017 100644 --- a/extern/vcpkg-overlays/triplets/shared/osx-common.cmake +++ b/extern/vcpkg-overlays/triplets/shared/osx-common.cmake @@ -4,3 +4,7 @@ set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15) + +# From Unreal Build Tool: +# https://github.com/EpicGames/UnrealEngine/blob/5.2.1-release/Engine/Source/Programs/UnrealBuildTool/Platform/Mac/MacToolChain.cs +set(VCPKG_CXX_FLAGS "-fvisibility-ms-compat -fvisibility-inlines-hidden") diff --git a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake index 7fa64d868..1286e694c 100644 --- a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake @@ -3,6 +3,17 @@ include("${CMAKE_CURRENT_LIST_DIR}/shared/common.cmake") set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_CXX_FLAGS "/MD /Zp8") -set(VCPKG_C_FLAGS "/MD /Zp8") set(VCPKG_ENV_PASSTHROUGH "UNREAL_ENGINE_ROOT") + +# Unreal Engine adds /Zp8 in 64-bit Windows builds to align structs to 8 bytes instead of the +# default of 16 bytes. There's this nice note in the documentation for that option: +# Don't change the setting from the default when you include the Windows SDK headers, either +# by using /Zp on the command line or by using #pragma pack. Otherwise, your application may +# cause memory corruption at runtime. +# (https://docs.microsoft.com/en-us/cpp/build/reference/zp-struct-member-alignment?view=msvc-160) +# Yeah that's not just the Windows SDK, but anything that passes structs across the boundary +# between compilation units using different versions of that flag. We compile cesium-native +# with this same option to avoid super-dodgy and hard to debug issues. +# https://github.com/EpicGames/UnrealEngine/blob/5.2.1-release/Engine/Source/Programs/UnrealBuildTool/Platform/Windows/VCToolChain.cs +set(VCPKG_CXX_FLAGS "/MD /Zp8") +set(VCPKG_C_FLAGS "${VCPKG_CXX_FLAGS}") From 35bc6ab34425c08288454a46ed2a422226ef4f02 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 14 Jun 2024 10:47:11 +1000 Subject: [PATCH 069/119] Invalidate vcpkg cache on triplet or toolchain changes. --- .github/actions/vcpkg-cache/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/vcpkg-cache/action.yml b/.github/actions/vcpkg-cache/action.yml index 941c5e754..b9b91857d 100644 --- a/.github/actions/vcpkg-cache/action.yml +++ b/.github/actions/vcpkg-cache/action.yml @@ -10,6 +10,6 @@ runs: uses: actions/cache@v4 with: path: ${{ runner.os == 'Windows' && '/.ezvcpkg' || '~/.ezvcpkg' }} - key: vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} + key: vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json', 'extern/vcpkg-overlays/triplets/**/*', 'extern/*toolchain.cmake') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} restore-keys: | vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}- From 0982821fdb380e1ba8c1f99617e22c2cc9aeae7c Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 14 Jun 2024 11:16:21 +1000 Subject: [PATCH 070/119] Fix restore-key. --- .github/actions/vcpkg-cache/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/vcpkg-cache/action.yml b/.github/actions/vcpkg-cache/action.yml index b9b91857d..e700c4551 100644 --- a/.github/actions/vcpkg-cache/action.yml +++ b/.github/actions/vcpkg-cache/action.yml @@ -12,4 +12,4 @@ runs: path: ${{ runner.os == 'Windows' && '/.ezvcpkg' || '~/.ezvcpkg' }} key: vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json', 'extern/vcpkg-overlays/triplets/**/*', 'extern/*toolchain.cmake') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'extern/CMakeLists.txt') }} restore-keys: | - vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json') }}- + vcpkg-${{ inputs.id }}-${{ hashFiles('extern/vcpkg-overlays/**/vcpkg.json', 'extern/vcpkg-overlays/triplets/**/*', 'extern/*toolchain.cmake') }}- From 308a4cf2fa2492ac164ef01c0d31ed571d264dd0 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 14 Jun 2024 13:38:12 +1000 Subject: [PATCH 071/119] Set VCPKG_C_FLAGS on macOS. --- extern/vcpkg-overlays/triplets/shared/osx-common.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/extern/vcpkg-overlays/triplets/shared/osx-common.cmake b/extern/vcpkg-overlays/triplets/shared/osx-common.cmake index 48f654017..4890a34e8 100644 --- a/extern/vcpkg-overlays/triplets/shared/osx-common.cmake +++ b/extern/vcpkg-overlays/triplets/shared/osx-common.cmake @@ -8,3 +8,4 @@ set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15) # From Unreal Build Tool: # https://github.com/EpicGames/UnrealEngine/blob/5.2.1-release/Engine/Source/Programs/UnrealBuildTool/Platform/Mac/MacToolChain.cs set(VCPKG_CXX_FLAGS "-fvisibility-ms-compat -fvisibility-inlines-hidden") +set(VCPKG_C_FLAGS "${VCPKG_CXX_FLAGS}") From a7db660a5ea0f257a408ad2616bd9ee76021357a Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 14 Jun 2024 16:32:30 +1000 Subject: [PATCH 072/119] Set IncludeOrderVersion, remove unnecessary precompiled header. --- Source/CesiumEditor/CesiumEditor.Build.cs | 4 +-- Source/CesiumEditor/Private/PCH.h | 29 --------------------- Source/CesiumRuntime/CesiumRuntime.Build.cs | 6 ++--- Source/CesiumRuntime/Private/PCH.h | 27 ------------------- 4 files changed, 3 insertions(+), 63 deletions(-) delete mode 100644 Source/CesiumEditor/Private/PCH.h delete mode 100644 Source/CesiumRuntime/Private/PCH.h diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs index 5a4825d6d..b9bb57129 100644 --- a/Source/CesiumEditor/CesiumEditor.Build.cs +++ b/Source/CesiumEditor/CesiumEditor.Build.cs @@ -11,8 +11,6 @@ public class CesiumEditor : ModuleRules { public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - PublicIncludePaths.AddRange( new string[] { // ... add public include paths required here ... @@ -125,8 +123,8 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) } ); + IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; - PrivatePCHHeaderFile = "Private/PCH.h"; CppStandard = CppStandardVersion.Cpp17; } } diff --git a/Source/CesiumEditor/Private/PCH.h b/Source/CesiumEditor/Private/PCH.h deleted file mode 100644 index f92035967..000000000 --- a/Source/CesiumEditor/Private/PCH.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2020-2024 CesiumGS, Inc. and Contributors - -#pragma once - -#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -#include "CoreMinimal.h" - -// Workaround for an unhelpful warning (that gets treated as an error) in -// VS2017. See https://github.com/akrzemi1/Optional/issues/57 and -// https://answers.unrealengine.com/questions/607946/anonymous-union-with-none-trivial-type.html -#ifdef _MSC_VER -#if _MSC_VER < 1920 -#pragma warning(push) -#pragma warning(disable : 4583) -#pragma warning(disable : 4582) -#include -#include -#pragma warning(pop) -#endif -#endif - -#include "Blueprint/UserWidget.h" -#include "Components/MeshComponent.h" -#include "Components/PrimitiveComponent.h" -#include "Components/WidgetComponent.h" -#include "Engine/Engine.h" -#include "Engine/World.h" -#include "Physics/PhysicsInterfaceCore.h" -#include "PhysicsEngine/BodyInstance.h" diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index 3af64ed71..854ef1bf9 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -11,9 +11,6 @@ public class CesiumRuntime : ModuleRules { public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - ShadowVariableWarningLevel = WarningLevel.Off; - PublicIncludePaths.AddRange( new string[] { Path.Combine(ModuleDirectory, "../ThirdParty/include") @@ -148,8 +145,9 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) } ); + ShadowVariableWarningLevel = WarningLevel.Off; + IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; - PrivatePCHHeaderFile = "Private/PCH.h"; #if UE_5_4_OR_LATER CppStandard = CppStandardVersion.Cpp20; diff --git a/Source/CesiumRuntime/Private/PCH.h b/Source/CesiumRuntime/Private/PCH.h deleted file mode 100644 index 759d0b452..000000000 --- a/Source/CesiumRuntime/Private/PCH.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2024 CesiumGS, Inc. and Contributors - -#pragma once - -#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -#include "CoreMinimal.h" - -// Workaround for an unhelpful warning (that gets treated as an error) in -// VS2017. See https://github.com/akrzemi1/Optional/issues/57 and -// https://answers.unrealengine.com/questions/607946/anonymous-union-with-none-trivial-type.html -#ifdef _MSC_VER -#if _MSC_VER < 1920 -#pragma warning(push) -#pragma warning(disable : 4583) -#pragma warning(disable : 4582) -#include -#include -#pragma warning(pop) -#endif -#endif - -#include "Components/MeshComponent.h" -#include "Components/PrimitiveComponent.h" -#include "Engine/Engine.h" -#include "Engine/World.h" -#include "Physics/PhysicsInterfaceCore.h" -#include "PhysicsEngine/BodyInstance.h" From ce8334f47a4377715a4c0ebb22395ae4788ff6b1 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 14 Jun 2024 18:57:14 +1000 Subject: [PATCH 073/119] Use C++20 and swl::variant instead of std::variant. In my limited tests this drastically improves compile times. --- .gitmodules | 3 ++ Source/CesiumEditor/CesiumEditor.Build.cs | 2 +- .../Private/CesiumIonTokenTroubleshooting.cpp | 24 +++++++------- .../Private/CesiumIonTokenTroubleshooting.h | 4 +-- Source/CesiumRuntime/CesiumRuntime.Build.cs | 4 --- .../CesiumRuntime/Private/Cesium3DTileset.cpp | 8 ----- .../Private/CesiumFeatureIdSet.cpp | 12 +++---- .../Private/CesiumMetadataValue.cpp | 32 +++++++++---------- .../CesiumPropertyArrayBlueprintLibrary.cpp | 20 ++++++------ .../Private/Tests/CesiumLoadTestCore.h | 4 +-- .../Private/Tests/CesiumLoadTestSamples.cpp | 2 +- .../Private/Tests/Google3dTilesLoadTest.cpp | 2 +- .../CesiumRuntime/Public/CesiumFeatureIdSet.h | 5 +-- .../Public/CesiumMetadataValue.h | 9 +++--- .../Public/CesiumPropertyArray.h | 8 ++--- extern/CMakeLists.txt | 3 ++ extern/swl-variant | 1 + 17 files changed, 70 insertions(+), 73 deletions(-) create mode 160000 extern/swl-variant diff --git a/.gitmodules b/.gitmodules index ea20ad97f..d47031662 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "extern/tidy-html5"] path = extern/tidy-html5 url = https://github.com/htacg/tidy-html5 +[submodule "extern/swl-variant"] + path = extern/swl-variant + url = https://github.com/groundswellaudio/swl-variant.git diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs index b9bb57129..1a668ec26 100644 --- a/Source/CesiumEditor/CesiumEditor.Build.cs +++ b/Source/CesiumEditor/CesiumEditor.Build.cs @@ -125,6 +125,6 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; - CppStandard = CppStandardVersion.Cpp17; + CppStandard = CppStandardVersion.Cpp20; } } diff --git a/Source/CesiumEditor/Private/CesiumIonTokenTroubleshooting.cpp b/Source/CesiumEditor/Private/CesiumIonTokenTroubleshooting.cpp index 269192815..74d1962da 100644 --- a/Source/CesiumEditor/Private/CesiumIonTokenTroubleshooting.cpp +++ b/Source/CesiumEditor/Private/CesiumIonTokenTroubleshooting.cpp @@ -46,7 +46,7 @@ using namespace CesiumIonClient; // If this is a tileset, close any already-open panels associated with its // overlays. Overlays won't appear until the tileset is working anyway. TWeakObjectPtr* ppTileset = - std::get_if>(&ionObject); + swl::get_if>(&ionObject); if (ppTileset && ppTileset->IsValid()) { TArray rasterOverlays; (*ppTileset)->GetComponents(rasterOverlays); @@ -69,7 +69,7 @@ using namespace CesiumIonClient; // If this is a raster overlay and this panel is already open for its attached // tileset, don't open the panel for the overlay for the same reason as above. TWeakObjectPtr* ppRasterOverlay = - std::get_if>(&ionObject); + swl::get_if>(&ionObject); if (ppRasterOverlay && ppRasterOverlay->IsValid()) { ACesium3DTileset* pOwner = Cast((*ppRasterOverlay)->GetOwner()); @@ -145,7 +145,7 @@ addTokenCheck(const FString& label, std::optional& state) { } bool isNull(const CesiumIonObject& o) { - return std::visit([](auto p) { return p == nullptr; }, o); + return swl::visit([](auto p) { return p == nullptr; }, o); } FString getLabel(const CesiumIonObject& o) { @@ -160,11 +160,11 @@ FString getLabel(const CesiumIonObject& o) { } }; - return std::visit(Operation(), o); + return swl::visit(Operation(), o); } FString getName(const CesiumIonObject& o) { - return std::visit([](auto p) { return p->GetName(); }, o); + return swl::visit([](auto p) { return p->GetName(); }, o); } int64 getIonAssetID(const CesiumIonObject& o) { @@ -192,7 +192,7 @@ int64 getIonAssetID(const CesiumIonObject& o) { } }; - return std::visit(Operation(), o); + return swl::visit(Operation(), o); } FString getIonAccessToken(const CesiumIonObject& o) { @@ -220,7 +220,7 @@ FString getIonAccessToken(const CesiumIonObject& o) { } }; - return std::visit(Operation(), o); + return swl::visit(Operation(), o); } void setIonAccessToken(const CesiumIonObject& o, const FString& newToken) { @@ -255,7 +255,7 @@ void setIonAccessToken(const CesiumIonObject& o, const FString& newToken) { } }; - return std::visit(Operation{newToken}, o); + return swl::visit(Operation{newToken}, o); } FString getObjectType(const CesiumIonObject& o) { @@ -269,11 +269,11 @@ FString getObjectType(const CesiumIonObject& o) { } }; - return std::visit(Operation(), o); + return swl::visit(Operation(), o); } UObject* asUObject(const CesiumIonObject& o) { - return std::visit( + return swl::visit( [](auto p) -> UObject* { return p.IsValid() ? p.Get() : nullptr; }, o); } @@ -294,7 +294,7 @@ bool isUsingCesiumIon(const CesiumIonObject& o) { } }; - return std::visit(Operation(), o); + return swl::visit(Operation(), o); } UCesiumIonServer* getCesiumIonServer(const CesiumIonObject& o) { @@ -314,7 +314,7 @@ UCesiumIonServer* getCesiumIonServer(const CesiumIonObject& o) { } }; - UCesiumIonServer* pServer = std::visit(Operation{}, o); + UCesiumIonServer* pServer = swl::visit(Operation{}, o); if (!IsValid(pServer)) { pServer = UCesiumIonServer::GetDefaultServer(); } diff --git a/Source/CesiumEditor/Private/CesiumIonTokenTroubleshooting.h b/Source/CesiumEditor/Private/CesiumIonTokenTroubleshooting.h index b9b1d65a3..4602793de 100644 --- a/Source/CesiumEditor/Private/CesiumIonTokenTroubleshooting.h +++ b/Source/CesiumEditor/Private/CesiumIonTokenTroubleshooting.h @@ -4,13 +4,13 @@ #include "Widgets/SWindow.h" #include -#include +#include #include class ACesium3DTileset; class UCesiumRasterOverlay; -using CesiumIonObject = std::variant< +using CesiumIonObject = swl::variant< TWeakObjectPtr, TWeakObjectPtr>; diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index 854ef1bf9..ef936c909 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -149,11 +149,7 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; -#if UE_5_4_OR_LATER CppStandard = CppStandardVersion.Cpp20; -#else - CppStandard = CppStandardVersion.Cpp17; -#endif bEnableExceptions = true; } } diff --git a/Source/CesiumRuntime/Private/Cesium3DTileset.cpp b/Source/CesiumRuntime/Private/Cesium3DTileset.cpp index 26ec2cb82..a29fd3558 100644 --- a/Source/CesiumRuntime/Private/Cesium3DTileset.cpp +++ b/Source/CesiumRuntime/Private/Cesium3DTileset.cpp @@ -1889,14 +1889,6 @@ void ACesium3DTileset::showTilesToRender( continue; } - // That looks like some reeeally entertaining debug session...: - // const Cesium3DTilesSelection::TileID& id = pTile->getTileID(); - // const CesiumGeometry::QuadtreeTileID* pQuadtreeID = - // std::get_if(&id); if (!pQuadtreeID || - // pQuadtreeID->level != 14 || pQuadtreeID->x != 5503 || pQuadtreeID->y != - // 11626) { continue; - //} - const Cesium3DTilesSelection::TileContent& content = pTile->getContent(); const Cesium3DTilesSelection::TileRenderContent* pRenderContent = content.getRenderContent(); diff --git a/Source/CesiumRuntime/Private/CesiumFeatureIdSet.cpp b/Source/CesiumRuntime/Private/CesiumFeatureIdSet.cpp index 4adc304ab..0365f20a1 100644 --- a/Source/CesiumRuntime/Private/CesiumFeatureIdSet.cpp +++ b/Source/CesiumRuntime/Private/CesiumFeatureIdSet.cpp @@ -73,7 +73,7 @@ const FCesiumFeatureIdAttribute& UCesiumFeatureIdSetBlueprintLibrary::GetAsFeatureIDAttribute( UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet) { if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Attribute) { - return std::get(FeatureIDSet._featureID); + return swl::get(FeatureIDSet._featureID); } return EmptyFeatureIDAttribute; @@ -83,7 +83,7 @@ const FCesiumFeatureIdTexture& UCesiumFeatureIdSetBlueprintLibrary::GetAsFeatureIDTexture( UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet) { if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Texture) { - return std::get(FeatureIDSet._featureID); + return swl::get(FeatureIDSet._featureID); } return EmptyFeatureIDTexture; @@ -114,7 +114,7 @@ int64 UCesiumFeatureIdSetBlueprintLibrary::GetFeatureIDForVertex( int64 VertexIndex) { if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Attribute) { FCesiumFeatureIdAttribute attribute = - std::get(FeatureIDSet._featureID); + swl::get(FeatureIDSet._featureID); return UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDForVertex( attribute, VertexIndex); @@ -122,7 +122,7 @@ int64 UCesiumFeatureIdSetBlueprintLibrary::GetFeatureIDForVertex( if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Texture) { FCesiumFeatureIdTexture texture = - std::get(FeatureIDSet._featureID); + swl::get(FeatureIDSet._featureID); return UCesiumFeatureIdTextureBlueprintLibrary::GetFeatureIDForVertex( texture, VertexIndex); @@ -142,7 +142,7 @@ int64 UCesiumFeatureIdSetBlueprintLibrary::GetFeatureIDFromHit( const FHitResult& Hit) { if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Texture) { FCesiumFeatureIdTexture texture = - std::get(FeatureIDSet._featureID); + swl::get(FeatureIDSet._featureID); return UCesiumFeatureIdTextureBlueprintLibrary::GetFeatureIDFromHit( texture, Hit); @@ -170,7 +170,7 @@ int64 UCesiumFeatureIdSetBlueprintLibrary::GetFeatureIDFromHit( if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Attribute) { FCesiumFeatureIdAttribute attribute = - std::get(FeatureIDSet._featureID); + swl::get(FeatureIDSet._featureID); return UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDForVertex( attribute, VertexIndex); diff --git a/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp b/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp index 44580b035..bb87868fe 100644 --- a/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp +++ b/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp @@ -51,7 +51,7 @@ UCesiumMetadataValueBlueprintLibrary::GetTrueComponentType( bool UCesiumMetadataValueBlueprintLibrary::GetBoolean( UPARAM(ref) const FCesiumMetadataValue& Value, bool DefaultValue) { - return std::visit( + return swl::visit( [DefaultValue](auto value) -> bool { return CesiumGltf::MetadataConversions::convert( value) @@ -65,7 +65,7 @@ PRAGMA_ENABLE_DEPRECATION_WARNINGS uint8 UCesiumMetadataValueBlueprintLibrary::GetByte( UPARAM(ref) const FCesiumMetadataValue& Value, uint8 DefaultValue) { - return std::visit( + return swl::visit( [DefaultValue](auto value) -> uint8 { return CesiumGltf::MetadataConversions::convert( value) @@ -77,7 +77,7 @@ uint8 UCesiumMetadataValueBlueprintLibrary::GetByte( int32 UCesiumMetadataValueBlueprintLibrary::GetInteger( UPARAM(ref) const FCesiumMetadataValue& Value, int32 DefaultValue) { - return std::visit( + return swl::visit( [DefaultValue](auto value) { return CesiumGltf::MetadataConversions::convert( value) @@ -89,7 +89,7 @@ int32 UCesiumMetadataValueBlueprintLibrary::GetInteger( int64 UCesiumMetadataValueBlueprintLibrary::GetInteger64( UPARAM(ref) const FCesiumMetadataValue& Value, int64 DefaultValue) { - return std::visit( + return swl::visit( [DefaultValue](auto value) -> int64 { return CesiumGltf::MetadataConversions::convert( value) @@ -101,7 +101,7 @@ int64 UCesiumMetadataValueBlueprintLibrary::GetInteger64( float UCesiumMetadataValueBlueprintLibrary::GetFloat( UPARAM(ref) const FCesiumMetadataValue& Value, float DefaultValue) { - return std::visit( + return swl::visit( [DefaultValue](auto value) -> float { return CesiumGltf::MetadataConversions::convert( value) @@ -113,7 +113,7 @@ float UCesiumMetadataValueBlueprintLibrary::GetFloat( double UCesiumMetadataValueBlueprintLibrary::GetFloat64( UPARAM(ref) const FCesiumMetadataValue& Value, double DefaultValue) { - return std::visit( + return swl::visit( [DefaultValue](auto value) -> double { return CesiumGltf::MetadataConversions:: convert(value) @@ -125,7 +125,7 @@ double UCesiumMetadataValueBlueprintLibrary::GetFloat64( FIntPoint UCesiumMetadataValueBlueprintLibrary::GetIntPoint( UPARAM(ref) const FCesiumMetadataValue& Value, const FIntPoint& DefaultValue) { - return std::visit( + return swl::visit( [&DefaultValue](auto value) -> FIntPoint { if constexpr (CesiumGltf::IsMetadataString::value) { return UnrealMetadataConversions::toIntPoint(value, DefaultValue); @@ -142,7 +142,7 @@ FIntPoint UCesiumMetadataValueBlueprintLibrary::GetIntPoint( FVector2D UCesiumMetadataValueBlueprintLibrary::GetVector2D( UPARAM(ref) const FCesiumMetadataValue& Value, const FVector2D& DefaultValue) { - return std::visit( + return swl::visit( [&DefaultValue](auto value) -> FVector2D { if constexpr (CesiumGltf::IsMetadataString::value) { return UnrealMetadataConversions::toVector2D(value, DefaultValue); @@ -159,7 +159,7 @@ FVector2D UCesiumMetadataValueBlueprintLibrary::GetVector2D( FIntVector UCesiumMetadataValueBlueprintLibrary::GetIntVector( UPARAM(ref) const FCesiumMetadataValue& Value, const FIntVector& DefaultValue) { - return std::visit( + return swl::visit( [&DefaultValue](auto value) -> FIntVector { if constexpr (CesiumGltf::IsMetadataString::value) { return UnrealMetadataConversions::toIntVector(value, DefaultValue); @@ -176,7 +176,7 @@ FIntVector UCesiumMetadataValueBlueprintLibrary::GetIntVector( FVector3f UCesiumMetadataValueBlueprintLibrary::GetVector3f( UPARAM(ref) const FCesiumMetadataValue& Value, const FVector3f& DefaultValue) { - return std::visit( + return swl::visit( [&DefaultValue](auto value) -> FVector3f { if constexpr (CesiumGltf::IsMetadataString::value) { return UnrealMetadataConversions::toVector3f(value, DefaultValue); @@ -193,7 +193,7 @@ FVector3f UCesiumMetadataValueBlueprintLibrary::GetVector3f( FVector UCesiumMetadataValueBlueprintLibrary::GetVector( UPARAM(ref) const FCesiumMetadataValue& Value, const FVector& DefaultValue) { - return std::visit( + return swl::visit( [&DefaultValue](auto value) -> FVector { if constexpr (CesiumGltf::IsMetadataString::value) { return UnrealMetadataConversions::toVector(value, DefaultValue); @@ -210,7 +210,7 @@ FVector UCesiumMetadataValueBlueprintLibrary::GetVector( FVector4 UCesiumMetadataValueBlueprintLibrary::GetVector4( UPARAM(ref) const FCesiumMetadataValue& Value, const FVector4& DefaultValue) { - return std::visit( + return swl::visit( [&DefaultValue](auto value) -> FVector4 { if constexpr (CesiumGltf::IsMetadataString::value) { return UnrealMetadataConversions::toVector4(value, DefaultValue); @@ -227,7 +227,7 @@ FVector4 UCesiumMetadataValueBlueprintLibrary::GetVector4( FMatrix UCesiumMetadataValueBlueprintLibrary::GetMatrix( UPARAM(ref) const FCesiumMetadataValue& Value, const FMatrix& DefaultValue) { - auto maybeMat4 = std::visit( + auto maybeMat4 = swl::visit( [&DefaultValue](auto value) -> std::optional { return CesiumGltf::MetadataConversions:: convert(value); @@ -241,7 +241,7 @@ FMatrix UCesiumMetadataValueBlueprintLibrary::GetMatrix( FString UCesiumMetadataValueBlueprintLibrary::GetString( UPARAM(ref) const FCesiumMetadataValue& Value, const FString& DefaultValue) { - return std::visit( + return swl::visit( [&DefaultValue](auto value) -> FString { using ValueType = decltype(value); if constexpr ( @@ -262,7 +262,7 @@ FString UCesiumMetadataValueBlueprintLibrary::GetString( FCesiumPropertyArray UCesiumMetadataValueBlueprintLibrary::GetArray( UPARAM(ref) const FCesiumMetadataValue& Value) { - return std::visit( + return swl::visit( [](auto value) -> FCesiumPropertyArray { if constexpr (CesiumGltf::IsMetadataArray::value) { return FCesiumPropertyArray(value); @@ -274,7 +274,7 @@ FCesiumPropertyArray UCesiumMetadataValueBlueprintLibrary::GetArray( bool UCesiumMetadataValueBlueprintLibrary::IsEmpty( UPARAM(ref) const FCesiumMetadataValue& Value) { - return std::holds_alternative(Value._value); + return swl::holds_alternative(Value._value); } TMap UCesiumMetadataValueBlueprintLibrary::GetValuesAsStrings( diff --git a/Source/CesiumRuntime/Private/CesiumPropertyArrayBlueprintLibrary.cpp b/Source/CesiumRuntime/Private/CesiumPropertyArrayBlueprintLibrary.cpp index f96fa4181..5c9bc075e 100644 --- a/Source/CesiumRuntime/Private/CesiumPropertyArrayBlueprintLibrary.cpp +++ b/Source/CesiumRuntime/Private/CesiumPropertyArrayBlueprintLibrary.cpp @@ -24,18 +24,18 @@ UCesiumPropertyArrayBlueprintLibrary::GetElementValueType( int64 UCesiumPropertyArrayBlueprintLibrary::GetArraySize( UPARAM(ref) const FCesiumPropertyArray& array) { - return std::visit([](const auto& view) { return view.size(); }, array._value); + return swl::visit([](const auto& view) { return view.size(); }, array._value); } int64 UCesiumPropertyArrayBlueprintLibrary::GetSize( UPARAM(ref) const FCesiumPropertyArray& array) { - return std::visit([](const auto& view) { return view.size(); }, array._value); + return swl::visit([](const auto& view) { return view.size(); }, array._value); } FCesiumMetadataValue UCesiumPropertyArrayBlueprintLibrary::GetValue( UPARAM(ref) const FCesiumPropertyArray& array, int64 index) { - return std::visit( + return swl::visit( [index](const auto& v) -> FCesiumMetadataValue { if (index < 0 || index >= v.size()) { FFrame::KismetExecutionMessage( @@ -63,7 +63,7 @@ bool UCesiumPropertyArrayBlueprintLibrary::GetBoolean( UPARAM(ref) const FCesiumPropertyArray& array, int64 index, bool defaultValue) { - return std::visit( + return swl::visit( [index, defaultValue](const auto& v) -> bool { if (index < 0 || index >= v.size()) { return defaultValue; @@ -80,7 +80,7 @@ uint8 UCesiumPropertyArrayBlueprintLibrary::GetByte( UPARAM(ref) const FCesiumPropertyArray& array, int64 index, uint8 defaultValue) { - return std::visit( + return swl::visit( [index, defaultValue](const auto& v) -> uint8 { if (index < 0 || index >= v.size()) { return defaultValue; @@ -97,7 +97,7 @@ int32 UCesiumPropertyArrayBlueprintLibrary::GetInteger( UPARAM(ref) const FCesiumPropertyArray& array, int64 index, int32 defaultValue) { - return std::visit( + return swl::visit( [index, defaultValue](const auto& v) -> int32 { if (index < 0 || index >= v.size()) { return defaultValue; @@ -114,7 +114,7 @@ int64 UCesiumPropertyArrayBlueprintLibrary::GetInteger64( UPARAM(ref) const FCesiumPropertyArray& array, int64 index, int64 defaultValue) { - return std::visit( + return swl::visit( [index, defaultValue](const auto& v) -> int64 { if (index < 0 || index >= v.size()) { return defaultValue; @@ -131,7 +131,7 @@ float UCesiumPropertyArrayBlueprintLibrary::GetFloat( UPARAM(ref) const FCesiumPropertyArray& array, int64 index, float defaultValue) { - return std::visit( + return swl::visit( [index, defaultValue](const auto& v) -> float { if (index < 0 || index >= v.size()) { return defaultValue; @@ -148,7 +148,7 @@ double UCesiumPropertyArrayBlueprintLibrary::GetFloat64( UPARAM(ref) const FCesiumPropertyArray& array, int64 index, double defaultValue) { - return std::visit( + return swl::visit( [index, defaultValue](const auto& v) -> double { auto value = v[index]; return CesiumGltf::MetadataConversions:: @@ -162,7 +162,7 @@ FString UCesiumPropertyArrayBlueprintLibrary::GetString( UPARAM(ref) const FCesiumPropertyArray& array, int64 index, const FString& defaultValue) { - return std::visit( + return swl::visit( [index, defaultValue](const auto& v) -> FString { if (index < 0 || index >= v.size()) { return defaultValue; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumLoadTestCore.h b/Source/CesiumRuntime/Private/Tests/CesiumLoadTestCore.h index ee5188b0d..637d76e85 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumLoadTestCore.h +++ b/Source/CesiumRuntime/Private/Tests/CesiumLoadTestCore.h @@ -5,14 +5,14 @@ #if WITH_EDITOR #include -#include +#include #include "CesiumSceneGeneration.h" namespace Cesium { struct TestPass { - typedef std::variant TestingParameter; + typedef swl::variant TestingParameter; typedef std::function PassCallback; diff --git a/Source/CesiumRuntime/Private/Tests/CesiumLoadTestSamples.cpp b/Source/CesiumRuntime/Private/Tests/CesiumLoadTestSamples.cpp index 258d45b84..84c89b0d8 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumLoadTestSamples.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumLoadTestSamples.cpp @@ -233,7 +233,7 @@ bool FSampleMaxTileLoads::RunTest(const FString& Parameters) { getCacheDatabase(); pCacheDatabase->clearAll(); - int maxLoadsTarget = std::get(parameter); + int maxLoadsTarget = swl::get(parameter); context.setMaximumSimultaneousTileLoads(maxLoadsTarget); context.refreshTilesets(); diff --git a/Source/CesiumRuntime/Private/Tests/Google3dTilesLoadTest.cpp b/Source/CesiumRuntime/Private/Tests/Google3dTilesLoadTest.cpp index 94eea489f..4cedace0f 100644 --- a/Source/CesiumRuntime/Private/Tests/Google3dTilesLoadTest.cpp +++ b/Source/CesiumRuntime/Private/Tests/Google3dTilesLoadTest.cpp @@ -289,7 +289,7 @@ bool FGoogleTilesMaxTileLoads::RunTest(const FString& Parameters) { getCacheDatabase(); pCacheDatabase->clearAll(); - int maxLoadsTarget = std::get(parameter); + int maxLoadsTarget = swl::get(parameter); context.setMaximumSimultaneousTileLoads(maxLoadsTarget); context.refreshTilesets(); diff --git a/Source/CesiumRuntime/Public/CesiumFeatureIdSet.h b/Source/CesiumRuntime/Public/CesiumFeatureIdSet.h index 0fd86aedf..17406d30e 100644 --- a/Source/CesiumRuntime/Public/CesiumFeatureIdSet.h +++ b/Source/CesiumRuntime/Public/CesiumFeatureIdSet.h @@ -5,6 +5,7 @@ #include "CesiumFeatureIdAttribute.h" #include "CesiumFeatureIdTexture.h" #include "Kismet/BlueprintFunctionLibrary.h" +#include #include "CesiumFeatureIdSet.generated.h" namespace CesiumGltf { @@ -33,8 +34,8 @@ USTRUCT(BlueprintType) struct CESIUMRUNTIME_API FCesiumFeatureIdSet { GENERATED_USTRUCT_BODY() - using FeatureIDType = std::variant< - std::monostate, + using FeatureIDType = swl::variant< + swl::monostate, FCesiumFeatureIdAttribute, FCesiumFeatureIdTexture>; diff --git a/Source/CesiumRuntime/Public/CesiumMetadataValue.h b/Source/CesiumRuntime/Public/CesiumMetadataValue.h index d8daa68c3..cb2b5542a 100644 --- a/Source/CesiumRuntime/Public/CesiumMetadataValue.h +++ b/Source/CesiumRuntime/Public/CesiumMetadataValue.h @@ -9,6 +9,7 @@ #include "UObject/ObjectMacros.h" #include #include +#include #include "CesiumMetadataValue.generated.h" @@ -22,8 +23,8 @@ struct CESIUMRUNTIME_API FCesiumMetadataValue { private: #pragma region ValueType declaration template using ArrayView = CesiumGltf::PropertyArrayView; - using ValueType = std::variant< - std::monostate, + using ValueType = swl::variant< + swl::monostate, int8_t, uint8_t, int16_t, @@ -174,7 +175,7 @@ struct CESIUMRUNTIME_API FCesiumMetadataValue { /** * Constructs an empty metadata value with unknown type. */ - FCesiumMetadataValue() : _value(std::monostate{}), _valueType() {} + FCesiumMetadataValue() : _value(swl::monostate{}), _valueType() {} /** * Constructs a metadata value with the given input. @@ -209,7 +210,7 @@ struct CESIUMRUNTIME_API FCesiumMetadataValue { */ template explicit FCesiumMetadataValue(const std::optional& MaybeValue) - : _value(std::monostate{}), _valueType() { + : _value(swl::monostate{}), _valueType() { if (!MaybeValue) { return; } diff --git a/Source/CesiumRuntime/Public/CesiumPropertyArray.h b/Source/CesiumRuntime/Public/CesiumPropertyArray.h index 9743a8376..8918c3d2a 100644 --- a/Source/CesiumRuntime/Public/CesiumPropertyArray.h +++ b/Source/CesiumRuntime/Public/CesiumPropertyArray.h @@ -6,7 +6,7 @@ #include "CesiumGltf/PropertyTypeTraits.h" #include "CesiumMetadataValueType.h" #include "UObject/ObjectMacros.h" -#include +#include #include "CesiumPropertyArray.generated.h" /** @@ -21,7 +21,7 @@ struct CESIUMRUNTIME_API FCesiumPropertyArray { template using ArrayPropertyView = CesiumGltf::PropertyArrayView; - using ArrayType = std::variant< + using ArrayType = swl::variant< ArrayPropertyView, ArrayPropertyView, ArrayPropertyView, @@ -121,8 +121,8 @@ struct CESIUMRUNTIME_API FCesiumPropertyArray { private: template static bool - holdsArrayAlternative(const std::variant& variant) { - return std::holds_alternative>(variant); + holdsArrayAlternative(const swl::variant& variant) { + return swl::holds_alternative>(variant); } ArrayType _value; diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 967d912ed..2db00cc49 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -144,3 +144,6 @@ add_subdirectory(tidy-html5) # Don't build the cesium-native tests by default set_target_properties(cesium-native-tests PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1) + +add_subdirectory(swl-variant) +install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/swl-variant/include/" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/extern/swl-variant b/extern/swl-variant new file mode 160000 index 000000000..f99acd71c --- /dev/null +++ b/extern/swl-variant @@ -0,0 +1 @@ +Subproject commit f99acd71c9d9227de517b40684bd94544f2f8179 From f470d09a929c1af828c2bbb6f197614ee4370398 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 15 Jun 2024 13:29:44 +1000 Subject: [PATCH 074/119] Fix compile problems on Android. --- Source/CesiumRuntime/CesiumRuntime.Build.cs | 3 ++- Source/CesiumRuntime/Private/CesiumFeatureIdSet.cpp | 12 ++++++------ Source/CesiumRuntime/Public/CesiumFeatureIdSet.h | 6 +++--- extern/cesium-native | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index ef936c909..8421b9270 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -118,7 +118,8 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) "GLM_FORCE_EXPLICIT_CTOR", "GLM_FORCE_SIZE_T_LENGTH", "TIDY_STATIC", - "URI_STATIC_BUILD" + "URI_STATIC_BUILD", + "SWL_VARIANT_NO_CONSTEXPR_EMPLACE" } ); diff --git a/Source/CesiumRuntime/Private/CesiumFeatureIdSet.cpp b/Source/CesiumRuntime/Private/CesiumFeatureIdSet.cpp index 0365f20a1..4adc304ab 100644 --- a/Source/CesiumRuntime/Private/CesiumFeatureIdSet.cpp +++ b/Source/CesiumRuntime/Private/CesiumFeatureIdSet.cpp @@ -73,7 +73,7 @@ const FCesiumFeatureIdAttribute& UCesiumFeatureIdSetBlueprintLibrary::GetAsFeatureIDAttribute( UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet) { if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Attribute) { - return swl::get(FeatureIDSet._featureID); + return std::get(FeatureIDSet._featureID); } return EmptyFeatureIDAttribute; @@ -83,7 +83,7 @@ const FCesiumFeatureIdTexture& UCesiumFeatureIdSetBlueprintLibrary::GetAsFeatureIDTexture( UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet) { if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Texture) { - return swl::get(FeatureIDSet._featureID); + return std::get(FeatureIDSet._featureID); } return EmptyFeatureIDTexture; @@ -114,7 +114,7 @@ int64 UCesiumFeatureIdSetBlueprintLibrary::GetFeatureIDForVertex( int64 VertexIndex) { if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Attribute) { FCesiumFeatureIdAttribute attribute = - swl::get(FeatureIDSet._featureID); + std::get(FeatureIDSet._featureID); return UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDForVertex( attribute, VertexIndex); @@ -122,7 +122,7 @@ int64 UCesiumFeatureIdSetBlueprintLibrary::GetFeatureIDForVertex( if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Texture) { FCesiumFeatureIdTexture texture = - swl::get(FeatureIDSet._featureID); + std::get(FeatureIDSet._featureID); return UCesiumFeatureIdTextureBlueprintLibrary::GetFeatureIDForVertex( texture, VertexIndex); @@ -142,7 +142,7 @@ int64 UCesiumFeatureIdSetBlueprintLibrary::GetFeatureIDFromHit( const FHitResult& Hit) { if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Texture) { FCesiumFeatureIdTexture texture = - swl::get(FeatureIDSet._featureID); + std::get(FeatureIDSet._featureID); return UCesiumFeatureIdTextureBlueprintLibrary::GetFeatureIDFromHit( texture, Hit); @@ -170,7 +170,7 @@ int64 UCesiumFeatureIdSetBlueprintLibrary::GetFeatureIDFromHit( if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Attribute) { FCesiumFeatureIdAttribute attribute = - swl::get(FeatureIDSet._featureID); + std::get(FeatureIDSet._featureID); return UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDForVertex( attribute, VertexIndex); diff --git a/Source/CesiumRuntime/Public/CesiumFeatureIdSet.h b/Source/CesiumRuntime/Public/CesiumFeatureIdSet.h index 17406d30e..92f9d2e33 100644 --- a/Source/CesiumRuntime/Public/CesiumFeatureIdSet.h +++ b/Source/CesiumRuntime/Public/CesiumFeatureIdSet.h @@ -5,7 +5,7 @@ #include "CesiumFeatureIdAttribute.h" #include "CesiumFeatureIdTexture.h" #include "Kismet/BlueprintFunctionLibrary.h" -#include +#include #include "CesiumFeatureIdSet.generated.h" namespace CesiumGltf { @@ -34,8 +34,8 @@ USTRUCT(BlueprintType) struct CESIUMRUNTIME_API FCesiumFeatureIdSet { GENERATED_USTRUCT_BODY() - using FeatureIDType = swl::variant< - swl::monostate, + using FeatureIDType = std::variant< + std::monostate, FCesiumFeatureIdAttribute, FCesiumFeatureIdTexture>; diff --git a/extern/cesium-native b/extern/cesium-native index 44987e806..9fe0d7aa0 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 44987e806f6f9f90db9ca38da4a8450bac6c539d +Subproject commit 9fe0d7aa058380e7dd0f7c2a4e93d6f123780825 From cc5640b47b9d1ccdb58a31c6d1aecbebdb041ee4 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sun, 16 Jun 2024 09:30:42 +1000 Subject: [PATCH 075/119] Fix swl-variant problem on Windows. --- .gitmodules | 2 +- extern/swl-variant | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index d47031662..cd261dd04 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,4 +9,4 @@ url = https://github.com/htacg/tidy-html5 [submodule "extern/swl-variant"] path = extern/swl-variant - url = https://github.com/groundswellaudio/swl-variant.git + url = https://github.com/kring/swl-variant.git diff --git a/extern/swl-variant b/extern/swl-variant index f99acd71c..8af20f431 160000 --- a/extern/swl-variant +++ b/extern/swl-variant @@ -1 +1 @@ -Subproject commit f99acd71c9d9227de517b40684bd94544f2f8179 +Subproject commit 8af20f43129ec66159eecd62a48eafdb7a2f74ca From 6e76d42dcf9fb0ffefd31ca1c0b448a6b849a70d Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 17 Jun 2024 19:53:06 +1000 Subject: [PATCH 076/119] Specify VCPKG_PLATFORM_TOOLSET_VERSION=14.34 on Windows. --- extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake index 1286e694c..5051d884b 100644 --- a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake @@ -17,3 +17,4 @@ set(VCPKG_ENV_PASSTHROUGH "UNREAL_ENGINE_ROOT") # https://github.com/EpicGames/UnrealEngine/blob/5.2.1-release/Engine/Source/Programs/UnrealBuildTool/Platform/Windows/VCToolChain.cs set(VCPKG_CXX_FLAGS "/MD /Zp8") set(VCPKG_C_FLAGS "${VCPKG_CXX_FLAGS}") +set(VCPKG_PLATFORM_TOOLSET_VERSION "14.34") From b6d75948652052ad4b2156bc9d1bcb2fb404bf5d Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 18 Jun 2024 11:09:29 +1000 Subject: [PATCH 077/119] Update cesium-native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 9fe0d7aa0..8158fa0f3 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 9fe0d7aa058380e7dd0f7c2a4e93d6f123780825 +Subproject commit 8158fa0f3a3f924cc2cd43ecf63d12264b6aa101 From 14752f349f1f3d822f47b90949fe155e856e3418 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 18 Jun 2024 15:58:10 +1000 Subject: [PATCH 078/119] Update cesium-native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 8158fa0f3..62d434619 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 8158fa0f3a3f924cc2cd43ecf63d12264b6aa101 +Subproject commit 62d43461904ef16bf150f04c5ae48f6435bbd457 From 6110ba1a049af5249cda241b947e436266e722a4 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 18 Jun 2024 16:14:43 +1000 Subject: [PATCH 079/119] Update cesium-native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 62d434619..91dc6cdb9 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 62d43461904ef16bf150f04c5ae48f6435bbd457 +Subproject commit 91dc6cdb93b777477490c7b5874116b01fe384e7 From e3b342f06f2d3e4a750c924528d00ab74e047df7 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 19 Jun 2024 18:36:11 +1000 Subject: [PATCH 080/119] Store PropertyArrayCopy in variants. --- .../Private/CesiumPropertyTableProperty.cpp | 16 +++++++++------- .../Private/CesiumPropertyTextureProperty.cpp | 13 +++++++------ .../Private/Tests/CesiumMetadataValue.spec.cpp | 8 ++++---- .../Private/Tests/CesiumPropertyArray.spec.cpp | 8 ++++---- .../CesiumRuntime/Public/CesiumMetadataValue.h | 6 +++--- .../CesiumRuntime/Public/CesiumPropertyArray.h | 18 +++++++++++++++--- extern/cesium-native | 2 +- extern/swl-variant | 2 +- 8 files changed, 44 insertions(+), 29 deletions(-) diff --git a/Source/CesiumRuntime/Private/CesiumPropertyTableProperty.cpp b/Source/CesiumRuntime/Private/CesiumPropertyTableProperty.cpp index a3aba9f56..6d057ffeb 100644 --- a/Source/CesiumRuntime/Private/CesiumPropertyTableProperty.cpp +++ b/Source/CesiumRuntime/Private/CesiumPropertyTableProperty.cpp @@ -1323,7 +1323,8 @@ FCesiumMetadataValue UCesiumPropertyTablePropertyBlueprintLibrary::GetRawValue( // size() returns zero if the view is invalid. if (FeatureID >= 0 && FeatureID < view.size()) { - return FCesiumMetadataValue(view.getRaw(FeatureID)); + return FCesiumMetadataValue( + propertyValueViewToCopy(view.getRaw(FeatureID))); } return FCesiumMetadataValue(); @@ -1343,7 +1344,7 @@ FCesiumMetadataValue UCesiumPropertyTablePropertyBlueprintLibrary::GetOffset( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no offset is specified. - return FCesiumMetadataValue(view.offset()); + return FCesiumMetadataValue(propertyValueViewToCopy(view.offset())); }); } @@ -1355,7 +1356,7 @@ FCesiumMetadataValue UCesiumPropertyTablePropertyBlueprintLibrary::GetScale( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no scale is specified. - return FCesiumMetadataValue(view.scale()); + return FCesiumMetadataValue(propertyValueViewToCopy(view.scale())); }); } @@ -1368,7 +1369,7 @@ UCesiumPropertyTablePropertyBlueprintLibrary::GetMinimumValue( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no min is specified. - return FCesiumMetadataValue(view.min()); + return FCesiumMetadataValue(propertyValueViewToCopy(view.min())); }); } @@ -1381,7 +1382,7 @@ UCesiumPropertyTablePropertyBlueprintLibrary::GetMaximumValue( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no max is specified. - return FCesiumMetadataValue(view.max()); + return FCesiumMetadataValue(propertyValueViewToCopy(view.max())); }); } @@ -1394,7 +1395,7 @@ UCesiumPropertyTablePropertyBlueprintLibrary::GetNoDataValue( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no "no data" value is specified. - return FCesiumMetadataValue(view.noData()); + return FCesiumMetadataValue(propertyValueViewToCopy(view.noData())); }); } @@ -1407,7 +1408,8 @@ UCesiumPropertyTablePropertyBlueprintLibrary::GetDefaultValue( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no default value is specified. - return FCesiumMetadataValue(view.defaultValue()); + return FCesiumMetadataValue( + propertyValueViewToCopy(view.defaultValue())); }); } diff --git a/Source/CesiumRuntime/Private/CesiumPropertyTextureProperty.cpp b/Source/CesiumRuntime/Private/CesiumPropertyTextureProperty.cpp index 399805414..0cd8653fa 100644 --- a/Source/CesiumRuntime/Private/CesiumPropertyTextureProperty.cpp +++ b/Source/CesiumRuntime/Private/CesiumPropertyTextureProperty.cpp @@ -770,7 +770,7 @@ FCesiumMetadataValue UCesiumPropertyTexturePropertyBlueprintLibrary::GetOffset( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no offset is specified. - return FCesiumMetadataValue(view.offset()); + return FCesiumMetadataValue(propertyValueViewToCopy(view.offset())); }); } @@ -782,7 +782,7 @@ FCesiumMetadataValue UCesiumPropertyTexturePropertyBlueprintLibrary::GetScale( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no scale is specified. - return FCesiumMetadataValue(view.scale()); + return FCesiumMetadataValue(propertyValueViewToCopy(view.scale())); }); } @@ -795,7 +795,7 @@ UCesiumPropertyTexturePropertyBlueprintLibrary::GetMinimumValue( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no min is specified. - return FCesiumMetadataValue(view.min()); + return FCesiumMetadataValue(propertyValueViewToCopy(view.min())); }); } @@ -808,7 +808,7 @@ UCesiumPropertyTexturePropertyBlueprintLibrary::GetMaximumValue( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no max is specified. - return FCesiumMetadataValue(view.max()); + return FCesiumMetadataValue(propertyValueViewToCopy(view.max())); }); } @@ -821,7 +821,7 @@ UCesiumPropertyTexturePropertyBlueprintLibrary::GetNoDataValue( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no "no data" value is specified. - return FCesiumMetadataValue(view.noData()); + return FCesiumMetadataValue(propertyValueViewToCopy(view.noData())); }); } @@ -834,6 +834,7 @@ UCesiumPropertyTexturePropertyBlueprintLibrary::GetDefaultValue( Property._normalized, [](const auto& view) -> FCesiumMetadataValue { // Returns an empty value if no default value is specified. - return FCesiumMetadataValue(view.defaultValue()); + return FCesiumMetadataValue( + propertyValueViewToCopy(view.defaultValue())); }); } diff --git a/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp index 69a1ea31d..0d661d2cd 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp @@ -90,7 +90,7 @@ void FCesiumMetadataValueSpec::Define() { }); It("constructs array value with correct type", [this]() { - PropertyArrayView arrayView; + PropertyArrayCopy arrayView; FCesiumMetadataValue value(arrayView); FCesiumMetadataValueType valueType = UCesiumMetadataValueBlueprintLibrary::GetValueType(value); @@ -1131,7 +1131,7 @@ void FCesiumMetadataValueSpec::Define() { It("gets array from array value", [this]() { std::vector arrayValues{1, 2}; - PropertyArrayView arrayView(std::move(arrayValues)); + PropertyArrayCopy arrayView(std::move(arrayValues)); FCesiumMetadataValue value(arrayView); FCesiumPropertyArray array = @@ -1196,7 +1196,7 @@ void FCesiumMetadataValueSpec::Define() { }); It("returns false for array value", [this]() { - PropertyArrayView arrayView; + PropertyArrayCopy arrayView; FCesiumMetadataValue value(arrayView); TestFalse( "IsEmpty", @@ -1217,7 +1217,7 @@ void FCesiumMetadataValueSpec::Define() { values.Add({"scalar", FCesiumMetadataValue(-1)}); values.Add({"vec2", FCesiumMetadataValue(glm::u8vec2(2, 3))}); values.Add( - {"array", FCesiumMetadataValue(PropertyArrayView({1, 2, 3}))}); + {"array", FCesiumMetadataValue(PropertyArrayCopy({1, 2, 3}))}); const auto strings = UCesiumMetadataValueBlueprintLibrary::GetValuesAsStrings(values); diff --git a/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp index ef07d6eb5..5829c02cc 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp @@ -37,7 +37,7 @@ void FCesiumPropertyArraySpec::Define() { }); It("constructs empty array from empty view", [this]() { - PropertyArrayView arrayView; + PropertyArrayCopy arrayView; FCesiumPropertyArray array(arrayView); TestEqual( "size", @@ -60,7 +60,7 @@ void FCesiumPropertyArraySpec::Define() { It("constructs non-empty array", [this]() { std::vector values{1, 2, 3, 4}; - PropertyArrayView arrayView(std::move(values)); + PropertyArrayCopy arrayView(std::move(values)); FCesiumPropertyArray array(arrayView); TestEqual( "size", @@ -85,7 +85,7 @@ void FCesiumPropertyArraySpec::Define() { Describe("GetValue", [this]() { It("gets bogus value for out-of-bounds index", [this]() { std::vector values{1}; - PropertyArrayView arrayView(std::move(values)); + PropertyArrayCopy arrayView(std::move(values)); FCesiumPropertyArray array(arrayView); TestEqual( "size", @@ -114,7 +114,7 @@ void FCesiumPropertyArraySpec::Define() { It("gets value for valid index", [this]() { std::vector values{1, 2, 3, 4}; - PropertyArrayView arrayView(std::move(values)); + PropertyArrayCopy arrayView(std::move(values)); FCesiumPropertyArray array(arrayView); TestEqual( "size", diff --git a/Source/CesiumRuntime/Public/CesiumMetadataValue.h b/Source/CesiumRuntime/Public/CesiumMetadataValue.h index cb2b5542a..034bdacbc 100644 --- a/Source/CesiumRuntime/Public/CesiumMetadataValue.h +++ b/Source/CesiumRuntime/Public/CesiumMetadataValue.h @@ -22,7 +22,7 @@ struct CESIUMRUNTIME_API FCesiumMetadataValue { private: #pragma region ValueType declaration - template using ArrayView = CesiumGltf::PropertyArrayView; + template using ArrayView = CesiumGltf::PropertyArrayCopy; using ValueType = swl::variant< swl::monostate, int8_t, @@ -107,8 +107,8 @@ struct CESIUMRUNTIME_API FCesiumMetadataValue { ArrayView, ArrayView, ArrayView, - ArrayView, - ArrayView, + CesiumGltf::PropertyArrayView, + CesiumGltf::PropertyArrayView, ArrayView>, ArrayView>, ArrayView>, diff --git a/Source/CesiumRuntime/Public/CesiumPropertyArray.h b/Source/CesiumRuntime/Public/CesiumPropertyArray.h index 8918c3d2a..1b1af6e15 100644 --- a/Source/CesiumRuntime/Public/CesiumPropertyArray.h +++ b/Source/CesiumRuntime/Public/CesiumPropertyArray.h @@ -19,7 +19,7 @@ struct CESIUMRUNTIME_API FCesiumPropertyArray { private: #pragma region ArrayType template - using ArrayPropertyView = CesiumGltf::PropertyArrayView; + using ArrayPropertyView = CesiumGltf::PropertyArrayCopy; using ArrayType = swl::variant< ArrayPropertyView, @@ -32,8 +32,8 @@ struct CESIUMRUNTIME_API FCesiumPropertyArray { ArrayPropertyView, ArrayPropertyView, ArrayPropertyView, - ArrayPropertyView, - ArrayPropertyView, + CesiumGltf::PropertyArrayView, + CesiumGltf::PropertyArrayView, ArrayPropertyView>, ArrayPropertyView>, ArrayPropertyView>, @@ -106,6 +106,18 @@ struct CESIUMRUNTIME_API FCesiumPropertyArray { * Constructs an array instance. * @param value The property array view that will be stored in this struct */ + template + FCesiumPropertyArray(CesiumGltf::PropertyArrayCopy value) + : _value(value), _elementType() { + ECesiumMetadataType type = + ECesiumMetadataType(CesiumGltf::TypeToPropertyType::value); + ECesiumMetadataComponentType componentType = ECesiumMetadataComponentType( + CesiumGltf::TypeToPropertyType::component); + bool isArray = false; + + _elementType = {type, componentType, isArray}; + } + template FCesiumPropertyArray(CesiumGltf::PropertyArrayView value) : _value(value), _elementType() { diff --git a/extern/cesium-native b/extern/cesium-native index 91dc6cdb9..d9f7a6cee 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 91dc6cdb93b777477490c7b5874116b01fe384e7 +Subproject commit d9f7a6ceed7a71dadc3a3834d835b2558daf619b diff --git a/extern/swl-variant b/extern/swl-variant index 8af20f431..d5524cb15 160000 --- a/extern/swl-variant +++ b/extern/swl-variant @@ -1 +1 @@ -Subproject commit 8af20f43129ec66159eecd62a48eafdb7a2f74ca +Subproject commit d5524cb15f0d3582e0ddb5709ea3677a7a68d289 From e614d8b4e4ad92eca5f20611f7d213ef26f2e750 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 20 Jun 2024 09:42:21 +1000 Subject: [PATCH 081/119] Fix test failures caused by bad tests. These were moving a vector elsewhere and then comparing the original's size. The size of a vector after it is moved away is zero. The only reason these tests were passing previously was because a accidental `const` in the PropertyArrayView(vector) constructor made the move not actually work. --- .../Private/Tests/CesiumMetadataValue.spec.cpp | 2 +- .../Private/Tests/CesiumPropertyArray.spec.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp index 0d661d2cd..bc3c37589 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumMetadataValue.spec.cpp @@ -1131,7 +1131,7 @@ void FCesiumMetadataValueSpec::Define() { It("gets array from array value", [this]() { std::vector arrayValues{1, 2}; - PropertyArrayCopy arrayView(std::move(arrayValues)); + PropertyArrayCopy arrayView = std::vector(arrayValues); FCesiumMetadataValue value(arrayView); FCesiumPropertyArray array = diff --git a/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp b/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp index 5829c02cc..c631610da 100644 --- a/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp +++ b/Source/CesiumRuntime/Private/Tests/CesiumPropertyArray.spec.cpp @@ -60,7 +60,7 @@ void FCesiumPropertyArraySpec::Define() { It("constructs non-empty array", [this]() { std::vector values{1, 2, 3, 4}; - PropertyArrayCopy arrayView(std::move(values)); + PropertyArrayCopy arrayView = std::vector(values); FCesiumPropertyArray array(arrayView); TestEqual( "size", @@ -85,7 +85,7 @@ void FCesiumPropertyArraySpec::Define() { Describe("GetValue", [this]() { It("gets bogus value for out-of-bounds index", [this]() { std::vector values{1}; - PropertyArrayCopy arrayView(std::move(values)); + PropertyArrayCopy arrayView = std::vector(values); FCesiumPropertyArray array(arrayView); TestEqual( "size", @@ -114,7 +114,7 @@ void FCesiumPropertyArraySpec::Define() { It("gets value for valid index", [this]() { std::vector values{1, 2, 3, 4}; - PropertyArrayCopy arrayView(std::move(values)); + PropertyArrayCopy arrayView = std::vector(values); FCesiumPropertyArray array(arrayView); TestEqual( "size", From 9ef66c279e2e1a25e6da35a29350cf70d98ee026 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 20 Jun 2024 19:01:19 +1000 Subject: [PATCH 082/119] View plus explicit storage for MetadataValue / PropertyArray --- .../Private/CesiumMetadataValue.cpp | 29 +++++++++++++ .../Private/CesiumPropertyArray.cpp | 35 +++++++++++++++ .../Public/CesiumMetadataValue.h | 43 +++++++++++++++---- .../Public/CesiumPropertyArray.h | 23 +++++++--- extern/cesium-native | 2 +- 5 files changed, 117 insertions(+), 15 deletions(-) create mode 100644 Source/CesiumRuntime/Private/CesiumPropertyArray.cpp diff --git a/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp b/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp index bb87868fe..e90205e07 100644 --- a/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp +++ b/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp @@ -8,6 +8,35 @@ using namespace CesiumGltf; +FCesiumMetadataValue::FCesiumMetadataValue(FCesiumMetadataValue&& rhs) = + default; + +FCesiumMetadataValue& +FCesiumMetadataValue::operator=(FCesiumMetadataValue&& rhs) = default; + +FCesiumMetadataValue::FCesiumMetadataValue(const FCesiumMetadataValue& rhs) + : _value(), _valueType(rhs._valueType), _storage(rhs._storage) { + swl::visit( + [this](const auto& value) { + if constexpr (IsMetadataArray::value) { + if (!this->_storage.empty()) { + this->_value = decltype(value)(this->_storage); + } else { + this->_value = value; + } + } else { + this->_value = value; + } + }, + rhs._value); +} + +FCesiumMetadataValue& +FCesiumMetadataValue::operator=(const FCesiumMetadataValue& rhs) { + *this = FCesiumMetadataValue(rhs); + return *this; +} + ECesiumMetadataBlueprintType UCesiumMetadataValueBlueprintLibrary::GetBlueprintType( UPARAM(ref) const FCesiumMetadataValue& Value) { diff --git a/Source/CesiumRuntime/Private/CesiumPropertyArray.cpp b/Source/CesiumRuntime/Private/CesiumPropertyArray.cpp new file mode 100644 index 000000000..a40fc0c7e --- /dev/null +++ b/Source/CesiumRuntime/Private/CesiumPropertyArray.cpp @@ -0,0 +1,35 @@ +// Copyright 2020-2024 CesiumGS, Inc. and Contributors + +#include "CesiumPropertyArray.h" +#include + +using namespace CesiumGltf; + +FCesiumPropertyArray::FCesiumPropertyArray(FCesiumPropertyArray&& rhs) = + default; + +FCesiumPropertyArray& +FCesiumPropertyArray::operator=(FCesiumPropertyArray&& rhs) = default; + +FCesiumPropertyArray::FCesiumPropertyArray(const FCesiumPropertyArray& rhs) + : _value(), _elementType(rhs._elementType), _storage(rhs._storage) { + swl::visit( + [this](const auto& value) { + if constexpr (IsMetadataArray::value) { + if (!this->_storage.empty()) { + this->_value = decltype(value)(this->_storage); + } else { + this->_value = value; + } + } else { + this->_value = value; + } + }, + rhs._value); +} + +FCesiumPropertyArray& +FCesiumPropertyArray::operator=(const FCesiumPropertyArray& rhs) { + *this = FCesiumPropertyArray(rhs); + return *this; +} diff --git a/Source/CesiumRuntime/Public/CesiumMetadataValue.h b/Source/CesiumRuntime/Public/CesiumMetadataValue.h index 034bdacbc..9e2c99640 100644 --- a/Source/CesiumRuntime/Public/CesiumMetadataValue.h +++ b/Source/CesiumRuntime/Public/CesiumMetadataValue.h @@ -22,7 +22,7 @@ struct CESIUMRUNTIME_API FCesiumMetadataValue { private: #pragma region ValueType declaration - template using ArrayView = CesiumGltf::PropertyArrayCopy; + template using ArrayView = CesiumGltf::PropertyArrayView; using ValueType = swl::variant< swl::monostate, int8_t, @@ -107,8 +107,8 @@ struct CESIUMRUNTIME_API FCesiumMetadataValue { ArrayView, ArrayView, ArrayView, - CesiumGltf::PropertyArrayView, - CesiumGltf::PropertyArrayView, + ArrayView, + ArrayView, ArrayView>, ArrayView>, ArrayView>, @@ -175,7 +175,7 @@ struct CESIUMRUNTIME_API FCesiumMetadataValue { /** * Constructs an empty metadata value with unknown type. */ - FCesiumMetadataValue() : _value(swl::monostate{}), _valueType() {} + FCesiumMetadataValue() : _value(swl::monostate{}), _valueType(), _storage() {} /** * Constructs a metadata value with the given input. @@ -183,7 +183,8 @@ struct CESIUMRUNTIME_API FCesiumMetadataValue { * @param Value The value to be stored in this struct. */ template - explicit FCesiumMetadataValue(const T& Value) : _value(Value), _valueType() { + explicit FCesiumMetadataValue(const T& Value) + : _value(Value), _valueType(), _storage() { ECesiumMetadataType type; ECesiumMetadataComponentType componentType; bool isArray; @@ -203,6 +204,24 @@ struct CESIUMRUNTIME_API FCesiumMetadataValue { _valueType = {type, componentType, isArray}; } + template + explicit FCesiumMetadataValue( + const CesiumGltf::PropertyArrayCopy& Copy) + : FCesiumMetadataValue(CesiumGltf::PropertyArrayCopy(Copy)) {} + + template + explicit FCesiumMetadataValue(CesiumGltf::PropertyArrayCopy&& Copy) + : _value(), _valueType(), _storage() { + this->_value = std::move(Copy).toViewAndExternalBuffer(this->_storage); + + ECesiumMetadataType type = + ECesiumMetadataType(CesiumGltf::TypeToPropertyType::value); + ECesiumMetadataComponentType componentType = ECesiumMetadataComponentType( + CesiumGltf::TypeToPropertyType::component); + bool isArray = true; + this->_valueType = {type, componentType, isArray}; + } + /** * Constructs a metadata value with the given optional input. * @@ -210,18 +229,26 @@ struct CESIUMRUNTIME_API FCesiumMetadataValue { */ template explicit FCesiumMetadataValue(const std::optional& MaybeValue) - : _value(swl::monostate{}), _valueType() { + : _value(), _valueType(), _storage() { if (!MaybeValue) { return; } - _value = *MaybeValue; - _valueType = TypeToMetadataValueType(); + FCesiumMetadataValue temp(*MaybeValue); + this->_value = std::move(temp._value); + this->_valueType = std::move(temp._valueType); + this->_storage = std::move(temp._storage); } + FCesiumMetadataValue(FCesiumMetadataValue&& rhs); + FCesiumMetadataValue& operator=(FCesiumMetadataValue&& rhs); + FCesiumMetadataValue(const FCesiumMetadataValue& rhs); + FCesiumMetadataValue& operator=(const FCesiumMetadataValue& rhs); + private: ValueType _value; FCesiumMetadataValueType _valueType; + std::vector _storage; friend class UCesiumMetadataValueBlueprintLibrary; }; diff --git a/Source/CesiumRuntime/Public/CesiumPropertyArray.h b/Source/CesiumRuntime/Public/CesiumPropertyArray.h index 1b1af6e15..dab0d63a7 100644 --- a/Source/CesiumRuntime/Public/CesiumPropertyArray.h +++ b/Source/CesiumRuntime/Public/CesiumPropertyArray.h @@ -19,7 +19,7 @@ struct CESIUMRUNTIME_API FCesiumPropertyArray { private: #pragma region ArrayType template - using ArrayPropertyView = CesiumGltf::PropertyArrayCopy; + using ArrayPropertyView = CesiumGltf::PropertyArrayView; using ArrayType = swl::variant< ArrayPropertyView, @@ -32,8 +32,8 @@ struct CESIUMRUNTIME_API FCesiumPropertyArray { ArrayPropertyView, ArrayPropertyView, ArrayPropertyView, - CesiumGltf::PropertyArrayView, - CesiumGltf::PropertyArrayView, + ArrayPropertyView, + ArrayPropertyView, ArrayPropertyView>, ArrayPropertyView>, ArrayPropertyView>, @@ -107,8 +107,9 @@ struct CESIUMRUNTIME_API FCesiumPropertyArray { * @param value The property array view that will be stored in this struct */ template - FCesiumPropertyArray(CesiumGltf::PropertyArrayCopy value) - : _value(value), _elementType() { + FCesiumPropertyArray(CesiumGltf::PropertyArrayCopy&& value) + : _value(), _elementType(), _storage() { + this->_value = std::move(value).toViewAndExternalBuffer(this->_storage); ECesiumMetadataType type = ECesiumMetadataType(CesiumGltf::TypeToPropertyType::value); ECesiumMetadataComponentType componentType = ECesiumMetadataComponentType( @@ -119,7 +120,11 @@ struct CESIUMRUNTIME_API FCesiumPropertyArray { } template - FCesiumPropertyArray(CesiumGltf::PropertyArrayView value) + FCesiumPropertyArray(const CesiumGltf::PropertyArrayCopy& value) + : FCesiumPropertyArray(CesiumGltf::PropertyArrayCopy(value)) {} + + template + FCesiumPropertyArray(const CesiumGltf::PropertyArrayView& value) : _value(value), _elementType() { ECesiumMetadataType type = ECesiumMetadataType(CesiumGltf::TypeToPropertyType::value); @@ -130,6 +135,11 @@ struct CESIUMRUNTIME_API FCesiumPropertyArray { _elementType = {type, componentType, isArray}; } + FCesiumPropertyArray(FCesiumPropertyArray&& rhs); + FCesiumPropertyArray& operator=(FCesiumPropertyArray&& rhs); + FCesiumPropertyArray(const FCesiumPropertyArray& rhs); + FCesiumPropertyArray& operator=(const FCesiumPropertyArray& rhs); + private: template static bool @@ -139,6 +149,7 @@ struct CESIUMRUNTIME_API FCesiumPropertyArray { ArrayType _value; FCesiumMetadataValueType _elementType; + std::vector _storage; friend class UCesiumPropertyArrayBlueprintLibrary; }; diff --git a/extern/cesium-native b/extern/cesium-native index d9f7a6cee..4319aa656 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit d9f7a6ceed7a71dadc3a3834d835b2558daf619b +Subproject commit 4319aa6562a79fdcbed1a20163445309b400757f From de4c5e0bddf7a7c3d7468714b2b2d34cf3e31a25 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 20 Jun 2024 19:33:03 +1000 Subject: [PATCH 083/119] Test build with origin swl-variant. --- extern/swl-variant | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/swl-variant b/extern/swl-variant index d5524cb15..8af20f431 160000 --- a/extern/swl-variant +++ b/extern/swl-variant @@ -1 +1 @@ -Subproject commit d5524cb15f0d3582e0ddb5709ea3677a7a68d289 +Subproject commit 8af20f43129ec66159eecd62a48eafdb7a2f74ca From 1751fc2c5e45d11f52dafe692db275968090e4ee Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 07:19:17 +1000 Subject: [PATCH 084/119] Run Apple builds on macos-13-arm64. We can't use macos-14 because it doesn't have xcode 14.2, which Unreal requires. --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b44306f74..64ec79ba0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,7 @@ jobs: uses: ./.github/workflows/buildMac.yml secrets: inherit with: - runner-label: macos-12 + runner-label: macos-13-arm64 unreal-engine-version: "5.2.0" unreal-engine-zip: "s3://cesium-unreal-engine/UE_52_macOS.zip" unreal-program-name: "UE_5.2" @@ -70,7 +70,7 @@ jobs: uses: ./.github/workflows/buildiOS.yml secrets: inherit with: - runner-label: macos-12 + runner-label: macos-13-arm64 unreal-engine-version: "5.2.0" unreal-engine-zip: "s3://cesium-unreal-engine/UE_52_macOS.zip" unreal-program-name: "UE_5.2" @@ -193,7 +193,7 @@ jobs: uses: ./.github/workflows/buildMac.yml secrets: inherit with: - runner-label: macos-12 + runner-label: macos-13-arm64 unreal-engine-version: "5.3.0" unreal-engine-zip: "s3://cesium-unreal-engine/5.3.0/UE_53_macOS.zip" unreal-program-name: "UE_5.3" @@ -203,7 +203,7 @@ jobs: uses: ./.github/workflows/buildiOS.yml secrets: inherit with: - runner-label: macos-12 + runner-label: macos-13-arm64 unreal-engine-version: "5.3.0" unreal-engine-zip: "s3://cesium-unreal-engine/5.3.0/UE_53_macOS.zip" unreal-program-name: "UE_5.3" @@ -326,7 +326,7 @@ jobs: uses: ./.github/workflows/buildMac.yml secrets: inherit with: - runner-label: macos-13 + runner-label: macos-13-arm64 unreal-engine-version: "5.4.0" unreal-engine-zip: "s3://cesium-unreal-engine/5.4.0/UE_54_macOS.zip" unreal-program-name: "UE_5.4" @@ -336,7 +336,7 @@ jobs: uses: ./.github/workflows/buildiOS.yml secrets: inherit with: - runner-label: macos-13 + runner-label: macos-13-arm64 unreal-engine-version: "5.4.0" unreal-engine-zip: "s3://cesium-unreal-engine/5.4.0/UE_54_macOS.zip" unreal-program-name: "UE_5.4" From e8621c07e47a705b2a929f0e6132f0a1df4946f7 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 07:31:31 +1000 Subject: [PATCH 085/119] Combine macOS / iOS build jobs. --- .github/workflows/build.yml | 48 ++------- .github/workflows/buildAndroid.yml | 2 +- .../{buildMac.yml => buildApple.yml} | 39 ++++---- .github/workflows/buildLinux.yml | 2 +- .github/workflows/buildWindows.yml | 2 +- .github/workflows/buildiOS.yml | 98 ------------------- 6 files changed, 34 insertions(+), 157 deletions(-) rename .github/workflows/{buildMac.yml => buildApple.yml} (78%) delete mode 100644 .github/workflows/buildiOS.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64ec79ba0..ccfa6d268 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,25 +56,15 @@ jobs: unreal-program-name: "UE_5.2" upload-package-base-name: "CesiumForUnreal-52-linux" clang-version: "v21_clang-15.0.1-centos7" - macOS52: - uses: ./.github/workflows/buildMac.yml + Apple52: + uses: ./.github/workflows/buildApple.yml secrets: inherit with: runner-label: macos-13-arm64 unreal-engine-version: "5.2.0" unreal-engine-zip: "s3://cesium-unreal-engine/UE_52_macOS.zip" unreal-program-name: "UE_5.2" - upload-package-base-name: "CesiumForUnreal-52-macos" - xcode-version: "14.2" - iOS52: - uses: ./.github/workflows/buildiOS.yml - secrets: inherit - with: - runner-label: macos-13-arm64 - unreal-engine-version: "5.2.0" - unreal-engine-zip: "s3://cesium-unreal-engine/UE_52_macOS.zip" - unreal-program-name: "UE_5.2" - upload-package-base-name: "CesiumForUnreal-52-ios" + upload-package-base-name: "CesiumForUnreal-52-apple" xcode-version: "14.2" Combine52: runs-on: ubuntu-latest @@ -189,25 +179,15 @@ jobs: unreal-program-name: "UE_5.3" upload-package-base-name: "CesiumForUnreal-53-linux" clang-version: "v22_clang-16.0.6-centos7" - macOS53: - uses: ./.github/workflows/buildMac.yml + Apple53: + uses: ./.github/workflows/buildApple.yml secrets: inherit with: runner-label: macos-13-arm64 unreal-engine-version: "5.3.0" unreal-engine-zip: "s3://cesium-unreal-engine/5.3.0/UE_53_macOS.zip" unreal-program-name: "UE_5.3" - upload-package-base-name: "CesiumForUnreal-53-macos" - xcode-version: "14.2" - iOS53: - uses: ./.github/workflows/buildiOS.yml - secrets: inherit - with: - runner-label: macos-13-arm64 - unreal-engine-version: "5.3.0" - unreal-engine-zip: "s3://cesium-unreal-engine/5.3.0/UE_53_macOS.zip" - unreal-program-name: "UE_5.3" - upload-package-base-name: "CesiumForUnreal-53-ios" + upload-package-base-name: "CesiumForUnreal-53-apple" xcode-version: "14.2" Combine53: runs-on: ubuntu-latest @@ -322,25 +302,15 @@ jobs: unreal-program-name: "UE_5.4" upload-package-base-name: "CesiumForUnreal-54-linux" clang-version: "v22_clang-16.0.6-centos7" - macOS54: - uses: ./.github/workflows/buildMac.yml - secrets: inherit - with: - runner-label: macos-13-arm64 - unreal-engine-version: "5.4.0" - unreal-engine-zip: "s3://cesium-unreal-engine/5.4.0/UE_54_macOS.zip" - unreal-program-name: "UE_5.4" - upload-package-base-name: "CesiumForUnreal-54-macos" - xcode-version: "14.2" - iOS54: - uses: ./.github/workflows/buildiOS.yml + Apple54: + uses: ./.github/workflows/buildApple.yml secrets: inherit with: runner-label: macos-13-arm64 unreal-engine-version: "5.4.0" unreal-engine-zip: "s3://cesium-unreal-engine/5.4.0/UE_54_macOS.zip" unreal-program-name: "UE_5.4" - upload-package-base-name: "CesiumForUnreal-54-ios" + upload-package-base-name: "CesiumForUnreal-54-apple" xcode-version: "14.2" Combine54: runs-on: ubuntu-latest diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index 55d7f0dc5..40d7b786e 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -76,7 +76,7 @@ jobs: rm -r -fo extern - name: Overwrite plugin engine version run: | - ((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.1.0"','"EngineVersion": "${{ inputs.unreal-engine-version }}"') | Set-Content -Path CesiumForUnreal.uplugin + ((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.2.0"','"EngineVersion": "${{ inputs.unreal-engine-version }}"') | Set-Content -Path CesiumForUnreal.uplugin - name: Customize BuildConfiguration.xml run: | mkdir -p "$env:USERPROFILE\AppData\Roaming\Unreal Engine\UnrealBuildTool" diff --git a/.github/workflows/buildMac.yml b/.github/workflows/buildApple.yml similarity index 78% rename from .github/workflows/buildMac.yml rename to .github/workflows/buildApple.yml index fa9342691..60825b2d3 100644 --- a/.github/workflows/buildMac.yml +++ b/.github/workflows/buildApple.yml @@ -25,17 +25,6 @@ jobs: build: runs-on: ${{ inputs.runner-label }} steps: - # - name: Install XCode ${{ inputs.xcode-version }} - # env: - # AWS_REGION: us-east-1 - # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # run: | - # aws s3 cp s3://cesium-unreal-engine/Xcode/Xcode_${{ inputs.xcode-version }}.xip . --no-progress - # export ORIGINAL_DIR=$PWD - # cd /Applications - # xip -x $ORIGINAL_DIR/Xcode_${{ inputs.xcode-version }}.xip - # rm $ORIGINAL_DIR/Xcode_${{ inputs.xcode-version }}.xip - name: Set XCode version uses: maxim-lobanov/setup-xcode@v1 with: @@ -64,7 +53,7 @@ jobs: echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $GITHUB_ENV - name: Install nasm uses: ilammy/setup-nasm@v1.5.1 - - name: Build cesium-native + - name: Build cesium-native for macOS run: | export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} mkdir -p extern/build-arm64 @@ -76,6 +65,8 @@ jobs: cd build-x64 cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=x86_64 cmake --build . -j4 --target install + - name: Create universal macOS libs for cesium-native + run: | mkdir -p ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-universal-Release for f in ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release/*.a do @@ -89,9 +80,17 @@ jobs: lipo -create -output $universalf $arm64f $x64f fi done - rm -r -f ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release - rm -r -f ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-arm64-Release - cd ../.. + rm -rf ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-x86_64-Release + rm -rf ${GITHUB_WORKSPACE}/Source/ThirdParty/lib/Darwin-arm64-Release + - name: Build cesium-native for iOS + run: | + mkdir -p extern/build-ios + cd extern + export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} + cmake -B build-ios -S . -GXcode -DCMAKE_TOOLCHAIN_FILE="unreal-ios-toolchain.cmake" -DCMAKE_BUILD_TYPE=Release + cmake --build build-ios -j4 --target install --config Release + - name: Remove extern directory + run: | rm -rf extern - name: Customize BuildConfiguration.xml run: | @@ -99,9 +98,9 @@ jobs: # - We limit parallel actions because our builds use a lot more memory than UBT thinks they will. # - We set the source code control Provider to None so UBT includes all files in the unity build. printf '\n\n \n 2\n \n None\n\n' > ~/.config/Unreal\ Engine/UnrealBuildTool/BuildConfiguration.xml - - name: Build plugin + - name: Build plugin for macOS run: | - sed -i '' 's/\"EngineVersion\": \"5.1.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin + sed -i '' 's/\"EngineVersion\": \"5.2.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin export UNREAL_ENGINE_DIR=$HOME/${{ inputs.unreal-program-name }} cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles ./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Mac @@ -109,6 +108,12 @@ jobs: if: ${{ failure() }} run: | cat "/Users/runner/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-UnrealEditor-Mac-Development.txt" + - name: Build plugin for iOS + run: | + sed -i '' 's/\"EngineVersion\": \"5.2.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin + export UNREAL_ENGINE_DIR=$HOME/${{ inputs.unreal-program-name }} + cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles + ./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=iOS -NoHostPlatform - name: Publish plugin package artifact if: ${{ success() }} uses: actions/upload-artifact@v4 diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index 775189c22..3bd993802 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -94,7 +94,7 @@ jobs: printf '\n\n \n 2\n \n None\n\n' > ~/.config/Unreal\ Engine/UnrealBuildTool/BuildConfiguration.xml - name: Build plugin run: | - sed -i 's/\"EngineVersion\": \"5.1.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin + sed -i 's/\"EngineVersion\": \"5.2.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin cd $UNREAL_ENGINE_ROOT/Engine/Build/BatchFiles ./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Linux - name: Fix RPATH diff --git a/.github/workflows/buildWindows.yml b/.github/workflows/buildWindows.yml index 107e45511..6485eed45 100644 --- a/.github/workflows/buildWindows.yml +++ b/.github/workflows/buildWindows.yml @@ -111,7 +111,7 @@ jobs: rm -r -fo extern - name: Overwrite plugin engine version run: | - ((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.1.0"','"EngineVersion": "${{ inputs.unreal-engine-version }}"') | Set-Content -Path CesiumForUnreal.uplugin + ((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.2.0"','"EngineVersion": "${{ inputs.unreal-engine-version }}"') | Set-Content -Path CesiumForUnreal.uplugin - name: Customize BuildConfiguration.xml run: | mkdir -p "$env:USERPROFILE\AppData\Roaming\Unreal Engine\UnrealBuildTool" diff --git a/.github/workflows/buildiOS.yml b/.github/workflows/buildiOS.yml deleted file mode 100644 index 0865e3ca9..000000000 --- a/.github/workflows/buildiOS.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Build iOS - -on: - workflow_call: - inputs: - runner-label: - required: true - type: string - unreal-engine-version: - required: true - type: string - unreal-engine-zip: - required: true - type: string - unreal-program-name: - required: true - type: string - upload-package-base-name: - required: true - type: string - xcode-version: - required: true - type: string -jobs: - build: - runs-on: ${{ inputs.runner-label }} - steps: - # - name: Install XCode ${{ inputs.xcode-version }} - # env: - # AWS_REGION: us-east-1 - # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # run: | - # aws s3 cp s3://cesium-unreal-engine/Xcode/Xcode_${{ inputs.xcode-version }}.xip . --no-progress - # export ORIGINAL_DIR=$PWD - # cd /Applications - # xip -x $ORIGINAL_DIR/Xcode_${{ inputs.xcode-version }}.xip - # rm $ORIGINAL_DIR/Xcode_${{ inputs.xcode-version }}.xip - - name: Set XCode version - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: "${{ inputs.xcode-version }}" - #"${{ inputs.xcode-version }}" - - name: Check out repository code - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Configure vcpkg caching - uses: ./.github/actions/vcpkg-cache - with: - id: ${{ inputs.upload-package-base-name }} - - name: Set environment variables - run: | - export CESIUM_UNREAL_VERSION=$GITHUB_REF_NAME - export BUILD_CESIUM_UNREAL_PACKAGE_NAME="${{ inputs.upload-package-base-name }}-${CESIUM_UNREAL_VERSION}" - # Make these available to subsequent steps - echo "CESIUM_UNREAL_VERSION=${CESIUM_UNREAL_VERSION}" >> $GITHUB_ENV - echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $GITHUB_ENV - - name: Install nasm - uses: ilammy/setup-nasm@v1.5.1 - - name: Install Unreal Engine - uses: ./.github/actions/install-unreal-macos - with: - unreal-engine-zip: ${{ inputs.unreal-engine-zip }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - unreal-program-name: ${{ inputs.unreal-program-name }} - - name: Build cesium-native - run: | - mkdir -p extern/build-ios - cd extern - export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} - cmake -B build-ios -S . -GXcode -DCMAKE_TOOLCHAIN_FILE="unreal-ios-toolchain.cmake" -DCMAKE_BUILD_TYPE=Release - cmake --build build-ios -j4 --target install --config Release - cd .. - rm -rf extern - - name: Customize BuildConfiguration.xml - run: | - mkdir -p ~/.config/Unreal\ Engine/UnrealBuildTool - # - We limit parallel actions because our builds use a lot more memory than UBT thinks they will. - # - We set the source code control Provider to None so UBT includes all files in the unity build. - printf '\n\n \n 2\n \n None\n\n' > ~/.config/Unreal\ Engine/UnrealBuildTool/BuildConfiguration.xml - - name: Build plugin - run: | - sed -i '' 's/\"EngineVersion\": \"5.1.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin - export UNREAL_ENGINE_DIR=$HOME/${{ inputs.unreal-program-name }} - cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles - ./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=iOS -NoHostPlatform - - name: Print log - if: ${{ failure() }} - run: | - cat "/Users/runner/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-UnrealEditor-Mac-Development.txt" - - name: Publish plugin package artifact - if: ${{ success() }} - uses: actions/upload-artifact@v4 - with: - name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}} - path: packages From a35b9353e3442c8cecd3e959650c020c3cf1e41f Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 07:32:58 +1000 Subject: [PATCH 086/119] Fix combine step dependencies. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ccfa6d268..45f64888d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,7 @@ jobs: xcode-version: "14.2" Combine52: runs-on: ubuntu-latest - needs: [Windows52, Linux52, Android52, MacOS52, iOS52] + needs: [Windows52, Linux52, Android52, Apple52] steps: - name: Check out repository code uses: actions/checkout@v4 @@ -191,7 +191,7 @@ jobs: xcode-version: "14.2" Combine53: runs-on: ubuntu-latest - needs: [Windows53, Android53, Linux53, MacOS53, iOS53] + needs: [Windows53, Android53, Linux53, Apple53] steps: - name: Check out repository code uses: actions/checkout@v4 @@ -314,7 +314,7 @@ jobs: xcode-version: "14.2" Combine54: runs-on: ubuntu-latest - needs: [Windows54, Android54, Linux54, MacOS54, iOS54] + needs: [Windows54, Android54, Linux54, Apple54] steps: - name: Check out repository code uses: actions/checkout@v4 From 6a3a716bcf2f4a4838514048ded6792aee4f1a99 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 15:10:12 +1000 Subject: [PATCH 087/119] Use macos-13 runner. Apparently macos-13-arm64 isn't actually a thing. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45f64888d..9c3a3758b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,7 @@ jobs: uses: ./.github/workflows/buildApple.yml secrets: inherit with: - runner-label: macos-13-arm64 + runner-label: macos-13 unreal-engine-version: "5.2.0" unreal-engine-zip: "s3://cesium-unreal-engine/UE_52_macOS.zip" unreal-program-name: "UE_5.2" @@ -183,7 +183,7 @@ jobs: uses: ./.github/workflows/buildApple.yml secrets: inherit with: - runner-label: macos-13-arm64 + runner-label: macos-13 unreal-engine-version: "5.3.0" unreal-engine-zip: "s3://cesium-unreal-engine/5.3.0/UE_53_macOS.zip" unreal-program-name: "UE_5.3" @@ -306,7 +306,7 @@ jobs: uses: ./.github/workflows/buildApple.yml secrets: inherit with: - runner-label: macos-13-arm64 + runner-label: macos-13 unreal-engine-version: "5.4.0" unreal-engine-zip: "s3://cesium-unreal-engine/5.4.0/UE_54_macOS.zip" unreal-program-name: "UE_5.4" From 3ec0de57cb34b4ea53e9f267086e9edff43dc217 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 15:30:02 +1000 Subject: [PATCH 088/119] Let's try macOS 14. --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c3a3758b..b23bc426b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,12 +60,12 @@ jobs: uses: ./.github/workflows/buildApple.yml secrets: inherit with: - runner-label: macos-13 + runner-label: macos-14 unreal-engine-version: "5.2.0" unreal-engine-zip: "s3://cesium-unreal-engine/UE_52_macOS.zip" unreal-program-name: "UE_5.2" upload-package-base-name: "CesiumForUnreal-52-apple" - xcode-version: "14.2" + xcode-version: "14.3.1" Combine52: runs-on: ubuntu-latest needs: [Windows52, Linux52, Android52, Apple52] @@ -183,12 +183,12 @@ jobs: uses: ./.github/workflows/buildApple.yml secrets: inherit with: - runner-label: macos-13 + runner-label: macos-14 unreal-engine-version: "5.3.0" unreal-engine-zip: "s3://cesium-unreal-engine/5.3.0/UE_53_macOS.zip" unreal-program-name: "UE_5.3" upload-package-base-name: "CesiumForUnreal-53-apple" - xcode-version: "14.2" + xcode-version: "14.3.1" Combine53: runs-on: ubuntu-latest needs: [Windows53, Android53, Linux53, Apple53] @@ -306,12 +306,12 @@ jobs: uses: ./.github/workflows/buildApple.yml secrets: inherit with: - runner-label: macos-13 + runner-label: macos-14 unreal-engine-version: "5.4.0" unreal-engine-zip: "s3://cesium-unreal-engine/5.4.0/UE_54_macOS.zip" unreal-program-name: "UE_5.4" upload-package-base-name: "CesiumForUnreal-54-apple" - xcode-version: "14.2" + xcode-version: "14.3.1" Combine54: runs-on: ubuntu-latest needs: [Windows54, Android54, Linux54, Apple54] From eed71cde3816096caa978c112d4709a2eb6bdbdd Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 16:31:47 +1000 Subject: [PATCH 089/119] Only build vcpkg release on CI, build Intel+Apple on UE5.2 --- .github/workflows/buildAndroid.yml | 1 + .github/workflows/buildApple.yml | 4 +++- .github/workflows/buildLinux.yml | 1 + .github/workflows/buildWindows.yml | 1 + extern/vcpkg-overlays/triplets/shared/common.cmake | 4 ++++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index 40d7b786e..6f84d49a3 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -69,6 +69,7 @@ jobs: $env:ANDROID_NDK_ROOT=$env:ANDROID_NDK_ROOT.replace('\', '/') $env:ANDROID_NDK_HOME=$env:ANDROID_NDK_ROOT $env:UNREAL_ENGINE_ROOT="D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}" + $env:CESIUM_VCPKG_RELEASE_ONLY="TRUE" cd extern cmake -B build-android -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-android-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release cmake --build build-android --config Release --target install -j8 diff --git a/.github/workflows/buildApple.yml b/.github/workflows/buildApple.yml index 60825b2d3..13f010c58 100644 --- a/.github/workflows/buildApple.yml +++ b/.github/workflows/buildApple.yml @@ -56,6 +56,7 @@ jobs: - name: Build cesium-native for macOS run: | export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} + export CESIUM_VCPKG_RELEASE_ONLY=TRUE mkdir -p extern/build-arm64 cd extern/build-arm64 cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=arm64 @@ -87,6 +88,7 @@ jobs: mkdir -p extern/build-ios cd extern export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} + export CESIUM_VCPKG_RELEASE_ONLY=TRUE cmake -B build-ios -S . -GXcode -DCMAKE_TOOLCHAIN_FILE="unreal-ios-toolchain.cmake" -DCMAKE_BUILD_TYPE=Release cmake --build build-ios -j4 --target install --config Release - name: Remove extern directory @@ -103,7 +105,7 @@ jobs: sed -i '' 's/\"EngineVersion\": \"5.2.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin export UNREAL_ENGINE_DIR=$HOME/${{ inputs.unreal-program-name }} cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles - ./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Mac + ./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Mac -Architecture_Mac=arm64+x64 - name: Print log if: ${{ failure() }} run: | diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index 3bd993802..c9e36e357 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -73,6 +73,7 @@ jobs: run: | export UNREAL_ENGINE_COMPILER_DIR="${LINUX_MULTIARCH_ROOT}x86_64-unknown-linux-gnu" export UNREAL_ENGINE_LIBCXX_DIR="${UNREAL_ENGINE_ROOT}/Engine/Source/ThirdParty/Unix/LibCxx" + export CESIUM_VCPKG_RELEASE_ONLY=TRUE cd extern cmake -B build -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-linux-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release cmake --build build --config Release --target install -j8 diff --git a/.github/workflows/buildWindows.yml b/.github/workflows/buildWindows.yml index 6485eed45..fde96b32e 100644 --- a/.github/workflows/buildWindows.yml +++ b/.github/workflows/buildWindows.yml @@ -104,6 +104,7 @@ jobs: run: | cd extern $env:UNREAL_ENGINE_ROOT="D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}" + $env:CESIUM_VCPKG_RELEASE_ONLY="TRUE" $toolchainOption=If ("${{ inputs.cmake-toolchain }}") {"-T ${{ inputs.cmake-toolchain }}"} Else {""} cmake -B build -S . -A "${{ inputs.cmake-platform }}" -G "${{ inputs.cmake-generator }}" $toolchainOption cmake --build build --config Release --target install -j8 diff --git a/extern/vcpkg-overlays/triplets/shared/common.cmake b/extern/vcpkg-overlays/triplets/shared/common.cmake index 9321729ca..f9e550b77 100644 --- a/extern/vcpkg-overlays/triplets/shared/common.cmake +++ b/extern/vcpkg-overlays/triplets/shared/common.cmake @@ -1 +1,5 @@ set(VCPKG_ENV_PASSTHROUGH "UNREAL_ENGINE_ROOT") + +if(DEFINED ENV{CESIUM_VCPKG_RELEASE_ONLY} AND "$ENV{CESIUM_VCPKG_RELEASE_ONLY}") + set(VCPKG_BUILD_TYPE "release") +endif() From 83415cbce042fbb121eded2b1ebdfb9309f3ff88 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 16:39:38 +1000 Subject: [PATCH 090/119] Fix artifacts in combine steps. --- .github/workflows/build.yml | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b23bc426b..96be39bae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,15 +81,10 @@ jobs: echo "CESIUM_UNREAL_VERSION=$CESIUM_UNREAL_VERSION" >> $GITHUB_ENV echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_PACKAGE_NAME" >> $GITHUB_ENV echo "BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME" >> $GITHUB_ENV - - name: Download iOS build + - name: Download Apple build uses: actions/download-artifact@v4 with: - name: CesiumForUnreal-52-ios-${{ env.CESIUM_UNREAL_VERSION}} - path: combine - - name: Download macOS build - uses: actions/download-artifact@v4 - with: - name: CesiumForUnreal-52-macos-${{ env.CESIUM_UNREAL_VERSION}} + name: CesiumForUnreal-52-apple-${{ env.CESIUM_UNREAL_VERSION}} path: combine - name: Download Android build uses: actions/download-artifact@v4 @@ -204,15 +199,10 @@ jobs: echo "CESIUM_UNREAL_VERSION=$CESIUM_UNREAL_VERSION" >> $GITHUB_ENV echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_PACKAGE_NAME" >> $GITHUB_ENV echo "BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME" >> $GITHUB_ENV - - name: Download iOS build + - name: Download Apple build uses: actions/download-artifact@v4 with: - name: CesiumForUnreal-53-ios-${{ env.CESIUM_UNREAL_VERSION}} - path: combine - - name: Download macOS build - uses: actions/download-artifact@v4 - with: - name: CesiumForUnreal-53-macos-${{ env.CESIUM_UNREAL_VERSION}} + name: CesiumForUnreal-53-apple-${{ env.CESIUM_UNREAL_VERSION}} path: combine - name: Download Android build uses: actions/download-artifact@v4 @@ -327,15 +317,10 @@ jobs: echo "CESIUM_UNREAL_VERSION=$CESIUM_UNREAL_VERSION" >> $GITHUB_ENV echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_PACKAGE_NAME" >> $GITHUB_ENV echo "BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME" >> $GITHUB_ENV - - name: Download iOS build - uses: actions/download-artifact@v4 - with: - name: CesiumForUnreal-54-ios-${{ env.CESIUM_UNREAL_VERSION}} - path: combine - - name: Download macOS build + - name: Download Apple build uses: actions/download-artifact@v4 with: - name: CesiumForUnreal-54-macos-${{ env.CESIUM_UNREAL_VERSION}} + name: CesiumForUnreal-54-apple-${{ env.CESIUM_UNREAL_VERSION}} path: combine - name: Download Android build uses: actions/download-artifact@v4 From b4d48ab9649c8cb79558ebf5186056b91f01f18f Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 18:53:59 +1000 Subject: [PATCH 091/119] Exclude more stuff when extracting UE. --- .../actions/install-unreal-macos/action.yml | 2 +- .../exclude-from-unzip.lst | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/actions/install-unreal-macos/exclude-from-unzip.lst diff --git a/.github/actions/install-unreal-macos/action.yml b/.github/actions/install-unreal-macos/action.yml index 11e21a452..ed3b4a206 100644 --- a/.github/actions/install-unreal-macos/action.yml +++ b/.github/actions/install-unreal-macos/action.yml @@ -28,7 +28,7 @@ runs: shell: bash run: | df -h - unzip -q ue.zip "${{ inputs.unreal-program-name }}/Engine/*" -d $HOME -x "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/*" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/Android/*" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame.app/*" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/*" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/*" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame-Mac-Shipping" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/*.dSYM" + unzip -q ue.zip "${{ inputs.unreal-program-name }}/Engine/*" -d $HOME -x "@$GITHUB_WORKSPACE/.github/actions/install-unreal-macos/exclude-from-unzip.lst" df -h rm ue.zip df -h diff --git a/.github/actions/install-unreal-macos/exclude-from-unzip.lst b/.github/actions/install-unreal-macos/exclude-from-unzip.lst new file mode 100644 index 000000000..9eba75816 --- /dev/null +++ b/.github/actions/install-unreal-macos/exclude-from-unzip.lst @@ -0,0 +1,45 @@ +UE_5.2/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/ +UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/ +UE_5.2/Engine/Binaries/Mac/UnrealGame.app/ +UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/ +UE_5.2/Engine/Binaries/Mac/Android/ +UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame +UE_5.2/Engine/Binaries/Mac/UnrealGame +UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-Shipping +UE_5.2/Engine/Binaries/Mac/*.dSYM +UE_5.2/Engine/Plugins/Experimental/NNERuntimeIREE/ +UE_5.2/Engine/Plugins/Experimental/TextToSpeech/ +UE_5.2/Engine/Plugins/Experimental/Avalanche/ +UE_5.2/Engine/Plugins/Runtime/NetworkPredictionExtras/ +UE_5.2/Engine/Plugins/Runtime/Metasound/ +UE_5.2/Engine/Plugins/Importers/USDImporter/ +UE_5.3/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/ +UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/ +UE_5.3/Engine/Binaries/Mac/UnrealGame.app/ +UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/ +UE_5.3/Engine/Binaries/Mac/Android/ +UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame +UE_5.3/Engine/Binaries/Mac/UnrealGame +UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-Shipping +UE_5.3/Engine/Binaries/Mac/*.dSYM +UE_5.3/Engine/Plugins/Experimental/NNERuntimeIREE/ +UE_5.3/Engine/Plugins/Experimental/TextToSpeech/ +UE_5.3/Engine/Plugins/Experimental/Avalanche/ +UE_5.3/Engine/Plugins/Runtime/NetworkPredictionExtras/ +UE_5.3/Engine/Plugins/Runtime/Metasound/ +UE_5.3/Engine/Plugins/Importers/USDImporter/ +UE_5.4/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/ +UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/ +UE_5.4/Engine/Binaries/Mac/UnrealGame.app/ +UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/ +UE_5.4/Engine/Binaries/Mac/Android/ +UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame +UE_5.4/Engine/Binaries/Mac/UnrealGame +UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-Shipping +UE_5.4/Engine/Binaries/Mac/*.dSYM +UE_5.4/Engine/Plugins/Experimental/NNERuntimeIREE/ +UE_5.4/Engine/Plugins/Experimental/TextToSpeech/ +UE_5.4/Engine/Plugins/Experimental/Avalanche/ +UE_5.4/Engine/Plugins/Runtime/NetworkPredictionExtras/ +UE_5.4/Engine/Plugins/Runtime/Metasound/ +UE_5.4/Engine/Plugins/Importers/USDImporter/ From 14a7e71122daaf464089ebc4bf102655b8360c64 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 19:28:46 +1000 Subject: [PATCH 092/119] Another attempt at excluding files. --- .../actions/install-unreal-macos/action.yml | 2 +- .../exclude-from-unzip.lst | 66 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/actions/install-unreal-macos/action.yml b/.github/actions/install-unreal-macos/action.yml index ed3b4a206..b7242faf5 100644 --- a/.github/actions/install-unreal-macos/action.yml +++ b/.github/actions/install-unreal-macos/action.yml @@ -28,7 +28,7 @@ runs: shell: bash run: | df -h - unzip -q ue.zip "${{ inputs.unreal-program-name }}/Engine/*" -d $HOME -x "@$GITHUB_WORKSPACE/.github/actions/install-unreal-macos/exclude-from-unzip.lst" + unzip -q ue.zip "${{ inputs.unreal-program-name }}/Engine/*" -d $HOME -x $(cat "@$GITHUB_WORKSPACE/.github/actions/install-unreal-macos/exclude-from-unzip.lst") df -h rm ue.zip df -h diff --git a/.github/actions/install-unreal-macos/exclude-from-unzip.lst b/.github/actions/install-unreal-macos/exclude-from-unzip.lst index 9eba75816..3783abbd1 100644 --- a/.github/actions/install-unreal-macos/exclude-from-unzip.lst +++ b/.github/actions/install-unreal-macos/exclude-from-unzip.lst @@ -1,45 +1,45 @@ -UE_5.2/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/ -UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/ -UE_5.2/Engine/Binaries/Mac/UnrealGame.app/ -UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/ -UE_5.2/Engine/Binaries/Mac/Android/ +UE_5.2/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/* +UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/* +UE_5.2/Engine/Binaries/Mac/UnrealGame.app/* +UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/* +UE_5.2/Engine/Binaries/Mac/Android/* UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame UE_5.2/Engine/Binaries/Mac/UnrealGame UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-Shipping UE_5.2/Engine/Binaries/Mac/*.dSYM -UE_5.2/Engine/Plugins/Experimental/NNERuntimeIREE/ -UE_5.2/Engine/Plugins/Experimental/TextToSpeech/ -UE_5.2/Engine/Plugins/Experimental/Avalanche/ -UE_5.2/Engine/Plugins/Runtime/NetworkPredictionExtras/ -UE_5.2/Engine/Plugins/Runtime/Metasound/ -UE_5.2/Engine/Plugins/Importers/USDImporter/ -UE_5.3/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/ -UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/ -UE_5.3/Engine/Binaries/Mac/UnrealGame.app/ -UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/ -UE_5.3/Engine/Binaries/Mac/Android/ +UE_5.2/Engine/Plugins/Experimental/NNERuntimeIREE/* +UE_5.2/Engine/Plugins/Experimental/TextToSpeech/* +UE_5.2/Engine/Plugins/Experimental/Avalanche/* +UE_5.2/Engine/Plugins/Runtime/NetworkPredictionExtras/* +UE_5.2/Engine/Plugins/Runtime/Metasound/* +UE_5.2/Engine/Plugins/Importers/USDImporter/* +UE_5.3/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/* +UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/* +UE_5.3/Engine/Binaries/Mac/UnrealGame.app/* +UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/* +UE_5.3/Engine/Binaries/Mac/Android/* UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame UE_5.3/Engine/Binaries/Mac/UnrealGame UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-Shipping UE_5.3/Engine/Binaries/Mac/*.dSYM -UE_5.3/Engine/Plugins/Experimental/NNERuntimeIREE/ -UE_5.3/Engine/Plugins/Experimental/TextToSpeech/ -UE_5.3/Engine/Plugins/Experimental/Avalanche/ -UE_5.3/Engine/Plugins/Runtime/NetworkPredictionExtras/ -UE_5.3/Engine/Plugins/Runtime/Metasound/ -UE_5.3/Engine/Plugins/Importers/USDImporter/ -UE_5.4/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/ -UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/ -UE_5.4/Engine/Binaries/Mac/UnrealGame.app/ -UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/ -UE_5.4/Engine/Binaries/Mac/Android/ +UE_5.3/Engine/Plugins/Experimental/NNERuntimeIREE/* +UE_5.3/Engine/Plugins/Experimental/TextToSpeech/* +UE_5.3/Engine/Plugins/Experimental/Avalanche/* +UE_5.3/Engine/Plugins/Runtime/NetworkPredictionExtras/* +UE_5.3/Engine/Plugins/Runtime/Metasound/* +UE_5.3/Engine/Plugins/Importers/USDImporter/* +UE_5.4/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/* +UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/* +UE_5.4/Engine/Binaries/Mac/UnrealGame.app/* +UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/* +UE_5.4/Engine/Binaries/Mac/Android/* UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame UE_5.4/Engine/Binaries/Mac/UnrealGame UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-Shipping UE_5.4/Engine/Binaries/Mac/*.dSYM -UE_5.4/Engine/Plugins/Experimental/NNERuntimeIREE/ -UE_5.4/Engine/Plugins/Experimental/TextToSpeech/ -UE_5.4/Engine/Plugins/Experimental/Avalanche/ -UE_5.4/Engine/Plugins/Runtime/NetworkPredictionExtras/ -UE_5.4/Engine/Plugins/Runtime/Metasound/ -UE_5.4/Engine/Plugins/Importers/USDImporter/ +UE_5.4/Engine/Plugins/Experimental/NNERuntimeIREE/* +UE_5.4/Engine/Plugins/Experimental/TextToSpeech/* +UE_5.4/Engine/Plugins/Experimental/Avalanche/* +UE_5.4/Engine/Plugins/Runtime/NetworkPredictionExtras/* +UE_5.4/Engine/Plugins/Runtime/Metasound/* +UE_5.4/Engine/Plugins/Importers/USDImporter/* From ef18e497100807351355ce533fac0dd1b3b49ddc Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 19:37:11 +1000 Subject: [PATCH 093/119] Remove previous attempt at listifying. --- .github/actions/install-unreal-macos/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install-unreal-macos/action.yml b/.github/actions/install-unreal-macos/action.yml index b7242faf5..d4ecd33c5 100644 --- a/.github/actions/install-unreal-macos/action.yml +++ b/.github/actions/install-unreal-macos/action.yml @@ -28,7 +28,7 @@ runs: shell: bash run: | df -h - unzip -q ue.zip "${{ inputs.unreal-program-name }}/Engine/*" -d $HOME -x $(cat "@$GITHUB_WORKSPACE/.github/actions/install-unreal-macos/exclude-from-unzip.lst") + unzip -q ue.zip "${{ inputs.unreal-program-name }}/Engine/*" -d $HOME -x $(cat "$GITHUB_WORKSPACE/.github/actions/install-unreal-macos/exclude-from-unzip.lst") df -h rm ue.zip df -h From bd4d1c753dc3f9c0e33eeaa8157f0d8cefbe1d96 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 21:08:06 +1000 Subject: [PATCH 094/119] Exclude more stuff from the ZIP. --- .../exclude-from-unzip.lst | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/actions/install-unreal-macos/exclude-from-unzip.lst b/.github/actions/install-unreal-macos/exclude-from-unzip.lst index 3783abbd1..3e76ff19b 100644 --- a/.github/actions/install-unreal-macos/exclude-from-unzip.lst +++ b/.github/actions/install-unreal-macos/exclude-from-unzip.lst @@ -33,13 +33,35 @@ UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/* UE_5.4/Engine/Binaries/Mac/UnrealGame.app/* UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/* UE_5.4/Engine/Binaries/Mac/Android/* +UE_5.4/Engine/Binaries/Mac/ZenDashboard.app/* +UE_5.4/Engine/Binaries/Mac/UnrealEditorServices.app/* +UE_5.4/Engine/Binaries/Mac/UnrealEditor-Mac-DebugGame.app/* UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame UE_5.4/Engine/Binaries/Mac/UnrealGame UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-Shipping -UE_5.4/Engine/Binaries/Mac/*.dSYM UE_5.4/Engine/Plugins/Experimental/NNERuntimeIREE/* UE_5.4/Engine/Plugins/Experimental/TextToSpeech/* UE_5.4/Engine/Plugins/Experimental/Avalanche/* +UE_5.4/Engine/Plugins/Experimental/MoverExamples/* +UE_5.4/Engine/Plugins/Experimental/MoverTests/* +UE_5.4/Engine/Plugins/Experimental/Mutable/* UE_5.4/Engine/Plugins/Runtime/NetworkPredictionExtras/* UE_5.4/Engine/Plugins/Runtime/Metasound/* +UE_5.4/Engine/Plugins/Runtime/GooglePAD/* +UE_5.4/Engine/Plugins/Runtime/Harmonix/* UE_5.4/Engine/Plugins/Importers/USDImporter/* +UE_5.4/Engine/Plugins/Animation/* +UE_5.4/Engine/Plugins/NNE/* +UE_5.4/Engine/Plugins/Media/AjaMedia/* +UE_5.4/Engine/Source/Runtime/OodleDataCompression/* +UE_5.4/Engine/Binaries/ThirdParty/DotNet/6.0.302/mac-x64/* +UE_5.4/Engine/Binaries/ThirdParty/CEF3/* +UE_5.4/Engine/Binaries/ThirdParty/Python3/* +UE_5.4/Engine/Binaries/ThirdParty/svn/* +UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/Windows/* +UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/Android/* +UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/Linux/* +UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/TVOS/* +UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/SteamDeck/* +UE_5.4/Engine/Binaries/DotNET/Android/* +*.dSYM From 7afd80715cd04f747c3feda541521bb70b29977a Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 21:27:31 +1000 Subject: [PATCH 095/119] Restore apparently-required TextToSpeech plugin. --- .../install-unreal-macos/exclude-from-unzip.lst | 3 --- .github/workflows/buildApple.yml | 11 +++++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/actions/install-unreal-macos/exclude-from-unzip.lst b/.github/actions/install-unreal-macos/exclude-from-unzip.lst index 3e76ff19b..81fe7da48 100644 --- a/.github/actions/install-unreal-macos/exclude-from-unzip.lst +++ b/.github/actions/install-unreal-macos/exclude-from-unzip.lst @@ -8,7 +8,6 @@ UE_5.2/Engine/Binaries/Mac/UnrealGame UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-Shipping UE_5.2/Engine/Binaries/Mac/*.dSYM UE_5.2/Engine/Plugins/Experimental/NNERuntimeIREE/* -UE_5.2/Engine/Plugins/Experimental/TextToSpeech/* UE_5.2/Engine/Plugins/Experimental/Avalanche/* UE_5.2/Engine/Plugins/Runtime/NetworkPredictionExtras/* UE_5.2/Engine/Plugins/Runtime/Metasound/* @@ -23,7 +22,6 @@ UE_5.3/Engine/Binaries/Mac/UnrealGame UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-Shipping UE_5.3/Engine/Binaries/Mac/*.dSYM UE_5.3/Engine/Plugins/Experimental/NNERuntimeIREE/* -UE_5.3/Engine/Plugins/Experimental/TextToSpeech/* UE_5.3/Engine/Plugins/Experimental/Avalanche/* UE_5.3/Engine/Plugins/Runtime/NetworkPredictionExtras/* UE_5.3/Engine/Plugins/Runtime/Metasound/* @@ -40,7 +38,6 @@ UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame UE_5.4/Engine/Binaries/Mac/UnrealGame UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-Shipping UE_5.4/Engine/Plugins/Experimental/NNERuntimeIREE/* -UE_5.4/Engine/Plugins/Experimental/TextToSpeech/* UE_5.4/Engine/Plugins/Experimental/Avalanche/* UE_5.4/Engine/Plugins/Experimental/MoverExamples/* UE_5.4/Engine/Plugins/Experimental/MoverTests/* diff --git a/.github/workflows/buildApple.yml b/.github/workflows/buildApple.yml index 13f010c58..dc6f05f76 100644 --- a/.github/workflows/buildApple.yml +++ b/.github/workflows/buildApple.yml @@ -53,7 +53,7 @@ jobs: echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $GITHUB_ENV - name: Install nasm uses: ilammy/setup-nasm@v1.5.1 - - name: Build cesium-native for macOS + - name: Build cesium-native for macOS ARM64 run: | export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} export CESIUM_VCPKG_RELEASE_ONLY=TRUE @@ -61,9 +61,12 @@ jobs: cd extern/build-arm64 cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=arm64 cmake --build . -j4 --target install - cd .. - mkdir -p build-x64 - cd build-x64 + - name: Build cesium-native for macOS x86_64 + run: | + export UNREAL_ENGINE_ROOT=$HOME/${{ inputs.unreal-program-name }} + export CESIUM_VCPKG_RELEASE_ONLY=TRUE + mkdir -p extern/build-x64 + cd extern/build-x64 cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=x86_64 cmake --build . -j4 --target install - name: Create universal macOS libs for cesium-native From 532ec918a2ca4e3591e920527115cce1b50e6a69 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 22:00:04 +1000 Subject: [PATCH 096/119] Only exclude some experimental plugins. Hopefully that will be good enough. --- .../actions/install-unreal-macos/exclude-from-unzip.lst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/actions/install-unreal-macos/exclude-from-unzip.lst b/.github/actions/install-unreal-macos/exclude-from-unzip.lst index 81fe7da48..8a0948bbd 100644 --- a/.github/actions/install-unreal-macos/exclude-from-unzip.lst +++ b/.github/actions/install-unreal-macos/exclude-from-unzip.lst @@ -42,14 +42,6 @@ UE_5.4/Engine/Plugins/Experimental/Avalanche/* UE_5.4/Engine/Plugins/Experimental/MoverExamples/* UE_5.4/Engine/Plugins/Experimental/MoverTests/* UE_5.4/Engine/Plugins/Experimental/Mutable/* -UE_5.4/Engine/Plugins/Runtime/NetworkPredictionExtras/* -UE_5.4/Engine/Plugins/Runtime/Metasound/* -UE_5.4/Engine/Plugins/Runtime/GooglePAD/* -UE_5.4/Engine/Plugins/Runtime/Harmonix/* -UE_5.4/Engine/Plugins/Importers/USDImporter/* -UE_5.4/Engine/Plugins/Animation/* -UE_5.4/Engine/Plugins/NNE/* -UE_5.4/Engine/Plugins/Media/AjaMedia/* UE_5.4/Engine/Source/Runtime/OodleDataCompression/* UE_5.4/Engine/Binaries/ThirdParty/DotNet/6.0.302/mac-x64/* UE_5.4/Engine/Binaries/ThirdParty/CEF3/* From 2690c7e5b50d7148748bc49db80fa613cdcfe703 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 22:16:04 +1000 Subject: [PATCH 097/119] Restore non-experimental plugins for 5.2 and 5.3, too. --- .github/actions/install-unreal-macos/exclude-from-unzip.lst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/actions/install-unreal-macos/exclude-from-unzip.lst b/.github/actions/install-unreal-macos/exclude-from-unzip.lst index 8a0948bbd..6ee8d4d52 100644 --- a/.github/actions/install-unreal-macos/exclude-from-unzip.lst +++ b/.github/actions/install-unreal-macos/exclude-from-unzip.lst @@ -9,9 +9,6 @@ UE_5.2/Engine/Binaries/Mac/UnrealGame-Mac-Shipping UE_5.2/Engine/Binaries/Mac/*.dSYM UE_5.2/Engine/Plugins/Experimental/NNERuntimeIREE/* UE_5.2/Engine/Plugins/Experimental/Avalanche/* -UE_5.2/Engine/Plugins/Runtime/NetworkPredictionExtras/* -UE_5.2/Engine/Plugins/Runtime/Metasound/* -UE_5.2/Engine/Plugins/Importers/USDImporter/* UE_5.3/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/* UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/* UE_5.3/Engine/Binaries/Mac/UnrealGame.app/* @@ -23,9 +20,6 @@ UE_5.3/Engine/Binaries/Mac/UnrealGame-Mac-Shipping UE_5.3/Engine/Binaries/Mac/*.dSYM UE_5.3/Engine/Plugins/Experimental/NNERuntimeIREE/* UE_5.3/Engine/Plugins/Experimental/Avalanche/* -UE_5.3/Engine/Plugins/Runtime/NetworkPredictionExtras/* -UE_5.3/Engine/Plugins/Runtime/Metasound/* -UE_5.3/Engine/Plugins/Importers/USDImporter/* UE_5.4/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/* UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/* UE_5.4/Engine/Binaries/Mac/UnrealGame.app/* From 20622afd5d9997c1dc743159f8ed7af9401bae28 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 21 Jun 2024 22:54:39 +1000 Subject: [PATCH 098/119] Delete reference to deleted AutomationScripts. --- .github/actions/install-unreal-macos/exclude-from-unzip.lst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/install-unreal-macos/exclude-from-unzip.lst b/.github/actions/install-unreal-macos/exclude-from-unzip.lst index 6ee8d4d52..bc9a9d1f8 100644 --- a/.github/actions/install-unreal-macos/exclude-from-unzip.lst +++ b/.github/actions/install-unreal-macos/exclude-from-unzip.lst @@ -42,9 +42,14 @@ UE_5.4/Engine/Binaries/ThirdParty/CEF3/* UE_5.4/Engine/Binaries/ThirdParty/Python3/* UE_5.4/Engine/Binaries/ThirdParty/svn/* UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/Windows/* +UE_5.4/Engine/Intermediate/ScriptModules/Win.Automation.json UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/Android/* +UE_5.4/Engine/Intermediate/ScriptModules/Android.Automation.json UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/Linux/* +UE_5.4/Engine/Intermediate/ScriptModules/Linux.Automation.json UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/TVOS/* +UE_5.4/Engine/Intermediate/ScriptModules/TVOS.Automation.json UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/SteamDeck/* +UE_5.4/Engine/Intermediate/ScriptModules/SteamDeck.Automation.json UE_5.4/Engine/Binaries/DotNET/Android/* *.dSYM From e234f095c80c604956230d142f90b0aa3c7d4f85 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 22 Jun 2024 06:55:59 +1000 Subject: [PATCH 099/119] Restore svn. --- .github/actions/install-unreal-macos/exclude-from-unzip.lst | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/install-unreal-macos/exclude-from-unzip.lst b/.github/actions/install-unreal-macos/exclude-from-unzip.lst index bc9a9d1f8..58a677501 100644 --- a/.github/actions/install-unreal-macos/exclude-from-unzip.lst +++ b/.github/actions/install-unreal-macos/exclude-from-unzip.lst @@ -40,7 +40,6 @@ UE_5.4/Engine/Source/Runtime/OodleDataCompression/* UE_5.4/Engine/Binaries/ThirdParty/DotNet/6.0.302/mac-x64/* UE_5.4/Engine/Binaries/ThirdParty/CEF3/* UE_5.4/Engine/Binaries/ThirdParty/Python3/* -UE_5.4/Engine/Binaries/ThirdParty/svn/* UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/Windows/* UE_5.4/Engine/Intermediate/ScriptModules/Win.Automation.json UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/Android/* From 95951fb3d01b5d3070038e2c72181398ed01738b Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 22 Jun 2024 10:56:19 +1000 Subject: [PATCH 100/119] Print brew inventory. --- .github/workflows/buildApple.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/buildApple.yml b/.github/workflows/buildApple.yml index dc6f05f76..0a2685c50 100644 --- a/.github/workflows/buildApple.yml +++ b/.github/workflows/buildApple.yml @@ -25,6 +25,9 @@ jobs: build: runs-on: ${{ inputs.runner-label }} steps: + - name: List installed Brew thingos + run: | + brew list - name: Set XCode version uses: maxim-lobanov/setup-xcode@v1 with: From 9c6c642e050cd4d104b41fec2796644b41e46966 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 22 Jun 2024 11:00:10 +1000 Subject: [PATCH 101/119] Restore oodle, remove google chrome. --- .github/actions/install-unreal-macos/exclude-from-unzip.lst | 1 - .github/workflows/buildApple.yml | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/install-unreal-macos/exclude-from-unzip.lst b/.github/actions/install-unreal-macos/exclude-from-unzip.lst index 58a677501..1539a41e4 100644 --- a/.github/actions/install-unreal-macos/exclude-from-unzip.lst +++ b/.github/actions/install-unreal-macos/exclude-from-unzip.lst @@ -36,7 +36,6 @@ UE_5.4/Engine/Plugins/Experimental/Avalanche/* UE_5.4/Engine/Plugins/Experimental/MoverExamples/* UE_5.4/Engine/Plugins/Experimental/MoverTests/* UE_5.4/Engine/Plugins/Experimental/Mutable/* -UE_5.4/Engine/Source/Runtime/OodleDataCompression/* UE_5.4/Engine/Binaries/ThirdParty/DotNet/6.0.302/mac-x64/* UE_5.4/Engine/Binaries/ThirdParty/CEF3/* UE_5.4/Engine/Binaries/ThirdParty/Python3/* diff --git a/.github/workflows/buildApple.yml b/.github/workflows/buildApple.yml index 0a2685c50..5df95a3ab 100644 --- a/.github/workflows/buildApple.yml +++ b/.github/workflows/buildApple.yml @@ -25,9 +25,11 @@ jobs: build: runs-on: ${{ inputs.runner-label }} steps: - - name: List installed Brew thingos + - name: Make some more disk space run: | - brew list + df -h + brew uninstall google-chrome + df -h - name: Set XCode version uses: maxim-lobanov/setup-xcode@v1 with: From 9c4a1e3e9e37c6c16099e115fe8b9901dcc2b503 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 22 Jun 2024 11:19:41 +1000 Subject: [PATCH 102/119] Combine macOS / iOS plugin build steps. --- .github/workflows/buildApple.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/buildApple.yml b/.github/workflows/buildApple.yml index 5df95a3ab..ca673dcf0 100644 --- a/.github/workflows/buildApple.yml +++ b/.github/workflows/buildApple.yml @@ -108,22 +108,16 @@ jobs: # - We limit parallel actions because our builds use a lot more memory than UBT thinks they will. # - We set the source code control Provider to None so UBT includes all files in the unity build. printf '\n\n \n 2\n \n None\n\n' > ~/.config/Unreal\ Engine/UnrealBuildTool/BuildConfiguration.xml - - name: Build plugin for macOS + - name: Build plugin for macOS and iOS run: | sed -i '' 's/\"EngineVersion\": \"5.2.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin export UNREAL_ENGINE_DIR=$HOME/${{ inputs.unreal-program-name }} cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles - ./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Mac -Architecture_Mac=arm64+x64 + ./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Mac+iOS -Architecture_Mac=arm64+x64 - name: Print log if: ${{ failure() }} run: | cat "/Users/runner/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-UnrealEditor-Mac-Development.txt" - - name: Build plugin for iOS - run: | - sed -i '' 's/\"EngineVersion\": \"5.2.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin - export UNREAL_ENGINE_DIR=$HOME/${{ inputs.unreal-program-name }} - cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles - ./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=iOS -NoHostPlatform - name: Publish plugin package artifact if: ${{ success() }} uses: actions/upload-artifact@v4 From cddd05406f6f2123497a83c4738e3d11cfc3ed77 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 22 Jun 2024 13:16:41 +1000 Subject: [PATCH 103/119] Re-add Python. --- .github/actions/install-unreal-macos/exclude-from-unzip.lst | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/install-unreal-macos/exclude-from-unzip.lst b/.github/actions/install-unreal-macos/exclude-from-unzip.lst index 1539a41e4..eb3cdfbe5 100644 --- a/.github/actions/install-unreal-macos/exclude-from-unzip.lst +++ b/.github/actions/install-unreal-macos/exclude-from-unzip.lst @@ -38,7 +38,6 @@ UE_5.4/Engine/Plugins/Experimental/MoverTests/* UE_5.4/Engine/Plugins/Experimental/Mutable/* UE_5.4/Engine/Binaries/ThirdParty/DotNet/6.0.302/mac-x64/* UE_5.4/Engine/Binaries/ThirdParty/CEF3/* -UE_5.4/Engine/Binaries/ThirdParty/Python3/* UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/Windows/* UE_5.4/Engine/Intermediate/ScriptModules/Win.Automation.json UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/Android/* From 9d4ebaed141c9ead5d4e222753462fd00272f6da Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 22 Jun 2024 14:08:45 +1000 Subject: [PATCH 104/119] Apparently in UE 5.4 we just can't remove any plugins at all. --- .github/actions/install-unreal-macos/exclude-from-unzip.lst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/actions/install-unreal-macos/exclude-from-unzip.lst b/.github/actions/install-unreal-macos/exclude-from-unzip.lst index eb3cdfbe5..871f0fa5d 100644 --- a/.github/actions/install-unreal-macos/exclude-from-unzip.lst +++ b/.github/actions/install-unreal-macos/exclude-from-unzip.lst @@ -31,11 +31,6 @@ UE_5.4/Engine/Binaries/Mac/UnrealEditor-Mac-DebugGame.app/* UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame UE_5.4/Engine/Binaries/Mac/UnrealGame UE_5.4/Engine/Binaries/Mac/UnrealGame-Mac-Shipping -UE_5.4/Engine/Plugins/Experimental/NNERuntimeIREE/* -UE_5.4/Engine/Plugins/Experimental/Avalanche/* -UE_5.4/Engine/Plugins/Experimental/MoverExamples/* -UE_5.4/Engine/Plugins/Experimental/MoverTests/* -UE_5.4/Engine/Plugins/Experimental/Mutable/* UE_5.4/Engine/Binaries/ThirdParty/DotNet/6.0.302/mac-x64/* UE_5.4/Engine/Binaries/ThirdParty/CEF3/* UE_5.4/Engine/Binaries/DotNET/AutomationTool/AutomationScripts/Platforms/Windows/* From b61cf60fe1fed450e07edfc2db508b85525256fb Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 22 Jun 2024 16:44:33 +1000 Subject: [PATCH 105/119] Delete things. --- .github/workflows/buildApple.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/buildApple.yml b/.github/workflows/buildApple.yml index ca673dcf0..5094d3962 100644 --- a/.github/workflows/buildApple.yml +++ b/.github/workflows/buildApple.yml @@ -29,6 +29,8 @@ jobs: run: | df -h brew uninstall google-chrome + sudo rm -rf /Users/runner/Library/Android + sudo rm -rf /Applications/Xcode_16.0.app df -h - name: Set XCode version uses: maxim-lobanov/setup-xcode@v1 From 86dc9b5a0fa8a0e0fb341a209272b6ae95eb21da Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Sat, 22 Jun 2024 16:45:12 +1000 Subject: [PATCH 106/119] Remove the entire xcode 16 directory that might exist. --- .github/workflows/buildApple.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/buildApple.yml b/.github/workflows/buildApple.yml index 5094d3962..93603bca7 100644 --- a/.github/workflows/buildApple.yml +++ b/.github/workflows/buildApple.yml @@ -31,6 +31,7 @@ jobs: brew uninstall google-chrome sudo rm -rf /Users/runner/Library/Android sudo rm -rf /Applications/Xcode_16.0.app + sudo rm -rf /Applications/Xcode_16.0 df -h - name: Set XCode version uses: maxim-lobanov/setup-xcode@v1 From 65ba91b29dee0b4de08e819e1b94c40d77c968aa Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 24 Jun 2024 07:50:37 +1000 Subject: [PATCH 107/119] Don't compress debug sections. It should be less necessary now that we're using swl-variant, and it causes problems packaging for Linux from Windows. --- .github/workflows/buildAndroid.yml | 4 ---- .github/workflows/buildLinux.yml | 20 -------------------- 2 files changed, 24 deletions(-) diff --git a/.github/workflows/buildAndroid.yml b/.github/workflows/buildAndroid.yml index 6f84d49a3..44cbaf680 100644 --- a/.github/workflows/buildAndroid.yml +++ b/.github/workflows/buildAndroid.yml @@ -99,10 +99,6 @@ jobs: if: ${{ failure() }} run: | cat "C:\Users\runneradmin\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+Program+Files+Epic+Games+${{ inputs.unreal-program-name }}\UBT-UnrealGame-Android-Development.txt" - - name: Compress debug sections - run: | - dir packages/CesiumForUnreal/Intermediate/Build/Android/UnrealGame/Development/CesiumRuntime/*.o | Foreach-Object { & $ENV:ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objcopy.exe --compress-debug-sections $_.FullName } - dir packages/CesiumForUnreal/Intermediate/Build/Android/UnrealGame/Shipping/CesiumRuntime/*.o | Foreach-Object { & $ENV:ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-objcopy.exe --compress-debug-sections $_.FullName } - name: Publish plugin package artifact if: ${{ success() }} uses: actions/upload-artifact@v4 diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index c9e36e357..11a83db52 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -104,26 +104,6 @@ jobs: patchelf --print-rpath libUnrealEditor-CesiumRuntime.so export UPDATED_RPATH=`patchelf --print-rpath libUnrealEditor-CesiumRuntime.so | sed 's/${ORIGIN}[^:]*\/SunPosition\/Binaries\/Linux/${ORIGIN}\/..\/..\/..\/..\/Runtime\/SunPosition\/Binaries\/Linux/'` patchelf --force-rpath --set-rpath "$UPDATED_RPATH" libUnrealEditor-CesiumRuntime.so - - name: Compress debug sections - run: | - for f in packages/CesiumForUnreal/Binaries/Linux/*.so; do objcopy --compress-debug-sections $f; done - for f in packages/CesiumForUnreal/Binaries/Linux/*.debug; do objcopy --compress-debug-sections $f; done - if [ -d "packages/CesiumForUnreal/Intermediate/Build/Linux/x64" ]; then - for f in packages/CesiumForUnreal/Intermediate/Build/Linux/x64/UnrealGame/Development/CesiumRuntime/*.o; do - objcopy --compress-debug-sections $f - done - for f in packages/CesiumForUnreal/Intermediate/Build/Linux/x64/UnrealGame/Shipping/CesiumRuntime/*.o; do - objcopy --compress-debug-sections $f - done - fi - if [ -d "packages/CesiumForUnreal/Intermediate/Build/Linux/B4D820EA" ]; then - for f in packages/CesiumForUnreal/Intermediate/Build/Linux/B4D820EA/UnrealGame/Development/CesiumRuntime/*.o; do - objcopy --compress-debug-sections $f - done - for f in packages/CesiumForUnreal/Intermediate/Build/Linux/B4D820EA/UnrealGame/Shipping/CesiumRuntime/*.o; do - objcopy --compress-debug-sections $f - done - fi - name: Print disk space free run: | df -h From 44665733d9f863c8e6de220f8ca67e7767582e25 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 24 Jun 2024 09:56:20 +1000 Subject: [PATCH 108/119] Fix warnings in UE 5.4. --- .../Private/UnrealAssetAccessor.cpp | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/Source/CesiumRuntime/Private/UnrealAssetAccessor.cpp b/Source/CesiumRuntime/Private/UnrealAssetAccessor.cpp index 2b9816ff1..b1bfccb72 100644 --- a/Source/CesiumRuntime/Private/UnrealAssetAccessor.cpp +++ b/Source/CesiumRuntime/Private/UnrealAssetAccessor.cpp @@ -147,6 +147,30 @@ bool isFile(const std::string& url) { return url.compare(0, sizeof(fileProtocol) - 1, fileProtocol) == 0; } +void rejectPromiseOnUnsuccessfulConnection( + const CesiumAsync::Promise>& + promise, + FHttpRequestPtr pRequest) { +#if ENGINE_VERSION_5_4_OR_HIGHER + if (pRequest->GetStatus() == EHttpRequestStatus::Failed) { + EHttpFailureReason failureReason = pRequest->GetFailureReason(); + promise.reject(std::runtime_error(fmt::format( + "Request failed: {}", + TCHAR_TO_UTF8(LexToString(failureReason))))); + } else { + promise.reject(std::runtime_error(fmt::format( + "Request not successful: {}", + TCHAR_TO_UTF8(ToString(pRequest->GetStatus()))))); + } +#else + if (pRequest->GetStatus() == EHttpRequestStatus::Failed_ConnectionError) { + promise.reject(std::runtime_error("Connection failed.")); + } else { + promise.reject(std::runtime_error("Request failed.")); + } +#endif +} + } // namespace CesiumAsync::Future> @@ -196,12 +220,7 @@ UnrealAssetAccessor::get( promise.resolve( std::make_unique(pRequest, pResponse)); } else { - switch (pRequest->GetStatus()) { - case EHttpRequestStatus::Failed_ConnectionError: - promise.reject(std::runtime_error("Connection failed.")); - default: - promise.reject(std::runtime_error("Request failed.")); - } + rejectPromiseOnUnsuccessfulConnection(promise, pRequest); } }); @@ -259,12 +278,7 @@ UnrealAssetAccessor::request( promise.resolve( std::make_unique(pRequest, pResponse)); } else { - switch (pRequest->GetStatus()) { - case EHttpRequestStatus::Failed_ConnectionError: - promise.reject(std::runtime_error("Connection failed.")); - default: - promise.reject(std::runtime_error("Request failed.")); - } + rejectPromiseOnUnsuccessfulConnection(promise, pRequest); } }); From 89719d08928277fc4ffe44eabeff5bc2f016203f Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 24 Jun 2024 10:20:37 +1000 Subject: [PATCH 109/119] Fix another UE 5.4 warning. --- .../Private/CesiumTextureUtility.cpp | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Source/CesiumRuntime/Private/CesiumTextureUtility.cpp b/Source/CesiumRuntime/Private/CesiumTextureUtility.cpp index 5aceb4bb4..5bb64b8c9 100644 --- a/Source/CesiumRuntime/Private/CesiumTextureUtility.cpp +++ b/Source/CesiumRuntime/Private/CesiumTextureUtility.cpp @@ -39,7 +39,27 @@ FTexture2DRHIRef createAsyncTextureAndWait( ETextureCreateFlags Flags, void** InitialMipData, uint32 NumInitialMips) { -#if ENGINE_VERSION_5_3_OR_HIGHER +#if ENGINE_VERSION_5_4_OR_HIGHER + FGraphEventRef CompletionEvent; + + FTexture2DRHIRef result = RHIAsyncCreateTexture2D( + SizeX, + SizeY, + Format, + NumMips, + Flags, + ERHIAccess::Unknown, + InitialMipData, + NumInitialMips, + TEXT("CesiumTexture"), + CompletionEvent); + + if (CompletionEvent) { + CompletionEvent->Wait(); + } + + return result; +#elif ENGINE_VERSION_5_3_OR_HIGHER FGraphEventRef CompletionEvent; FTexture2DRHIRef result = RHIAsyncCreateTexture2D( From 11e26aafb1f8e1b474fd820e9ffe8bee2a7c63d7 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 22 Jul 2024 11:02:18 -0400 Subject: [PATCH 110/119] Only specify MSVC toolset version on CI. --- Documentation/developer-setup-windows.md | 30 ++++++++----------- .../triplets/x64-windows-unreal.cmake | 7 ++++- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Documentation/developer-setup-windows.md b/Documentation/developer-setup-windows.md index 3b4567904..6a5363940 100644 --- a/Documentation/developer-setup-windows.md +++ b/Documentation/developer-setup-windows.md @@ -3,14 +3,14 @@ Detailed instructions for setting up a Cesium for Unreal development environment # Prerequisities - Install CMake (version 3.15 or newer) from https://cmake.org/install/ -- Install Visual Studio 2019 v16.11+ (or Visual Studio 2017 v15.6+) +- Install Visual Studio 2022 v17.4+ - Under **Workloads**, check `Desktop development with C++` - - Under **Workloads**, check `Game development with C++` + - Under **Workloads**, check `Game development with C++` - Under **Individual components**, check `.NET Framework 4.8 SDK` (or newer) -> Note: Visual Studio options are derived from Unreal Engine's [recommended setup](https://docs.unrealengine.com/5.0/en-US/setting-up-visual-studio-development-environment-for-cplusplus-projects-in-unreal-engine/) +> Note: Visual Studio options are derived from Unreal Engine's [recommended setup](https://dev.epicgames.com/documentation/en-us/unreal-engine/setting-up-visual-studio-development-environment-for-cplusplus-projects-in-unreal-engine?application_version=5.2) - Install the .NET Core 3.1 Runtime, [link](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-3.1.32-windows-x64-installer?cid=getdotnetcore) - 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. -- Install the Unreal Engine (version 5.0 or newer) from https://www.unrealengine.com/en-US/download +- Install the Unreal Engine (version 5.2 or newer) from https://www.unrealengine.com/en-US/download ## To Cross Compile Android on Windows @@ -49,7 +49,7 @@ This can be set up with the following sequence of commands, on the console, star The cesium-native libraries and their dependencies use CMake and must be built separately from Cesium for Unreal. There are a number of ways to do this, depending on your preferred environment: -* [Visual Studio 2019](#Visual-Studio-2019) +* [Visual Studio 2022](#Visual-Studio-2022) * [Visual Studio Code](#Visual-Studio-Code) * [CMake GUI](#CMake-GUI) * [CMake command-line](#CMake-command-line) @@ -57,9 +57,9 @@ The cesium-native libraries and their dependencies use CMake and must be built s The version of CMake included with Visual Studio 2017 is too old to build cesium-native, so to build with Visual Studio 2017, follow the CMake command-line or CMake GUI instructions. -## Visual Studio 2019 +## Visual Studio 2022 -Launch Visual Studio 2019 and "Open a local folder". Select `C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\extern`. +Launch Visual Studio 2022 and "Open a local folder". Select `C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\extern`. > Be sure to select the `extern` directory, *not* the `cesium-native` subdirectory. Find the "Solution Explorer - Folder View". @@ -69,10 +69,10 @@ To build a "Debug" build of cesium-native, - This will compile and "install" it to the place in the project that Cesium for Unreal expects to find it - `c:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Source\ThirdParty`. -To build a "Release" build of cesium-native, - - Right click on `CMakeLists.txt` and select "CMake Settings for cesium-unreal-extern". - - Add a new configuration by clicking the `+` and choose `x64-Release`. - - Select the new "x64-Release" from the Solution Configuration dropdown. +To build a "Release" build of cesium-native, + - Right click on `CMakeLists.txt` and select "CMake Settings for cesium-unreal-extern". + - Add a new configuration by clicking the `+` and choose `x64-Release`. + - Select the new "x64-Release" from the Solution Configuration dropdown. - Right-click on `CMakeLists.txt` again and choose "Install". > In Visual Studio, this defaults to the "RelWithDebInfo" configuration type. You can change this at any time @@ -99,13 +99,9 @@ This will generate the project file called `cesium-unreal-extern.sln` in the dir First, configure the CMake project in the `C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\extern` directory by following the instructions below. **Note**: The following steps must be done in the `extern` directory, and *not* the `cesium-native` subdirectory! -To configure for Visual Studio 2019, open "x64 Native Tools Command Prompt for VS 2019" and execute the following command: +To configure for Visual Studio 2022, open "x64 Native Tools Command Prompt for VS 2022" and execute the following command: - cmake -B build -S . -G "Visual Studio 16 2019" -A x64 - -To use Visual Studio 2017 instead, open "x64 Native Tools Command Prompt for VS 2017" and execute the following command: - - cmake -B build -S . -G "Visual Studio 15 2017 Win64" + cmake -B build -S . -G "Visual Studio 17 2022" -A x64 With either compiler, the commands above will generate the project file called `cesium-unreal-extern.sln` in the directory `C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\extern\build`. You can open this solution file in the Visual Studio IDE and compile as normal. To install cesium-native to the project - which is required for use with Cesium for Unreal - right-click on `INSTALL` in Solution Explorer, and choose Build. `INSTALL` may be found inside a folder called `CMakePredefinedTargets`. Use the Solution Configuration dropdown to change between the Debug and Release configurations. diff --git a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake index 5051d884b..d2e4b7fc1 100644 --- a/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake +++ b/extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake @@ -17,4 +17,9 @@ set(VCPKG_ENV_PASSTHROUGH "UNREAL_ENGINE_ROOT") # https://github.com/EpicGames/UnrealEngine/blob/5.2.1-release/Engine/Source/Programs/UnrealBuildTool/Platform/Windows/VCToolChain.cs set(VCPKG_CXX_FLAGS "/MD /Zp8") set(VCPKG_C_FLAGS "${VCPKG_CXX_FLAGS}") -set(VCPKG_PLATFORM_TOOLSET_VERSION "14.34") + +# When building official binaries on CI, use a very specific MSVC toolset version (which must be installed). +# When building locally, use the default. +if(DEFINED ENV{CI}) + set(VCPKG_PLATFORM_TOOLSET_VERSION "14.34") +endif() From 0605fa52d828588fcd8c7b76ccfb8929ef90d05a Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 22 Jul 2024 14:22:37 -0400 Subject: [PATCH 111/119] Add port overlay for sqlite3. This is an exact copy of: https://github.com/microsoft/vcpkg/tree/2024.02.14/ports/sqlite3 --- extern/vcpkg-overlays/sqlite3/CMakeLists.txt | 81 +++++++++++++++ .../sqlite3/add-config-include.patch | 24 +++++ .../vcpkg-overlays/sqlite3/fix-arm-uwp.patch | 33 +++++++ extern/vcpkg-overlays/sqlite3/portfile.cmake | 98 +++++++++++++++++++ .../sqlite3/sqlite3-config.in.cmake | 7 ++ .../sqlite3/sqlite3-vcpkg-config.h.in | 29 ++++++ extern/vcpkg-overlays/sqlite3/sqlite3.pc.in | 11 +++ extern/vcpkg-overlays/sqlite3/usage | 5 + extern/vcpkg-overlays/sqlite3/vcpkg.json | 74 ++++++++++++++ 9 files changed, 362 insertions(+) create mode 100644 extern/vcpkg-overlays/sqlite3/CMakeLists.txt create mode 100644 extern/vcpkg-overlays/sqlite3/add-config-include.patch create mode 100644 extern/vcpkg-overlays/sqlite3/fix-arm-uwp.patch create mode 100644 extern/vcpkg-overlays/sqlite3/portfile.cmake create mode 100644 extern/vcpkg-overlays/sqlite3/sqlite3-config.in.cmake create mode 100644 extern/vcpkg-overlays/sqlite3/sqlite3-vcpkg-config.h.in create mode 100644 extern/vcpkg-overlays/sqlite3/sqlite3.pc.in create mode 100644 extern/vcpkg-overlays/sqlite3/usage create mode 100644 extern/vcpkg-overlays/sqlite3/vcpkg.json diff --git a/extern/vcpkg-overlays/sqlite3/CMakeLists.txt b/extern/vcpkg-overlays/sqlite3/CMakeLists.txt new file mode 100644 index 000000000..1144965d1 --- /dev/null +++ b/extern/vcpkg-overlays/sqlite3/CMakeLists.txt @@ -0,0 +1,81 @@ +cmake_minimum_required(VERSION 3.10) + +project(sqlite3 C) + +option(WITH_ZLIB "Build sqlite3 with zlib support" OFF) +option(SQLITE3_SKIP_TOOLS "Disable build sqlite3 executable" OFF) + +set(PKGCONFIG_LIBS_PRIVATE "") + +add_library(sqlite3 sqlite3.c sqlite3.rc) + +target_include_directories(sqlite3 PUBLIC $ $) + +target_compile_definitions( + sqlite3 + PRIVATE + $<$:SQLITE_DEBUG=1> + $<$:SQLITE_ENABLE_SELECTTRACE> + $<$:SQLITE_ENABLE_WHERETRACE> + $<$:RC_VERONLY> +) + +if (BUILD_SHARED_LIBS) + if (WIN32) + target_compile_definitions(sqlite3 PRIVATE "SQLITE_API=__declspec(dllexport)") + else() + target_compile_definitions(sqlite3 PRIVATE "SQLITE_API=__attribute__((visibility(\"default\")))") + endif() +endif() + +if (NOT WIN32) + find_package(Threads REQUIRED) + target_link_libraries(sqlite3 PRIVATE Threads::Threads ${CMAKE_DL_LIBS}) + string(APPEND PKGCONFIG_LIBS_PRIVATE " -pthread") + foreach(LIB IN LISTS CMAKE_DL_LIBS) + string(APPEND PKGCONFIG_LIBS_PRIVATE " -l${LIB}") + endforeach() + + if(SQLITE_ENABLE_FTS5 OR SQLITE_ENABLE_MATH_FUNCTIONS) + find_library(HAVE_LIBM m) + if(HAVE_LIBM) + target_link_libraries(sqlite3 PRIVATE m) + string(APPEND PKGCONFIG_LIBS_PRIVATE " -lm") + endif() + endif() +endif() + +if(NOT SQLITE3_SKIP_TOOLS) + add_executable(sqlite3-bin shell.c) + set_target_properties(sqlite3-bin PROPERTIES + OUTPUT_NAME sqlite3 + PDB_NAME "sqlite3${CMAKE_EXECUTABLE_SUFFIX}.pdb" + ) + + target_link_libraries(sqlite3-bin PRIVATE sqlite3) + if (WITH_ZLIB) + find_package(ZLIB REQUIRED) + target_link_libraries(sqlite3-bin PRIVATE ZLIB::ZLIB) + target_compile_definitions(sqlite3-bin PRIVATE SQLITE_HAVE_ZLIB) + endif() + + install(TARGETS sqlite3-bin sqlite3 + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) +endif() + +install( + TARGETS sqlite3 + EXPORT unofficial-sqlite3-targets + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +install(FILES sqlite3.h sqlite3ext.h sqlite3-vcpkg-config.h DESTINATION include CONFIGURATIONS Release) +install(EXPORT unofficial-sqlite3-targets NAMESPACE unofficial::sqlite3:: FILE unofficial-sqlite3-targets.cmake DESTINATION share/unofficial-sqlite3) + +configure_file(sqlite3.pc.in sqlite3.pc @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sqlite3.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") diff --git a/extern/vcpkg-overlays/sqlite3/add-config-include.patch b/extern/vcpkg-overlays/sqlite3/add-config-include.patch new file mode 100644 index 000000000..7942c9cf3 --- /dev/null +++ b/extern/vcpkg-overlays/sqlite3/add-config-include.patch @@ -0,0 +1,24 @@ +diff --git a/sqlite3.c b/sqlite3.c +index a1fbd60..68a4e21 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -22,6 +22,7 @@ + */ + #define SQLITE_CORE 1 + #define SQLITE_AMALGAMATION 1 ++#include "sqlite3-vcpkg-config.h" + #ifndef SQLITE_PRIVATE + # define SQLITE_PRIVATE static + #endif +diff --git a/sqlite3.h b/sqlite3.h +index 0376113..271cf53 100644 +--- a/sqlite3.h ++++ b/sqlite3.h +@@ -32,6 +32,7 @@ + */ + #ifndef SQLITE3_H + #define SQLITE3_H ++#include "sqlite3-vcpkg-config.h" + #include /* Needed for the definition of va_list */ + + /* diff --git a/extern/vcpkg-overlays/sqlite3/fix-arm-uwp.patch b/extern/vcpkg-overlays/sqlite3/fix-arm-uwp.patch new file mode 100644 index 000000000..03e092965 --- /dev/null +++ b/extern/vcpkg-overlays/sqlite3/fix-arm-uwp.patch @@ -0,0 +1,33 @@ +diff --git a/shell.c b/shell.c +index 10d8cc1..99f37a5 100644 +--- a/shell.c ++++ b/shell.c +@@ -316,7 +316,11 @@ static int hasTimer(void){ + */ + hProcess = GetCurrentProcess(); + if( hProcess ){ ++#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) + HINSTANCE hinstLib = LoadLibrary(TEXT("Kernel32.dll")); ++#else ++ HINSTANCE hinstLib = LoadPackagedLibrary(TEXT("Kernel32.dll"), 0); ++#endif + if( NULL != hinstLib ){ + getProcessTimesAddr = + (GETPROCTIMES) GetProcAddress(hinstLib, "GetProcessTimes"); +@@ -2437,10 +2441,16 @@ static int writeFile( + if( zUnicodeName==0 ){ + return 1; + } ++#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) + hFile = CreateFileW( + zUnicodeName, FILE_WRITE_ATTRIBUTES, 0, NULL, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, NULL + ); ++#else ++ hFile = CreateFile2( ++ zUnicodeName, FILE_WRITE_ATTRIBUTES, 0, OPEN_EXISTING, NULL ++ ); ++#endif + sqlite3_free(zUnicodeName); + if( hFile!=INVALID_HANDLE_VALUE ){ + BOOL bResult = SetFileTime(hFile, NULL, &lastAccess, &lastWrite); diff --git a/extern/vcpkg-overlays/sqlite3/portfile.cmake b/extern/vcpkg-overlays/sqlite3/portfile.cmake new file mode 100644 index 000000000..4dc157bb9 --- /dev/null +++ b/extern/vcpkg-overlays/sqlite3/portfile.cmake @@ -0,0 +1,98 @@ +string(REGEX REPLACE "^([0-9]+)[.]([0-9]+)[.]([0-9]+)[.]([0-9]+)" "\\1,0\\2,0\\3,0\\4," SQLITE_VERSION "${VERSION}.0") +string(REGEX REPLACE "^([0-9]+),0*([0-9][0-9]),0*([0-9][0-9]),0*([0-9][0-9])," "\\1\\2\\3\\4" SQLITE_VERSION "${SQLITE_VERSION}") + +vcpkg_download_distfile(ARCHIVE + URLS "https://sqlite.org/2024/sqlite-autoconf-${SQLITE_VERSION}.tar.gz" + FILENAME "sqlite-autoconf-${SQLITE_VERSION}.zip" + SHA512 40ae9ba1dea234aacfecf44a6b1c0713c24348d8d475503c11f1d92ed2fffb54a765bbd0669f39aa09d20f42cbcfac4dedcf7e64f4421b8762eebfc66399aa9a +) + +vcpkg_extract_source_archive( + SOURCE_PATH + ARCHIVE "${ARCHIVE}" + PATCHES + fix-arm-uwp.patch + add-config-include.patch +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + if(VCPKG_TARGET_IS_WINDOWS) + set(SQLITE_API "__declspec(dllimport)") + else() + set(SQLITE_API "__attribute__((visibility(\"default\")))") + endif() +else() + set(SQLITE_API "") +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + fts5 SQLITE_ENABLE_FTS5 + math SQLITE_ENABLE_MATH_FUNCTIONS + zlib WITH_ZLIB + INVERTED_FEATURES + tool SQLITE3_SKIP_TOOLS +) +vcpkg_check_features(OUT_FEATURE_OPTIONS none # only using the script-mode side-effects + FEATURES + dbstat SQLITE_ENABLE_DBSTAT_VTAB + fts3 SQLITE_ENABLE_FTS3 + fts4 SQLITE_ENABLE_FTS4 + memsys3 SQLITE_ENABLE_MEMSYS3 + memsys5 SQLITE_ENABLE_MEMSYS5 + limit SQLITE_ENABLE_UPDATE_DELETE_LIMIT + rtree SQLITE_ENABLE_RTREE + session SQLITE_ENABLE_SESSION + session SQLITE_ENABLE_PREUPDATE_HOOK + omit-load-extension SQLITE_OMIT_LOAD_EXTENSION + geopoly SQLITE_ENABLE_GEOPOLY + soundex SQLITE_SOUNDEX + INVERTED_FEATURES + json1 SQLITE_OMIT_JSON +) + +if(VCPKG_TARGET_IS_WINDOWS) + set(SQLITE_OS_WIN "1") + if(VCPKG_TARGET_IS_UWP) + set(SQLITE_OS_WINRT "1") + endif() +else() + set(SQLITE_OS_UNIX "1") +endif() + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/sqlite3.pc.in" DESTINATION "${SOURCE_PATH}") +configure_file("${CMAKE_CURRENT_LIST_DIR}/sqlite3-vcpkg-config.h.in" "${SOURCE_PATH}/sqlite3-vcpkg-config.h" @ONLY) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DPKGCONFIG_VERSION=${VERSION} + OPTIONS_DEBUG + -DSQLITE3_SKIP_TOOLS=ON + MAYBE_UNUSED_VARIABLES + SQLITE_ENABLE_FTS5 + SQLITE_ENABLE_MATH_FUNCTIONS +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT} CONFIG_PATH share/unofficial-${PORT}) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +if("tool" IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES sqlite3 DESTINATION "${CURRENT_PACKAGES_DIR}/tools" AUTO_CLEAN) +endif() + +configure_file( + "${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake" + "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-sqlite3-config.cmake" + @ONLY +) + +vcpkg_fixup_pkgconfig() +vcpkg_copy_pdbs() + +file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/extern/vcpkg-overlays/sqlite3/sqlite3-config.in.cmake b/extern/vcpkg-overlays/sqlite3/sqlite3-config.in.cmake new file mode 100644 index 000000000..c98d03082 --- /dev/null +++ b/extern/vcpkg-overlays/sqlite3/sqlite3-config.in.cmake @@ -0,0 +1,7 @@ + +if(NOT WIN32) + include(CMakeFindDependencyMacro) + find_dependency(Threads) +endif() + +include(${CMAKE_CURRENT_LIST_DIR}/unofficial-sqlite3-targets.cmake) diff --git a/extern/vcpkg-overlays/sqlite3/sqlite3-vcpkg-config.h.in b/extern/vcpkg-overlays/sqlite3/sqlite3-vcpkg-config.h.in new file mode 100644 index 000000000..f3705bf50 --- /dev/null +++ b/extern/vcpkg-overlays/sqlite3/sqlite3-vcpkg-config.h.in @@ -0,0 +1,29 @@ +/* + * This file was generated to inject vcpkg feature selections into the installed copy of + * sqlite so that consumers need not get the values from pkgconfig or CMake configs. + * + * No include guard: intentionally reuses the include guard from sqlite3.h. + */ + +#ifndef SQLITE_API +#cmakedefine SQLITE_API @SQLITE_API@ +#endif + +#define SQLITE_ENABLE_UNLOCK_NOTIFY 1 +#cmakedefine SQLITE_ENABLE_FTS3 +#cmakedefine SQLITE_ENABLE_FTS4 +#cmakedefine SQLITE_ENABLE_FTS5 +#cmakedefine SQLITE_ENABLE_MEMSYS3 +#cmakedefine SQLITE_ENABLE_MEMSYS5 +#cmakedefine SQLITE_ENABLE_MATH_FUNCTIONS +#cmakedefine SQLITE_ENABLE_UPDATE_DELETE_LIMIT +#cmakedefine SQLITE_ENABLE_RTREE +#cmakedefine SQLITE_ENABLE_SESSION +#cmakedefine SQLITE_ENABLE_PREUPDATE_HOOK +#cmakedefine SQLITE_OMIT_LOAD_EXTENSION +#cmakedefine SQLITE_ENABLE_GEOPOLY +#cmakedefine SQLITE_OMIT_JSON +#cmakedefine SQLITE_OS_WIN @SQLITE_OS_WIN@ +#cmakedefine SQLITE_OS_WINRT @SQLITE_OS_WINRT@ +#define SQLITE_ENABLE_COLUMN_METADATA 1 +#cmakedefine SQLITE_OS_UNIX @SQLITE_OS_UNIX@ diff --git a/extern/vcpkg-overlays/sqlite3/sqlite3.pc.in b/extern/vcpkg-overlays/sqlite3/sqlite3.pc.in new file mode 100644 index 000000000..d265632d1 --- /dev/null +++ b/extern/vcpkg-overlays/sqlite3/sqlite3.pc.in @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: SQLite +Description: SQL database engine +Version: @PKGCONFIG_VERSION@ +Libs: -L${libdir} -lsqlite3 +Libs.private: @PKGCONFIG_LIBS_PRIVATE@ +Cflags: -I${includedir} diff --git a/extern/vcpkg-overlays/sqlite3/usage b/extern/vcpkg-overlays/sqlite3/usage new file mode 100644 index 000000000..7f79c6d46 --- /dev/null +++ b/extern/vcpkg-overlays/sqlite3/usage @@ -0,0 +1,5 @@ +sqlite3 provides pkgconfig bindings. +sqlite3 provides CMake targets: + + find_package(unofficial-sqlite3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3) diff --git a/extern/vcpkg-overlays/sqlite3/vcpkg.json b/extern/vcpkg-overlays/sqlite3/vcpkg.json new file mode 100644 index 000000000..fe6ec5256 --- /dev/null +++ b/extern/vcpkg-overlays/sqlite3/vcpkg.json @@ -0,0 +1,74 @@ +{ + "name": "sqlite3", + "version": "3.45.0", + "description": "SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.", + "homepage": "https://sqlite.org/", + "license": "blessing", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "json1" + ], + "features": { + "dbstat": { + "description": "Enable the DBSTAT virtual table" + }, + "fts3": { + "description": "Enable the FTS3 extension" + }, + "fts4": { + "description": "Enable the FTS4 extension" + }, + "fts5": { + "description": "Enable the FTS5 extension" + }, + "geopoly": { + "description": "Enable geopoly functionality for sqlite3" + }, + "json1": { + "description": "Enable JSON functionality for sqlite3" + }, + "limit": { + "description": "Enable the UPDATE/DELETE LIMIT clause" + }, + "math": { + "description": "Enable math functions" + }, + "memsys3": { + "description": "Enable MEMSYS3" + }, + "memsys5": { + "description": "Enable MEMSYS5" + }, + "omit-load-extension": { + "description": "Enable loading of external extensions" + }, + "rtree": { + "description": "Enable the RTREE extension" + }, + "session": { + "description": "Enable the SESSION extension" + }, + "soundex": { + "description": "Enable the SOUNDEX scalar function" + }, + "tool": { + "description": "Build sqlite3 executable", + "supports": "!uwp" + }, + "zlib": { + "description": "Build sqlite3 command line tool with zlib support; has no effect on the library itself", + "dependencies": [ + "zlib" + ] + } + } +} From c83b36b388b4d66593529d35c7a282684ec4235a Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 23 Jul 2024 14:19:39 -0400 Subject: [PATCH 112/119] Isolate sqlite. --- Source/CesiumEditor/CesiumEditor.Build.cs | 3 ++- Source/CesiumRuntime/CesiumRuntime.Build.cs | 3 ++- extern/cesium-native | 2 +- extern/vcpkg-overlays/sqlite3/CMakeLists.txt | 2 +- extern/vcpkg-overlays/sqlite3/portfile.cmake | 8 +++++++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs index 1a668ec26..965ebdcda 100644 --- a/Source/CesiumEditor/CesiumEditor.Build.cs +++ b/Source/CesiumEditor/CesiumEditor.Build.cs @@ -84,7 +84,8 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) { "Core", "UnrealEd", - "CesiumRuntime" + "CesiumRuntime", + "OpenSSL" } ); diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index 8421b9270..a1cfa1945 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -94,7 +94,8 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) "SunPosition", "DeveloperSettings", "UMG", - "Renderer" + "Renderer", + "OpenSSL" } ); diff --git a/extern/cesium-native b/extern/cesium-native index 7c9ea8417..d6703f30a 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 7c9ea8417828cee3dec55e1841e148b82d513822 +Subproject commit d6703f30a0e2bbb94090298975a68dfbe6a3828e diff --git a/extern/vcpkg-overlays/sqlite3/CMakeLists.txt b/extern/vcpkg-overlays/sqlite3/CMakeLists.txt index 1144965d1..d4257841d 100644 --- a/extern/vcpkg-overlays/sqlite3/CMakeLists.txt +++ b/extern/vcpkg-overlays/sqlite3/CMakeLists.txt @@ -74,7 +74,7 @@ install( ARCHIVE DESTINATION lib ) -install(FILES sqlite3.h sqlite3ext.h sqlite3-vcpkg-config.h DESTINATION include CONFIGURATIONS Release) +install(FILES sqlite3.h sqlite3ext.h cesium_sqlite3-vcpkg-config.h DESTINATION include CONFIGURATIONS Release) install(EXPORT unofficial-sqlite3-targets NAMESPACE unofficial::sqlite3:: FILE unofficial-sqlite3-targets.cmake DESTINATION share/unofficial-sqlite3) configure_file(sqlite3.pc.in sqlite3.pc @ONLY) diff --git a/extern/vcpkg-overlays/sqlite3/portfile.cmake b/extern/vcpkg-overlays/sqlite3/portfile.cmake index 4dc157bb9..f58848155 100644 --- a/extern/vcpkg-overlays/sqlite3/portfile.cmake +++ b/extern/vcpkg-overlays/sqlite3/portfile.cmake @@ -62,7 +62,13 @@ endif() file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") file(COPY "${CMAKE_CURRENT_LIST_DIR}/sqlite3.pc.in" DESTINATION "${SOURCE_PATH}") -configure_file("${CMAKE_CURRENT_LIST_DIR}/sqlite3-vcpkg-config.h.in" "${SOURCE_PATH}/sqlite3-vcpkg-config.h" @ONLY) +configure_file("${CMAKE_CURRENT_LIST_DIR}/sqlite3-vcpkg-config.h.in" "${SOURCE_PATH}/cesium_sqlite3-vcpkg-config.h" @ONLY) + +vcpkg_replace_string("${SOURCE_PATH}/sqlite3.c" "sqlite3" "cesium_sqlite3") +vcpkg_replace_string("${SOURCE_PATH}/shell.c" "sqlite3" "cesium_sqlite3") +vcpkg_replace_string("${SOURCE_PATH}/sqlite3.h" "sqlite3" "cesium_sqlite3") +vcpkg_replace_string("${SOURCE_PATH}/sqlite3ext.h" "sqlite3" "cesium_sqlite3") +vcpkg_replace_string("${SOURCE_PATH}/sqlite3rc.h" "sqlite3" "cesium_sqlite3") vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" From 89eef570efcaca6b500ea4cf55a05c063eef84be Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 24 Jul 2024 14:40:36 -0400 Subject: [PATCH 113/119] Update cesium-native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index d6703f30a..23eaa7f37 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit d6703f30a0e2bbb94090298975a68dfbe6a3828e +Subproject commit 23eaa7f37028826b9c3d141ca7bf5f4228bbe330 From 00a26bd8823f3e9b69d86ec584eb4580e601ac1b Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 25 Jul 2024 10:06:49 -0400 Subject: [PATCH 114/119] Fix find_package(OpenSSL). It's not really clear why the host paths need to be searched for libraries and includes, but it seems that they do. --- extern/unreal-android-toolchain.cmake | 4 ++-- extern/unreal-ios-toolchain.cmake | 2 ++ extern/unreal-linux-toolchain.cmake | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/extern/unreal-android-toolchain.cmake b/extern/unreal-android-toolchain.cmake index 05c22af59..d798059d8 100644 --- a/extern/unreal-android-toolchain.cmake +++ b/extern/unreal-android-toolchain.cmake @@ -8,8 +8,8 @@ SET(CMAKE_ANDROID_STL_TYPE c++_shared) # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories -SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) SET(HTTPLIB_USE_OPENSSL_IF_AVAILABLE OFF) diff --git a/extern/unreal-ios-toolchain.cmake b/extern/unreal-ios-toolchain.cmake index 61bcd85e8..dc9120b7f 100644 --- a/extern/unreal-ios-toolchain.cmake +++ b/extern/unreal-ios-toolchain.cmake @@ -4,4 +4,6 @@ set(CMAKE_OSX_ARCHITECTURES arm64) set(CMAKE_SYSTEM_PROCESSOR arm64) set(CMAKE_OSX_DEPLOYMENT_TARGET 15) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) diff --git a/extern/unreal-linux-toolchain.cmake b/extern/unreal-linux-toolchain.cmake index 3ae2d8eb4..b52fd39af 100644 --- a/extern/unreal-linux-toolchain.cmake +++ b/extern/unreal-linux-toolchain.cmake @@ -17,6 +17,6 @@ SET(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld -target x86_64-unknown-linux-gnu --sysr # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories -SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) From e727ba0312990fa32852d8e0e102f5a37e199727 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 15 Aug 2024 09:52:27 +1000 Subject: [PATCH 115/119] Update cesium-native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 23eaa7f37..ac74cc3cd 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 23eaa7f37028826b9c3d141ca7bf5f4228bbe330 +Subproject commit ac74cc3cdaae0eb5ea0e342f8df48924bdcbacd2 From fc4ff10565167f694bd5d96addb2daefcbd4631d Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 15 Aug 2024 11:48:05 +1000 Subject: [PATCH 116/119] Update cesium-native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index ac74cc3cd..b1d7da479 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit ac74cc3cdaae0eb5ea0e342f8df48924bdcbacd2 +Subproject commit b1d7da4795ee01bcbec58353a75bf72d3a3d4596 From 1dd7194865e812fce52646f018c32d80304550eb Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 16 Aug 2024 14:55:20 +1000 Subject: [PATCH 117/119] Exclude openssl from native installation, rather than from build. --- Source/CesiumEditor/CesiumEditor.Build.cs | 4 ---- Source/CesiumRuntime/CesiumRuntime.Build.cs | 4 ---- extern/CMakeLists.txt | 4 ++++ extern/cesium-native | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs index 965ebdcda..a100ee757 100644 --- a/Source/CesiumEditor/CesiumEditor.Build.cs +++ b/Source/CesiumEditor/CesiumEditor.Build.cs @@ -73,10 +73,6 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target) string[] allLibs = Directory.GetFiles(libPath, libSearchPattern); - // Remove libssl and libcrypto because these come from Unreal Engine itself - // TODO: Exclude these from the cesium-native side instead of excluding them here. - allLibs = allLibs.Where(l => !l.Contains("libssl") && !l.Contains("libcrypto")).ToArray(); - PublicAdditionalLibraries.AddRange(allLibs); PublicDependencyModuleNames.AddRange( diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs index a1cfa1945..fb9ee0fe8 100644 --- a/Source/CesiumRuntime/CesiumRuntime.Build.cs +++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs @@ -72,10 +72,6 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target) string[] allLibs = Directory.GetFiles(libPath, libSearchPattern); - // Remove libssl and libcrypto because these come from Unreal Engine itself - // TODO: Exclude these from the cesium-native side instead of excluding them here. - allLibs = allLibs.Where(l => !l.Contains("libssl") && !l.Contains("libcrypto")).ToArray(); - PublicAdditionalLibraries.AddRange(allLibs); PublicDependencyModuleNames.AddRange( diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index d1bf56861..5fce667b1 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -121,6 +121,10 @@ if (NOT VCPKG_TRIPLET) endif() endif() +# Our OpenSSL is part of Unreal Engine, so need to install it. +set(CESIUM_EXCLUDE_INSTALL_HEADERS openssl) +set(CESIUM_EXCLUDE_INSTALL_STATIC_LIBS openssl) + add_subdirectory(cesium-native) # cesium-native doesn't require this header to be public, but Cesium for Unreal wants to use it. diff --git a/extern/cesium-native b/extern/cesium-native index b1d7da479..3b3643517 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit b1d7da4795ee01bcbec58353a75bf72d3a3d4596 +Subproject commit 3b364351795b4c60d58f3ddba16526c56c317c9a From b1e7bb1b9f66a7051e25d42b19c3f2249d1b6552 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 16 Aug 2024 15:21:56 +1000 Subject: [PATCH 118/119] Fix typo. --- extern/vcpkg-overlays/zlib-ng/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/vcpkg-overlays/zlib-ng/portfile.cmake b/extern/vcpkg-overlays/zlib-ng/portfile.cmake index c3261757e..ec705c042 100644 --- a/extern/vcpkg-overlays/zlib-ng/portfile.cmake +++ b/extern/vcpkg-overlays/zlib-ng/portfile.cmake @@ -20,7 +20,7 @@ vcpkg_cmake_configure( # "NOT ARCH STREQUAL \"aarch64\"" that is meant to set `WITH_ARMV6` to FALSE is not # triggered because our ARCH is `aarch64-none-linux-android21`. It's not clear if this # is something quirky about our environment or if the fix is just not robust. - # Either way, forcing WITH_ARMV6=OFF here fixes the probelm and should be reasonable + # Either way, forcing WITH_ARMV6=OFF here fixes the problem and should be reasonable # on all platforms that Cesium for Unreal supports. -DWITH_ARMV6=OFF OPTIONS_RELEASE From 44a47ee070486ece034ae0978400238d229a8ecc Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 16 Aug 2024 15:32:52 +1000 Subject: [PATCH 119/119] Update CHANGES.md. --- CHANGES.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index d22d2e4c5..4c19a0b2e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,15 @@ # Change Log +### ? - ? + +##### Additions :tada: + +- Added universal (Intel and Apple Silicon) binaries for Unreal Engine 5.2. Unreal Engine 5.3 and 5.4 already had universal binaries. + +##### Fixes :wrench: + +- Debug sections are no longer compressed on Linux and Android, improving compatibility. + ### v2.7.1 - 2024-08-01 ##### Fixes :wrench: