@@ -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+   include  (CheckX86_64Assembly )
9595  include (CheckArm32Assembly)
96+   check_x86_64_assembly()
9697  check_arm32_assembly()
97-   if (HAVE_ARM32_ASM )
98-     add_compile_definitions  (USE_EXTERNAL_ASM=1 )
99-   else  ( )
98+   if (SECP256K1_ASM  STREQUAL   "x86_64"   AND   NOT  HAVE_X86_64_ASM )
99+     message  (FATAL_ERROR  "x86_64 assembly requested but not available." )
100+   elseif  (SECP256K1_ASM  STREQUAL   "arm32"   AND   NOT  HAVE_ARM32_ASM )
100101    message (FATAL_ERROR "ARM32 assembly requested but not available." )
101102  endif ()
102- elseif (SECP256K1_ASM)
103-   include (CheckX86_64Assembly)
104-   check_x86_64_assembly()
105103  if (HAVE_X86_64_ASM)
106104    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" )
106+   elseif (HAVE_ARM32_ASM)
107+     set (SECP256K1_ASM "arm32" )
108+     add_compile_definitions (USE_EXTERNAL_ASM=1)
109+     enable_language (ASM)
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