]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Disable masm on msbuild for blake3 with VS
authorRafael Kitover <rkitover@gmail.com>
Mon, 22 May 2023 22:13:19 +0000 (22:13 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 6 Jun 2023 19:32:17 +0000 (21:32 +0200)
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 <rkitover@gmail.com>
src/third_party/blake3/CMakeLists.txt

index a30342d5d332cfea5049e28b5404da7982997af3..1e30eb3cfe1200076cc2e901e3fed483ba4c7d04 100644 (file)
@@ -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()