xmrig/cmake/asm.cmake

28 lines
824 B
CMake
Raw Normal View History

2018-10-05 12:02:52 +00:00
if (WITH_ASM AND NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set(XMRIG_ASM_LIBRARY "xmrig-asm")
enable_language(ASM)
2018-10-05 12:02:52 +00:00
if (WIN32 AND CMAKE_C_COMPILER_ID MATCHES GNU)
2019-03-04 12:25:59 +00:00
set(XMRIG_ASM_FILES
"crypto/asm/win64/cn_main_loop.S"
"crypto/asm/CryptonightR_template.S"
)
2018-10-05 12:02:52 +00:00
else()
2019-03-04 12:25:59 +00:00
set(XMRIG_ASM_FILES
"crypto/asm/cn_main_loop.S"
"crypto/asm/CryptonightR_template.S"
)
2018-10-05 12:02:52 +00:00
endif()
2019-03-04 12:25:59 +00:00
set_property(SOURCE ${XMRIG_ASM_FILES} PROPERTY C)
2019-03-04 12:25:59 +00:00
add_library(${XMRIG_ASM_LIBRARY} STATIC ${XMRIG_ASM_FILES})
set(XMRIG_ASM_SOURCES "crypto/CryptonightR_gen.c")
2018-10-05 12:02:52 +00:00
set_property(TARGET ${XMRIG_ASM_LIBRARY} PROPERTY LINKER_LANGUAGE C)
else()
set(XMRIG_ASM_SOURCES "")
set(XMRIG_ASM_LIBRARY "")
add_definitions(/DXMRIG_NO_ASM)
endif()