@@ -90,25 +90,22 @@ 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 " )
93+ if (NOT SECP256K1_ASM STREQUAL "OFF " )
9494 enable_language (ASM)
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 "arm32" AND NOT HAVE_ARM32_ASM)
100100 message (FATAL_ERROR "ARM32 assembly requested but not available." )
101+ elseif (SECP256K1_ASM STREQUAL "x86_64" AND NOT HAVE_X86_64_ASM)
102+ message (FATAL_ERROR "x86_64 assembly requested but not available." )
101103 endif ()
102- elseif (NOT SECP256K1_ASM STREQUAL "OFF" )
103- include (CheckX86_64Assembly)
104- check_x86_64_assembly()
105104 if (HAVE_X86_64_ASM)
106- set (SECP256K1_ASM "x86_64" )
107105 add_compile_definitions (USE_ASM_X86_64=1)
108- elseif (SECP256K1_ASM STREQUAL "AUTO" )
109- set (SECP256K1_ASM "OFF" )
110- else ()
111- message (FATAL_ERROR "x86_64 assembly requested but not available." )
106+ elseif (HAVE_ARM32_ASM)
107+ add_compile_definitions (USE_EXTERNAL_ASM=1)
108+ set (SECP256K1_USE_EXTERNAL_ASM TRUE )
112109 endif ()
113110endif ()
114111
0 commit comments