2019-08-15 17:31:29 +00:00
|
|
|
if (WITH_RANDOMX)
|
|
|
|
add_definitions(/DXMRIG_ALGO_RANDOMX)
|
2020-05-04 18:55:00 +00:00
|
|
|
set(WITH_ARGON2 ON)
|
2019-08-15 17:31:29 +00:00
|
|
|
|
|
|
|
list(APPEND HEADERS_CRYPTO
|
|
|
|
src/crypto/rx/Rx.h
|
|
|
|
src/crypto/rx/RxAlgo.h
|
2019-10-04 01:45:13 +00:00
|
|
|
src/crypto/rx/RxBasicStorage.h
|
2019-08-15 17:31:29 +00:00
|
|
|
src/crypto/rx/RxCache.h
|
|
|
|
src/crypto/rx/RxConfig.h
|
|
|
|
src/crypto/rx/RxDataset.h
|
2019-10-06 00:47:41 +00:00
|
|
|
src/crypto/rx/RxQueue.h
|
2019-10-02 21:48:36 +00:00
|
|
|
src/crypto/rx/RxSeed.h
|
2019-08-15 17:31:29 +00:00
|
|
|
src/crypto/rx/RxVm.h
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND SOURCES_CRYPTO
|
|
|
|
src/crypto/randomx/aes_hash.cpp
|
|
|
|
src/crypto/randomx/allocator.cpp
|
|
|
|
src/crypto/randomx/blake2_generator.cpp
|
|
|
|
src/crypto/randomx/blake2/blake2b.c
|
|
|
|
src/crypto/randomx/bytecode_machine.cpp
|
|
|
|
src/crypto/randomx/dataset.cpp
|
|
|
|
src/crypto/randomx/instructions_portable.cpp
|
|
|
|
src/crypto/randomx/randomx.cpp
|
|
|
|
src/crypto/randomx/reciprocal.c
|
|
|
|
src/crypto/randomx/soft_aes.cpp
|
|
|
|
src/crypto/randomx/superscalar.cpp
|
|
|
|
src/crypto/randomx/virtual_machine.cpp
|
|
|
|
src/crypto/randomx/virtual_memory.cpp
|
|
|
|
src/crypto/randomx/vm_compiled_light.cpp
|
|
|
|
src/crypto/randomx/vm_compiled.cpp
|
|
|
|
src/crypto/randomx/vm_interpreted_light.cpp
|
|
|
|
src/crypto/randomx/vm_interpreted.cpp
|
|
|
|
src/crypto/rx/Rx.cpp
|
|
|
|
src/crypto/rx/RxAlgo.cpp
|
2019-10-04 01:45:13 +00:00
|
|
|
src/crypto/rx/RxBasicStorage.cpp
|
2019-08-15 17:31:29 +00:00
|
|
|
src/crypto/rx/RxCache.cpp
|
|
|
|
src/crypto/rx/RxConfig.cpp
|
|
|
|
src/crypto/rx/RxDataset.cpp
|
2019-10-06 00:47:41 +00:00
|
|
|
src/crypto/rx/RxQueue.cpp
|
2019-08-15 17:31:29 +00:00
|
|
|
src/crypto/rx/RxVm.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
|
|
|
enable_language(ASM_MASM)
|
|
|
|
list(APPEND SOURCES_CRYPTO
|
|
|
|
src/crypto/randomx/jit_compiler_x86_static.asm
|
|
|
|
src/crypto/randomx/jit_compiler_x86.cpp
|
|
|
|
)
|
|
|
|
elseif (NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
list(APPEND SOURCES_CRYPTO
|
|
|
|
src/crypto/randomx/jit_compiler_x86_static.S
|
|
|
|
src/crypto/randomx/jit_compiler_x86.cpp
|
|
|
|
)
|
|
|
|
# cheat because cmake and ccache hate each other
|
|
|
|
set_property(SOURCE src/crypto/randomx/jit_compiler_x86_static.S PROPERTY LANGUAGE C)
|
2019-09-21 08:10:52 +00:00
|
|
|
elseif (XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
list(APPEND SOURCES_CRYPTO
|
|
|
|
src/crypto/randomx/jit_compiler_a64_static.S
|
|
|
|
src/crypto/randomx/jit_compiler_a64.cpp
|
|
|
|
)
|
|
|
|
# cheat because cmake and ccache hate each other
|
|
|
|
set_property(SOURCE src/crypto/randomx/jit_compiler_a64_static.S PROPERTY LANGUAGE C)
|
2019-08-15 17:31:29 +00:00
|
|
|
endif()
|
2019-09-13 11:21:05 +00:00
|
|
|
|
2020-10-01 04:00:08 +00:00
|
|
|
if (WITH_SSE4_1)
|
|
|
|
list(APPEND SOURCES_CRYPTO src/crypto/randomx/blake2/blake2b_sse41.c)
|
|
|
|
|
|
|
|
if (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES Clang)
|
|
|
|
set_source_files_properties(src/crypto/randomx/blake2/blake2b_sse41.c PROPERTIES COMPILE_FLAGS -msse4.1)
|
|
|
|
endif()
|
2020-09-27 06:55:57 +00:00
|
|
|
endif()
|
|
|
|
|
2019-09-13 11:21:05 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
|
|
|
set_source_files_properties(src/crypto/randomx/jit_compiler_x86.cpp PROPERTIES COMPILE_FLAGS -Wno-unused-const-variable)
|
|
|
|
endif()
|
2019-10-04 03:49:55 +00:00
|
|
|
|
|
|
|
if (WITH_HWLOC)
|
2019-10-07 05:36:40 +00:00
|
|
|
list(APPEND HEADERS_CRYPTO
|
2019-10-04 11:43:03 +00:00
|
|
|
src/crypto/rx/RxNUMAStorage.h
|
|
|
|
)
|
|
|
|
|
2019-10-04 03:49:55 +00:00
|
|
|
list(APPEND SOURCES_CRYPTO
|
2019-10-04 11:43:03 +00:00
|
|
|
src/crypto/rx/RxNUMAStorage.cpp
|
2019-10-04 03:49:55 +00:00
|
|
|
)
|
2019-12-10 16:57:29 +00:00
|
|
|
endif()
|
|
|
|
|
2019-12-16 19:27:07 +00:00
|
|
|
if (WITH_MSR AND NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND (XMRIG_OS_WIN OR XMRIG_OS_LINUX))
|
|
|
|
add_definitions(/DXMRIG_FEATURE_MSR)
|
2019-12-27 18:45:54 +00:00
|
|
|
add_definitions(/DXMRIG_FIX_RYZEN)
|
2019-12-16 19:27:07 +00:00
|
|
|
message("-- WITH_MSR=ON")
|
|
|
|
|
|
|
|
if (XMRIG_OS_WIN)
|
2019-12-17 08:16:37 +00:00
|
|
|
list(APPEND SOURCES_CRYPTO src/crypto/rx/Rx_win.cpp)
|
2019-12-16 19:27:07 +00:00
|
|
|
elseif (XMRIG_OS_LINUX)
|
|
|
|
list(APPEND SOURCES_CRYPTO src/crypto/rx/Rx_linux.cpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
list(APPEND HEADERS_CRYPTO src/crypto/rx/msr/MsrItem.h)
|
|
|
|
list(APPEND SOURCES_CRYPTO src/crypto/rx/msr/MsrItem.cpp)
|
|
|
|
else()
|
|
|
|
remove_definitions(/DXMRIG_FEATURE_MSR)
|
2019-12-27 18:45:54 +00:00
|
|
|
remove_definitions(/DXMRIG_FIX_RYZEN)
|
2019-12-16 19:27:07 +00:00
|
|
|
message("-- WITH_MSR=OFF")
|
2019-10-04 03:49:55 +00:00
|
|
|
endif()
|
2019-08-15 17:31:29 +00:00
|
|
|
else()
|
|
|
|
remove_definitions(/DXMRIG_ALGO_RANDOMX)
|
|
|
|
endif()
|