From 4ebfc135e00265d4d905a71af3dd802d773e8b57 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sun, 3 Mar 2019 17:33:27 +0700 Subject: [PATCH] Build whole CryptonightR_gen.cpp only if ASM used. --- CMakeLists.txt | 1 - cmake/asm.cmake | 2 +- src/crypto/CryptonightR_gen.cpp | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6ccc84b..14dcc931 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,7 +156,6 @@ set(SOURCES_CRYPTO src/crypto/c_blake256.c src/crypto/c_jh.c src/crypto/c_skein.c - src/crypto/CryptonightR_gen.cpp ) if (WIN32) diff --git a/cmake/asm.cmake b/cmake/asm.cmake index dc6424ff..1007f927 100644 --- a/cmake/asm.cmake +++ b/cmake/asm.cmake @@ -36,7 +36,7 @@ if (WITH_ASM AND NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8) endif() add_library(${XMRIG_ASM_LIBRARY} STATIC ${XMRIG_ASM_FILES}) - set(XMRIG_ASM_SOURCES src/crypto/Asm.h src/crypto/Asm.cpp) + set(XMRIG_ASM_SOURCES src/crypto/Asm.h src/crypto/Asm.cpp src/crypto/CryptonightR_gen.cpp) set_property(TARGET ${XMRIG_ASM_LIBRARY} PROPERTY LINKER_LANGUAGE C) else() set(XMRIG_ASM_SOURCES "") diff --git a/src/crypto/CryptonightR_gen.cpp b/src/crypto/CryptonightR_gen.cpp index 6e53ef19..3fba49cd 100644 --- a/src/crypto/CryptonightR_gen.cpp +++ b/src/crypto/CryptonightR_gen.cpp @@ -31,7 +31,6 @@ typedef void(*void_func)(); #include "crypto/asm/CryptonightR_template.h" #include "Mem.h" -#if !defined XMRIG_ARM && !defined XMRIG_NO_ASM static inline void add_code(uint8_t* &p, void (*p1)(), void (*p2)()) { @@ -186,5 +185,3 @@ void v4_soft_aes_compile_code(const V4_Instruction* code, int code_size, void* m Mem::flushInstructionCache(machine_code, p - p0); } - -#endif