@@ -90,25 +90,25 @@ mark_as_advanced(FORCE SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY)
9090set (SECP256K1_ASM "AUTO" CACHE STRING "Assembly to use: \" AUTO\" , \" OFF\" , \" x86_64\" or \" arm32\" (experimental). [default=AUTO]" )
9191set_property (CACHE SECP256K1_ASM PROPERTY STRINGS "AUTO" "OFF" "x86_64" "arm32" )
9292check_string_option_value(SECP256K1_ASM)
93- if (SECP256K1_ASM STREQUAL "arm32" )
94- enable_language (ASM)
93+ if (NOT SECP256K1_ASM STREQUAL "OFF" )
94+ enable_language (ASM OPTIONAL )
95+ include (CheckX86_64Assembly)
9596 include (CheckArm32Assembly)
97+ check_x86_64_assembly()
9698 check_arm32_assembly()
97- if (HAVE_ARM32_ASM )
98- add_compile_definitions (USE_EXTERNAL_ASM=1 )
99- else ( )
99+ if (SECP256K1_ASM STREQUAL "x86_64" AND NOT HAVE_X86_64_ASM )
100+ message (FATAL_ERROR "x86_64 assembly requested but not available." )
101+ elseif (SECP256K1_ASM STREQUAL "arm32" AND NOT HAVE_ARM32_ASM )
100102 message (FATAL_ERROR "ARM32 assembly requested but not available." )
101103 endif ()
102- elseif (SECP256K1_ASM)
103- include (CheckX86_64Assembly)
104- check_x86_64_assembly()
105104 if (HAVE_X86_64_ASM)
106105 set (SECP256K1_ASM "x86_64" )
107106 add_compile_definitions (USE_ASM_X86_64=1)
108- elseif (SECP256K1_ASM STREQUAL "AUTO" )
109- set (SECP256K1_ASM "OFF" )
107+ elseif (HAVE_ARM32_ASM)
108+ set (SECP256K1_ASM "arm32" )
109+ add_compile_definitions (USE_EXTERNAL_ASM=1)
110110 else ()
111- message (FATAL_ERROR "x86_64 assembly requested but not available. " )
111+ set (SECP256K1_ASM "OFF " )
112112 endif ()
113113endif ()
114114
0 commit comments