Skip to content

Commit

Permalink
Use correct MSVC version for UE version.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Nov 13, 2024
1 parent 01a61bd commit 01742ba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions extern/vcpkg-overlays/triplets/x64-windows-unreal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,17 @@ list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_C_FLAGS_DEBUG:STRING=/MD /Z7
# 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})
# Toolset version should be 14.38 on UE 5.5+, 14.34 on prior versions.
set(VCPKG_PLATFORM_TOOLSET_VERSION "14.34")

set(UNREAL_ENGINE_BUILD_VERSION_FILENAME "$ENV{UNREAL_ENGINE_ROOT}/Engine/Build/Build.version")
if(EXISTS "${UNREAL_ENGINE_BUILD_VERSION_FILENAME}")
file(READ "${UNREAL_ENGINE_BUILD_VERSION_FILENAME}" UNREAL_ENGINE_BUILD_VERSION)
string(JSON UNREAL_MAJOR_VERSION GET "${UNREAL_ENGINE_BUILD_VERSION}" "MajorVersion")
string(JSON UNREAL_MINOR_VERSION GET "${UNREAL_ENGINE_BUILD_VERSION}" "MinorVersion")
if("${UNREAL_MAJOR_VERSION}" GREATER "5" OR "${UNREAL_MINOR_VERSION}" GREATER_EQUAL "5")
# This is UE 5.5+, so use MSVC 14.38.
set(VCPKG_PLATFORM_TOOLSET_VERSION "14.38")
endif()
endif()
endif()

0 comments on commit 01742ba

Please sign in to comment.