From ca18622ad09e3b6faba0743d41975145f970c117 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sun, 3 Feb 2019 16:00:06 +0700 Subject: [PATCH] Disable -Ofast for gcc and cn/gpu. --- cmake/cn-gpu.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/cn-gpu.cmake b/cmake/cn-gpu.cmake index 0e580c565..db60fc0b1 100644 --- a/cmake/cn-gpu.cmake +++ b/cmake/cn-gpu.cmake @@ -1,7 +1,10 @@ if (WITH_CN_GPU) set(CN_GPU_SOURCES src/crypto/cn_gpu_avx.cpp src/crypto/cn_gpu_ssse3.cpp) - if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang) + if (CMAKE_CXX_COMPILER_ID MATCHES GNU) + set_source_files_properties(src/crypto/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "-O3 -mavx2") + set_source_files_properties(src/crypto/cn_gpu_ssse3.cpp PROPERTIES COMPILE_FLAGS "-O3") + elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) set_source_files_properties(src/crypto/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "-mavx2") elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC) set_source_files_properties(src/crypto/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")