Skip to content

Commit d767826

Browse files
committed
build: detect arm32 assembly by default
1 parent 7a613ce commit d767826

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

CMakeLists.txt

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,25 +90,21 @@ mark_as_advanced(FORCE SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY)
9090
set(SECP256K1_ASM "AUTO" CACHE STRING "Assembly to use: \"AUTO\", \"OFF\", \"x86_64\" or \"arm32\" (experimental). [default=AUTO]")
9191
set_property(CACHE SECP256K1_ASM PROPERTY STRINGS "AUTO" "OFF" "x86_64" "arm32")
9292
check_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)
112108
endif()
113109
endif()
114110

0 commit comments

Comments
 (0)