|
|
@ -22,6 +22,16 @@ option( |
|
|
|
"use gmp" |
|
|
|
"use gmp" |
|
|
|
ON |
|
|
|
ON |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
option( |
|
|
|
|
|
|
|
USE_ASM |
|
|
|
|
|
|
|
"use asm" |
|
|
|
|
|
|
|
ON |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
option( |
|
|
|
|
|
|
|
USE_XBYAK |
|
|
|
|
|
|
|
"use xbyak" |
|
|
|
|
|
|
|
ON |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
|
|
@ -42,22 +52,24 @@ else() |
|
|
|
add_definitions(-DMCL_MAX_BIT_SIZE=${MCL_MAX_BIT_SIZE}) |
|
|
|
add_definitions(-DMCL_MAX_BIT_SIZE=${MCL_MAX_BIT_SIZE}) |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") |
|
|
|
if(USE_ASM) |
|
|
|
add_definitions(-DMCL_USE_LLVM=1) |
|
|
|
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") |
|
|
|
set(SRCS ${SRCS} src/asm/aarch64.s) |
|
|
|
add_definitions(-DMCL_USE_LLVM=1) |
|
|
|
set(CPU arch64) |
|
|
|
set(SRCS ${SRCS} src/asm/aarch64.s) |
|
|
|
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm") |
|
|
|
set(CPU arch64) |
|
|
|
add_definitions(-DMCL_USE_LLVM=1) |
|
|
|
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm") |
|
|
|
set(SRCS ${SRCS} src/asm/arm.s) |
|
|
|
add_definitions(-DMCL_USE_LLVM=1) |
|
|
|
set(CPU arm) |
|
|
|
set(SRCS ${SRCS} src/asm/arm.s) |
|
|
|
elseif(APPLE) |
|
|
|
set(CPU arm) |
|
|
|
add_definitions(-DMCL_USE_LLVM=1) |
|
|
|
elseif(APPLE) |
|
|
|
set(SRCS ${SRCS} src/asm/x86-64mac.s src/asm/x86-64mac.bmi2.s) |
|
|
|
add_definitions(-DMCL_USE_LLVM=1) |
|
|
|
set(CPU x86-64) |
|
|
|
set(SRCS ${SRCS} src/asm/x86-64mac.s src/asm/x86-64mac.bmi2.s) |
|
|
|
elseif(UNIX) |
|
|
|
set(CPU x86-64) |
|
|
|
add_definitions(-DMCL_USE_LLVM=1) |
|
|
|
elseif(UNIX) |
|
|
|
set(SRCS ${SRCS} src/asm/x86-64.s src/asm/x86-64.bmi2.s) |
|
|
|
add_definitions(-DMCL_USE_LLVM=1) |
|
|
|
set(CPU x86-64) |
|
|
|
set(SRCS ${SRCS} src/asm/x86-64.s src/asm/x86-64.bmi2.s) |
|
|
|
|
|
|
|
set(CPU x86-64) |
|
|
|
|
|
|
|
endif() |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
set(LIBS mcl) |
|
|
|
set(LIBS mcl) |
|
|
|
if(USE_GMP) |
|
|
|
if(USE_GMP) |
|
|
@ -74,6 +86,9 @@ endif() |
|
|
|
if(NOT USE_OPENSSL) |
|
|
|
if(NOT USE_OPENSSL) |
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMCL_DONT_USE_OPENSSL") |
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMCL_DONT_USE_OPENSSL") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
if(NOT USE_XBYAK) |
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMCL_DONT_USE_XBYAK") |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
if(DOWNLOAD_SOURCE) |
|
|
|
if(DOWNLOAD_SOURCE) |
|
|
|
if(MSVC) |
|
|
|
if(MSVC) |
|
|
|