diff options
author | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-11-07 22:48:37 +0100 |
---|---|---|
committer | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-11-07 22:52:40 +0100 |
commit | 787ce4a146d02ea827e1a72148abf771d52b3a9e (patch) | |
tree | d897db04644f3df366d70f495517577d64670aea /CMakeLists.txt | |
parent | f03f859564f8cd25388ccaf78d88291ae4fb98de (diff) | |
download | xmr-stak-787ce4a146d02ea827e1a72148abf771d52b3a9e.zip xmr-stak-787ce4a146d02ea827e1a72148abf771d52b3a9e.tar.gz |
fix windows CUDA 9 compile
fix #91
- add CMake workaround for wrong host compiler for cuda
- update winows compile documentation
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 09b7c13..6e13aa0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,6 +172,12 @@ if(CUDA_ENABLE) # for CUDA 7.5 fix compile error: https://github.com/fireice-uk/xmr-stak/issues/34 set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "-D_MWAITXINTRIN_H_INCLUDED") endif() + + if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND CUDA_VERSION VERSION_EQUAL 9.0) + # workaround find_package(CUDA) is using the wrong path to the CXX host compiler + # overwrite the CUDA host compiler variable with the used CXX MSVC + set(CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} CACHE FILEPATH "Host side compiler used by NVCC" FORCE) + endif() else() message(FATAL_ERROR "selected CUDA compiler '${CUDA_COMPILER}' is not supported") endif() |