2019-08-16 00:31:29 +07:00
|
|
|
if (WITH_RANDOMX)
|
|
|
|
add_definitions(/DXMRIG_ALGO_RANDOMX)
|
2020-05-05 01:55:00 +07:00
|
|
|
set(WITH_ARGON2 ON)
|
2019-08-16 00:31:29 +07:00
|
|
|
|
|
|
|
list(APPEND HEADERS_CRYPTO
|
|
|
|
src/crypto/rx/Rx.h
|
|
|
|
src/crypto/rx/RxAlgo.h
|
2019-10-04 08:45:13 +07:00
|
|
|
src/crypto/rx/RxBasicStorage.h
|
2019-08-16 00:31:29 +07:00
|
|
|
src/crypto/rx/RxCache.h
|
|
|
|
src/crypto/rx/RxConfig.h
|
|
|
|
src/crypto/rx/RxDataset.h
|
2019-10-06 07:47:41 +07:00
|
|
|
src/crypto/rx/RxQueue.h
|
2019-10-03 04:48:36 +07:00
|
|
|
src/crypto/rx/RxSeed.h
|
2019-08-16 00:31:29 +07: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 08:45:13 +07:00
|
|
|
src/crypto/rx/RxBasicStorage.cpp
|
2019-08-16 00:31:29 +07:00
|
|
|
src/crypto/rx/RxCache.cpp
|
|
|
|
src/crypto/rx/RxConfig.cpp
|
|
|
|
src/crypto/rx/RxDataset.cpp
|
2019-10-06 07:47:41 +07:00
|
|
|
src/crypto/rx/RxQueue.cpp
|
2019-08-16 00:31:29 +07:00
|
|
|
src/crypto/rx/RxVm.cpp
|
|
|
|
)
|
|
|
|
|
2021-04-02 10:05:46 +02:00
|
|
|
if (WITH_ASM AND CMAKE_C_COMPILER_ID MATCHES MSVC)
|
2019-08-16 00:31:29 +07:00
|
|
|
enable_language(ASM_MASM)
|
|
|
|
list(APPEND SOURCES_CRYPTO
|
|
|
|
src/crypto/randomx/jit_compiler_x86_static.asm
|
|
|
|
src/crypto/randomx/jit_compiler_x86.cpp
|
|
|
|
)
|
2021-04-02 10:05:46 +02:00
|
|
|
elseif (WITH_ASM AND NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
2019-08-16 00:31:29 +07:00
|
|
|
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)
|
2021-04-03 17:59:28 +02:00
|
|
|
elseif (XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
2019-09-21 10:10:52 +02:00
|
|
|
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
|
2020-12-15 22:47:22 +07:00
|
|
|
if (CMAKE_GENERATOR STREQUAL Xcode)
|
|
|
|
set_property(SOURCE src/crypto/randomx/jit_compiler_a64_static.S PROPERTY LANGUAGE ASM)
|
|
|
|
else()
|
|
|
|
set_property(SOURCE src/crypto/randomx/jit_compiler_a64_static.S PROPERTY LANGUAGE C)
|
|
|
|
endif()
|
2020-10-07 18:19:35 +02:00
|
|
|
else()
|
|
|
|
list(APPEND SOURCES_CRYPTO
|
|
|
|
src/crypto/randomx/jit_compiler_fallback.cpp
|
|
|
|
)
|
2019-08-16 00:31:29 +07:00
|
|
|
endif()
|
2019-09-13 18:21:05 +07:00
|
|
|
|
2020-10-01 11:00:08 +07: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)
|
2022-08-25 20:39:54 +02:00
|
|
|
set_source_files_properties(src/crypto/randomx/blake2/blake2b_sse41.c PROPERTIES COMPILE_FLAGS "-Ofast -msse4.1")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WITH_AVX2)
|
|
|
|
list(APPEND SOURCES_CRYPTO src/crypto/randomx/blake2/avx2/blake2b_avx2.c)
|
|
|
|
|
|
|
|
if (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES Clang)
|
|
|
|
set_source_files_properties(src/crypto/randomx/blake2/avx2/blake2b_avx2.c PROPERTIES COMPILE_FLAGS "-Ofast -mavx2")
|
2020-10-01 11:00:08 +07:00
|
|
|
endif()
|
2020-09-27 08:55:57 +02:00
|
|
|
endif()
|
|
|
|
|
2019-09-13 18:21:05 +07: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 10:49:55 +07:00
|
|
|
|
|
|
|
if (WITH_HWLOC)
|
2019-10-07 12:36:40 +07:00
|
|
|
list(APPEND HEADERS_CRYPTO
|
2019-10-04 18:43:03 +07:00
|
|
|
src/crypto/rx/RxNUMAStorage.h
|
|
|
|
)
|
|
|
|
|
2019-10-04 10:49:55 +07:00
|
|
|
list(APPEND SOURCES_CRYPTO
|
2019-10-04 18:43:03 +07:00
|
|
|
src/crypto/rx/RxNUMAStorage.cpp
|
2019-10-04 10:49:55 +07:00
|
|
|
)
|
2019-12-10 23:57:29 +07:00
|
|
|
endif()
|
|
|
|
|
2019-12-17 02:27:07 +07: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-28 01:45:54 +07:00
|
|
|
add_definitions(/DXMRIG_FIX_RYZEN)
|
2019-12-17 02:27:07 +07:00
|
|
|
message("-- WITH_MSR=ON")
|
|
|
|
|
|
|
|
if (XMRIG_OS_WIN)
|
2021-01-23 00:27:56 +07:00
|
|
|
list(APPEND SOURCES_CRYPTO
|
|
|
|
src/crypto/rx/RxFix_win.cpp
|
2021-01-23 23:23:39 +07:00
|
|
|
src/hw/msr/Msr_win.cpp
|
2021-01-23 00:27:56 +07:00
|
|
|
)
|
2019-12-17 02:27:07 +07:00
|
|
|
elseif (XMRIG_OS_LINUX)
|
2021-01-23 00:27:56 +07:00
|
|
|
list(APPEND SOURCES_CRYPTO
|
|
|
|
src/crypto/rx/RxFix_linux.cpp
|
2021-01-23 23:23:39 +07:00
|
|
|
src/hw/msr/Msr_linux.cpp
|
2021-01-23 00:27:56 +07:00
|
|
|
)
|
2019-12-17 02:27:07 +07:00
|
|
|
endif()
|
|
|
|
|
2021-01-22 23:50:25 +07:00
|
|
|
list(APPEND HEADERS_CRYPTO
|
2021-01-23 00:27:56 +07:00
|
|
|
src/crypto/rx/RxFix.h
|
2021-01-23 23:23:39 +07:00
|
|
|
src/crypto/rx/RxMsr.h
|
2021-01-22 23:50:25 +07:00
|
|
|
src/hw/msr/Msr.h
|
|
|
|
src/hw/msr/MsrItem.h
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND SOURCES_CRYPTO
|
2021-01-23 23:23:39 +07:00
|
|
|
src/crypto/rx/RxMsr.cpp
|
2021-01-22 23:50:25 +07:00
|
|
|
src/hw/msr/Msr.cpp
|
|
|
|
src/hw/msr/MsrItem.cpp
|
|
|
|
)
|
2019-12-17 02:27:07 +07:00
|
|
|
else()
|
|
|
|
remove_definitions(/DXMRIG_FEATURE_MSR)
|
2019-12-28 01:45:54 +07:00
|
|
|
remove_definitions(/DXMRIG_FIX_RYZEN)
|
2019-12-17 02:27:07 +07:00
|
|
|
message("-- WITH_MSR=OFF")
|
2019-10-04 10:49:55 +07:00
|
|
|
endif()
|
2020-12-04 09:23:40 +07:00
|
|
|
|
|
|
|
if (WITH_PROFILING)
|
|
|
|
add_definitions(/DXMRIG_FEATURE_PROFILING)
|
|
|
|
|
|
|
|
list(APPEND HEADERS_CRYPTO src/crypto/rx/Profiler.h)
|
|
|
|
list(APPEND SOURCES_CRYPTO src/crypto/rx/Profiler.cpp)
|
|
|
|
endif()
|
2019-08-16 00:31:29 +07:00
|
|
|
else()
|
|
|
|
remove_definitions(/DXMRIG_ALGO_RANDOMX)
|
|
|
|
endif()
|