2018-09-24 11:57:30 +00:00
|
|
|
if (WITH_ASM AND NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
2018-09-23 17:16:33 +00:00
|
|
|
set(XMRIG_ASM_LIBRARY "xmrig-asm")
|
|
|
|
|
2018-09-24 17:43:31 +00:00
|
|
|
if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
2018-09-23 17:16:33 +00:00
|
|
|
enable_language(ASM_MASM)
|
2018-10-02 14:50:19 +00:00
|
|
|
|
|
|
|
if (MSVC_TOOLSET_VERSION GREATER_EQUAL 141)
|
2019-02-10 14:21:17 +00:00
|
|
|
set(XMRIG_ASM_FILE
|
|
|
|
"src/crypto/asm/cn_main_loop.asm"
|
|
|
|
"src/crypto/asm/CryptonightR_template.asm"
|
|
|
|
)
|
2018-10-02 14:50:19 +00:00
|
|
|
else()
|
2019-02-10 14:21:17 +00:00
|
|
|
set(XMRIG_ASM_FILE
|
|
|
|
"src/crypto/asm/win64/cn_main_loop.asm"
|
|
|
|
"src/crypto/asm/win64/CryptonightR_template.asm"
|
|
|
|
)
|
2018-10-02 14:50:19 +00:00
|
|
|
endif()
|
|
|
|
|
2018-09-24 17:43:31 +00:00
|
|
|
set_property(SOURCE ${XMRIG_ASM_FILE} PROPERTY ASM_MASM)
|
2018-09-23 17:16:33 +00:00
|
|
|
else()
|
|
|
|
enable_language(ASM)
|
2018-09-24 17:43:31 +00:00
|
|
|
|
|
|
|
if (WIN32 AND CMAKE_C_COMPILER_ID MATCHES GNU)
|
2019-02-10 14:21:17 +00:00
|
|
|
set(XMRIG_ASM_FILE
|
|
|
|
"src/crypto/asm/win64/cn_main_loop.S"
|
|
|
|
"src/crypto/asm/win64/CryptonightR_template.S"
|
|
|
|
)
|
2018-09-24 17:43:31 +00:00
|
|
|
else()
|
2019-02-10 14:21:17 +00:00
|
|
|
set(XMRIG_ASM_FILE
|
|
|
|
"src/crypto/asm/cn_main_loop.S"
|
|
|
|
"src/crypto/asm/CryptonightR_template.S"
|
|
|
|
)
|
2018-09-24 17:43:31 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set_property(SOURCE ${XMRIG_ASM_FILE} PROPERTY C)
|
2018-09-23 17:16:33 +00:00
|
|
|
endif()
|
|
|
|
|
2018-09-24 17:43:31 +00:00
|
|
|
add_library(${XMRIG_ASM_LIBRARY} STATIC ${XMRIG_ASM_FILE})
|
2018-09-24 11:19:26 +00:00
|
|
|
set(XMRIG_ASM_SOURCES src/crypto/Asm.h src/crypto/Asm.cpp)
|
2018-09-23 17:16:33 +00:00
|
|
|
set_property(TARGET ${XMRIG_ASM_LIBRARY} PROPERTY LINKER_LANGUAGE C)
|
|
|
|
else()
|
2018-09-24 11:19:26 +00:00
|
|
|
set(XMRIG_ASM_SOURCES "")
|
2018-09-23 17:16:33 +00:00
|
|
|
set(XMRIG_ASM_LIBRARY "")
|
|
|
|
add_definitions(/DXMRIG_NO_ASM)
|
|
|
|
endif()
|