From 350787245e7e894c8a472b176545f59a10e9dadb Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Mon, 22 May 2023 22:13:19 +0000 Subject: [PATCH] fix: Disable masm on msbuild for blake3 with VS Because of some bug with either msbuild or the cmake generator, the C compiler flags are passed to the masm assembler making it fail. Use the C intrinsic versions for blake3 when msbuild is in use. Fix #1278 Signed-off-by: Rafael Kitover --- src/third_party/blake3/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/third_party/blake3/CMakeLists.txt b/src/third_party/blake3/CMakeLists.txt index a30342d5d..1e30eb3cf 100644 --- a/src/third_party/blake3/CMakeLists.txt +++ b/src/third_party/blake3/CMakeLists.txt @@ -27,7 +27,11 @@ function(add_source_if_enabled feature msvc_flags others_flags intrinsic) # First check if it's possible to use the assembler variant for the feature. string(TOUPPER "have_asm_${feature}" have_feature) - if(NOT DEFINED "${have_feature}" AND CMAKE_SIZEOF_VOID_P EQUAL 8) + if(NOT DEFINED "${have_feature}" AND CMAKE_SIZEOF_VOID_P EQUAL 8 +# Force intrinsic version for msbuild because of a bug in the cmake generator +# or msbuild itself with masm flags. + AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") + if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Performing Test ${have_feature}") endif() -- 2.47.2