add USE_ASM/USE_XBYAK option to cmake

pull/2/head
MITSUNARI Shigeo 6 years ago
parent ce60688263
commit 0df8f32be4
  1. 15
      CMakeLists.txt

@ -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,6 +52,7 @@ else()
add_definitions(-DMCL_MAX_BIT_SIZE=${MCL_MAX_BIT_SIZE}) add_definitions(-DMCL_MAX_BIT_SIZE=${MCL_MAX_BIT_SIZE})
endif() endif()
if(USE_ASM)
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
add_definitions(-DMCL_USE_LLVM=1) add_definitions(-DMCL_USE_LLVM=1)
set(SRCS ${SRCS} src/asm/aarch64.s) set(SRCS ${SRCS} src/asm/aarch64.s)
@ -59,6 +70,7 @@ else()
set(SRCS ${SRCS} src/asm/x86-64.s src/asm/x86-64.bmi2.s) set(SRCS ${SRCS} src/asm/x86-64.s src/asm/x86-64.bmi2.s)
set(CPU x86-64) set(CPU x86-64)
endif() endif()
endif()
set(LIBS mcl) set(LIBS mcl)
if(USE_GMP) if(USE_GMP)
set(LIBS ${LIBS} gmp gmpxx) set(LIBS ${LIBS} gmp gmpxx)
@ -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)

Loading…
Cancel
Save