rig/cmake/cn-gpu.cmake

26 lines
1.0 KiB
CMake
Raw Normal View History

2019-02-03 16:49:17 +07:00
if (WITH_CN_GPU AND CMAKE_SIZEOF_VOID_P EQUAL 8)
2019-02-03 20:28:13 +07:00
if (XMRIG_ARM)
2019-06-04 19:27:51 +07:00
set(CN_GPU_SOURCES src/crypto/cn/gpu/cn_gpu_arm.cpp)
2019-02-03 20:28:13 +07:00
2019-02-03 20:43:49 +07:00
if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
2019-06-04 19:20:33 +07:00
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_arm.cpp PROPERTIES COMPILE_FLAGS "-O3")
2019-02-03 20:28:13 +07:00
endif()
else()
2019-06-04 19:20:33 +07:00
set(CN_GPU_SOURCES src/crypto/cn/gpu/cn_gpu_avx.cpp src/crypto/cn/gpu/cn_gpu_ssse3.cpp)
2019-02-03 20:28:13 +07:00
2019-02-09 03:48:24 +07:00
if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
2019-06-04 19:20:33 +07:00
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "-O3 -mavx2")
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_ssse3.cpp PROPERTIES COMPILE_FLAGS "-O3")
2019-02-03 20:28:13 +07:00
elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
2019-06-04 19:20:33 +07:00
set_source_files_properties(src/crypto/cn/gpu/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
2019-02-03 20:28:13 +07:00
endif()
endif()
add_definitions(/DXMRIG_ALGO_CN_GPU)
else()
set(CN_GPU_SOURCES "")
remove_definitions(/DXMRIG_ALGO_CN_GPU)
endif()