49 lines
1.7 KiB
Diff
49 lines
1.7 KiB
Diff
--- src/third_party/blake3/CMakeLists.txt 2021-05-10 00:09:46.000000000 +0530
|
|
+++ src/third_party/blake3/CMakeLists.txt.mod 2021-06-11 09:05:04.054571163 +0530
|
|
@@ -17,44 +17,7 @@
|
|
set(compile_flags "${others_flags}")
|
|
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()
|
|
-
|
|
- set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
|
-
|
|
- # Must set CMAKE_ASM_MASM_CREATE_STATIC_LIBRARY explicitly otherwise try_compile
|
|
- # fails, see https://discourse.cmake.org/t/building-lib-file-from-asm-cmake-bug/1959
|
|
- try_compile(
|
|
- ${have_feature}
|
|
- ${CMAKE_CURRENT_BINARY_DIR}
|
|
- "${CMAKE_CURRENT_SOURCE_DIR}/blake3_${feature}${suffix}"
|
|
- CMAKE_FLAGS -DCMAKE_ASM_MASM_CREATE_STATIC_LIBRARY=${CMAKE_C_CREATE_STATIC_LIBRARY}
|
|
- COMPILE_DEFINITIONS ${compile_flags})
|
|
-
|
|
- unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
|
|
-
|
|
- if(NOT CMAKE_REQUIRED_QUIET)
|
|
- if (${${have_feature}})
|
|
- message(STATUS "Performing Test ${have_feature} - Success")
|
|
- else()
|
|
- message(STATUS "Performing Test ${have_feature} - Failed")
|
|
- endif()
|
|
- endif()
|
|
- endif()
|
|
-
|
|
- # If the assembler variant didn't work, try the c variant.
|
|
+ # Force use the C variant
|
|
if(NOT ${have_feature})
|
|
string(TOUPPER "have_c_${feature}" have_feature)
|
|
set(suffix ".c")
|