[CMAKE] Fix ARM64 build

Since VS 17.14.36203.30 / MSVC 19.44.35209.0 the default behavior on ARM64 is to not inline _Interlocked* functions. Until we have those implemented, we disable this feature, going back to the old behavior.
For additional details / tracking of the implementation see CORE-20255
This commit is contained in:
Timo Kreuzer 2025-06-21 13:35:03 +03:00
parent 6ed46baf49
commit 1378f6b543

View file

@ -78,6 +78,14 @@ if(ARCH STREQUAL "amd64" AND MSVC_VERSION GREATER 1922)
add_link_options(/d2:-FH4-) add_link_options(/d2:-FH4-)
endif() endif()
# Workaround: Newer ARM64 builds do not inline interlocked functions by default.
# A better fix would be to implement the interlocked functions in assembly.
# See https://devblogs.microsoft.com/cppblog/introducing-the-forceinterlockedfunctions-switch-for-arm64/
if(ARCH STREQUAL "arm64" AND MSVC_VERSION GREATER_EQUAL 1944)
message(STATUS "Forcing interlocked functions to be inlined for ARM64 builds")
add_compile_options("/forceInterlockedFunctions-")
endif()
# Generate Warnings Level 3 # Generate Warnings Level 3
add_compile_options(/W3) add_compile_options(/W3)