]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix source file suffix selection for libblake3
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 1 Jul 2021 06:34:54 +0000 (08:34 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 1 Jul 2021 09:57:18 +0000 (11:57 +0200)
In the add_source_if_enabled function in
src/third_party/blake3/CMakeLists.txt, the suffix variable is unset on a
CMake reconfigure in an already configured build tree. This makes CMake
guess the extension and always choose ā€œ.cā€ on a reconfigure.

Fix this by always setting the suffix variable.

src/third_party/blake3/CMakeLists.txt

index 581ee816e41d9a3eb64fe624468fb950f480cb66..14583773559c67a8a8ce56eb3509993409e31a4e 100644 (file)
@@ -17,17 +17,17 @@ function(add_source_if_enabled feature msvc_flags others_flags intrinsic)
     set(compile_flags "${others_flags}")
   endif()
 
+  if(MSVC)
+    set(suffix "_x86-64_windows_msvc.asm")
+  elseif(WIN32)
+    set(suffix "_x86-64_windows_gnu.S")
+  else()
+    set(suffix "_x86-64_unix.S")
+  endif()
+
   # 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(MSVC)
-      set(suffix "_x86-64_windows_msvc.asm")
-    elseif(WIN32)
-      set(suffix "_x86-64_windows_gnu.S")
-    else()
-      set(suffix "_x86-64_unix.S")
-    endif()
-
     if(NOT CMAKE_REQUIRED_QUIET)
       message(STATUS "Performing Test ${have_feature}")
     endif()