mirror of
https://github.com/jwinterm/xmr-stak.git
synced 2026-12-01 12:23:57 +01:00
fix compile
- generate define `BACKEND_TYPE` type in CMake - fix comile because `GIT_COMMIT_HASH` is no string
This commit is contained in:
+7
-1
@@ -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
|
||||
|
||||
+12
-15
@@ -2,15 +2,19 @@
|
||||
|
||||
//! git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$
|
||||
#if defined(GIT_ARCHIVE) && !defined(GIT_COMMIT_HASH)
|
||||
#define GIT_COMMIT_HASH "$Format:%h$"
|
||||
#define GIT_COMMIT_HASH $Format:%h$
|
||||
#endif
|
||||
|
||||
#ifndef GIT_COMMIT_HASH
|
||||
#define GIT_COMMIT_HASH "0000000"
|
||||
#define GIT_COMMIT_HASH 0000000
|
||||
#endif
|
||||
|
||||
#ifndef GIT_BRANCH
|
||||
#define GIT_BRANCH "unknown"
|
||||
#define GIT_BRANCH unknown
|
||||
#endif
|
||||
|
||||
#ifndef BACKEND_TYPE
|
||||
#define BACKEND_TYPE unknown
|
||||
#endif
|
||||
|
||||
#define XMR_STAK_NAME "xmr-stak"
|
||||
@@ -28,16 +32,6 @@
|
||||
#define OS_TYPE "unk"
|
||||
#endif
|
||||
|
||||
#if !defined(CONF_NO_CUDA) && !defined(CONF_NO_OPENCL)
|
||||
#define BACKEND_TYPE "cpu-nvidia-amd"
|
||||
#elif !defined(CONF_NO_OPENCL)
|
||||
#define BACKEND_TYPE "cpu-amd"
|
||||
#elif !defined(CONF_NO_CUDA)
|
||||
#define BACKEND_TYPE "cpu-nvidia"
|
||||
#else
|
||||
#define BACKEND_TYPE "cpu"
|
||||
#endif
|
||||
|
||||
#if defined(CONF_NO_AEON)
|
||||
#define COIN_TYPE "monero"
|
||||
#elif defined(CONF_NO_MONERO)
|
||||
@@ -46,8 +40,11 @@
|
||||
#define COIN_TYPE "aeon-monero"
|
||||
#endif
|
||||
|
||||
#define VERSION_LONG XMR_STAK_NAME "/" XMR_STAK_VERSION "/" GIT_COMMIT_HASH "/" GIT_BRANCH "/" OS_TYPE "/" BACKEND_TYPE "/" COIN_TYPE "/"
|
||||
#define VERSION_SHORT XMR_STAK_NAME " " XMR_STAK_VERSION " " GIT_COMMIT_HASH
|
||||
#define XMRSTAK_PP_TOSTRING1(str) #str
|
||||
#define XMRSTAK_PP_TOSTRING(str) XMRSTAK_PP_TOSTRING1(str)
|
||||
|
||||
#define VERSION_LONG XMR_STAK_NAME "/" XMR_STAK_VERSION "/" XMRSTAK_PP_TOSTRING(GIT_COMMIT_HASH) "/" XMRSTAK_PP_TOSTRING(GIT_BRANCH) "/" OS_TYPE "/" XMRSTAK_PP_TOSTRING(BACKEND_TYPE) "/" COIN_TYPE "/"
|
||||
#define VERSION_SHORT XMR_STAK_NAME " " XMR_STAK_VERSION " " XMRSTAK_PP_TOSTRING(GIT_COMMIT_HASH)
|
||||
|
||||
const char ver_long[] = VERSION_LONG;
|
||||
const char ver_short[] = VERSION_SHORT;
|
||||
|
||||
Reference in New Issue
Block a user