Skip to content

Commit

Permalink
[FIXUP] cmake: Consider ASM option when checking for HAVE_64BIT_ASM
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed May 1, 2023
1 parent d439a1b commit b2bea9f
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions cmake/secp256k1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ enable_language(C)
set(CMAKE_C_STANDARD 90)
set(CMAKE_C_EXTENSIONS OFF)

include(CheckCSourceCompiles)
check_c_source_compiles("
#include <stdint.h>
int main()
{
uint64_t a = 11, tmp;
__asm__ __volatile__(\"movq $0x100000000,%1; mulq %%rsi\" : \"+a\"(a) : \"S\"(tmp) : \"cc\", \"%rdx\");
}
" HAVE_64BIT_ASM
)
if(ASM)
include(CheckCSourceCompiles)
check_c_source_compiles("
#include <stdint.h>
int main()
{
uint64_t a = 11, tmp;
__asm__ __volatile__(\"movq $0x100000000,%1; mulq %%rsi\" : \"+a\"(a) : \"S\"(tmp) : \"cc\", \"%rdx\");
}
" HAVE_64BIT_ASM
)
endif()

add_library(secp256k1 STATIC EXCLUDE_FROM_ALL
${PROJECT_SOURCE_DIR}/src/secp256k1/src/secp256k1.c
Expand Down

0 comments on commit b2bea9f

Please sign in to comment.