2021-08-27 05:36:08 +00:00
|
|
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(XMRIG_64_BIT ON)
|
|
|
|
add_definitions(-DXMRIG_64_BIT)
|
|
|
|
else()
|
|
|
|
set(XMRIG_64_BIT OFF)
|
|
|
|
endif()
|
|
|
|
|
2017-11-06 00:11:35 +00:00
|
|
|
if (NOT CMAKE_SYSTEM_PROCESSOR)
|
|
|
|
message(WARNING "CMAKE_SYSTEM_PROCESSOR not defined")
|
|
|
|
endif()
|
|
|
|
|
2021-11-29 08:48:15 +00:00
|
|
|
include(CheckCXXCompilerFlag)
|
|
|
|
|
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
|
|
|
set(VAES_SUPPORTED ON)
|
|
|
|
else()
|
|
|
|
CHECK_CXX_COMPILER_FLAG("-mavx2 -mvaes" VAES_SUPPORTED)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT VAES_SUPPORTED)
|
|
|
|
set(WITH_VAES OFF)
|
|
|
|
endif()
|
|
|
|
|
2021-08-27 05:36:08 +00:00
|
|
|
if (XMRIG_64_BIT AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$")
|
|
|
|
add_definitions(-DRAPIDJSON_SSE2)
|
2020-10-01 04:00:08 +00:00
|
|
|
else()
|
|
|
|
set(WITH_SSE4_1 OFF)
|
2022-08-25 18:39:54 +00:00
|
|
|
set(WITH_AVX2 OFF)
|
2021-11-29 08:32:00 +00:00
|
|
|
set(WITH_VAES OFF)
|
2017-11-06 00:11:35 +00:00
|
|
|
endif()
|
|
|
|
|
2023-06-04 13:32:05 +00:00
|
|
|
if (ARM_V8)
|
|
|
|
set(ARM_TARGET 8)
|
|
|
|
elseif (ARM_V7)
|
|
|
|
set(ARM_TARGET 7)
|
|
|
|
endif()
|
|
|
|
|
2019-02-03 19:23:05 +00:00
|
|
|
if (NOT ARM_TARGET)
|
|
|
|
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|armv8-a)$")
|
|
|
|
set(ARM_TARGET 8)
|
2022-06-21 16:31:24 +00:00
|
|
|
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7|armv7f|armv7s|armv7k|armv7-a|armv7l|armv7ve)$")
|
2019-02-03 19:23:05 +00:00
|
|
|
set(ARM_TARGET 7)
|
|
|
|
endif()
|
|
|
|
endif()
|
2017-11-06 00:11:35 +00:00
|
|
|
|
2019-02-03 19:23:05 +00:00
|
|
|
if (ARM_TARGET AND ARM_TARGET GREATER 6)
|
2021-08-27 05:36:08 +00:00
|
|
|
set(XMRIG_ARM ON)
|
|
|
|
add_definitions(-DXMRIG_ARM=${ARM_TARGET})
|
2017-11-26 19:23:23 +00:00
|
|
|
|
2019-02-03 19:23:05 +00:00
|
|
|
message(STATUS "Use ARM_TARGET=${ARM_TARGET} (${CMAKE_SYSTEM_PROCESSOR})")
|
|
|
|
|
|
|
|
if (ARM_TARGET EQUAL 8)
|
|
|
|
CHECK_CXX_COMPILER_FLAG(-march=armv8-a+crypto XMRIG_ARM_CRYPTO)
|
|
|
|
|
|
|
|
if (XMRIG_ARM_CRYPTO)
|
2021-08-27 05:36:08 +00:00
|
|
|
add_definitions(-DXMRIG_ARM_CRYPTO)
|
2019-02-03 19:23:05 +00:00
|
|
|
set(ARM8_CXX_FLAGS "-march=armv8-a+crypto")
|
|
|
|
else()
|
|
|
|
set(ARM8_CXX_FLAGS "-march=armv8-a")
|
|
|
|
endif()
|
|
|
|
endif()
|
2017-11-06 00:11:35 +00:00
|
|
|
endif()
|
2020-10-01 04:00:08 +00:00
|
|
|
|
|
|
|
if (WITH_SSE4_1)
|
2021-08-27 05:36:08 +00:00
|
|
|
add_definitions(-DXMRIG_FEATURE_SSE4_1)
|
2020-10-01 04:00:08 +00:00
|
|
|
endif()
|
2022-08-25 18:39:54 +00:00
|
|
|
|
|
|
|
if (WITH_AVX2)
|
|
|
|
add_definitions(-DXMRIG_FEATURE_AVX2)
|
|
|
|
endif()
|