diff options
author | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-11-11 21:43:51 +0100 |
---|---|---|
committer | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-11-11 22:19:43 +0100 |
commit | 062287ad4740fd4ea7365f188d2a31c43b489ab5 (patch) | |
tree | 223a6530666ea02f56d8f3139c55af473230a0d8 /CMakeLists.txt | |
parent | 71c4e937aeb0a202ea577b52656b68002ba33291 (diff) | |
download | xmr-stak-062287ad4740fd4ea7365f188d2a31c43b489ab5.zip xmr-stak-062287ad4740fd4ea7365f188d2a31c43b489ab5.tar.gz |
fix compile
- generate define `BACKEND_TYPE` type in CMake
- fix comile because `GIT_COMMIT_HASH` is no string
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 491d7e3..7c56284 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ if(CUDA_ENABLE) find_package(CUDA 7.5) if(CUDA_FOUND) - + list(APPEND BACKEND_TYPES "nvidia") option(XMR-STAK_LARGEGRID "Support large CUDA block count > 128" ON) if(XMR-STAK_LARGEGRID) add_definitions("-DXMR_STAK_LARGEGRID=${XMR-STAK_LARGEGRID}") @@ -233,6 +233,7 @@ if(OpenCL_ENABLE) # find package will use the previews searched path variables find_package(OpenCL) if(OpenCL_FOUND) + list(APPEND BACKEND_TYPES "amd") include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS}) #set(LIBS ${LIBS} ${OpenCL_LIBRARY}) link_directories(${OpenCL_LIBRARY}) @@ -250,6 +251,8 @@ endif() option(CPU_ENABLE "Enable or disable CPU support" ON) if(NOT CPU_ENABLE) add_definitions("-DCONF_NO_CPU") +else() + list(APPEND BACKEND_TYPES "cpu") endif() ################################################################################ @@ -385,6 +388,9 @@ if(NOT "${GIT_BRANCH}" STREQUAL "") add_definitions("-DGIT_BRANCH=${GIT_BRANCH}") endif() +# generate backend string +string(REPLACE ";" "-" STR_BACKEND_TYPES "${BACKEND_TYPES}") +add_definitions("-DBACKEND_TYPE=${STR_BACKEND_TYPES}") ################################################################################ # Compile & Link |