rig/cmake/asm.cmake

46 lines
1.5 KiB
CMake
Raw Normal View History

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