summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt33
-rw-r--r--xmrstak/backend/amd/jconf.cpp2
-rw-r--r--xmrstak/cli/cli-miner.cpp2
3 files changed, 27 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c60292..9a24885 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -315,13 +315,17 @@ if(CMAKE_LINK_STATIC)
set(LIBS "-static-libgcc -static-libstdc++ ${LIBS}")
endif()
+# compile C files
file(GLOB SRCFILES_C "xmrstak/backend/cpu/crypto/*.c")
add_library(xmr-stak-c
STATIC
${SRCFILES_C}
)
+set_property(TARGET xmr-stak-c PROPERTY C_STANDARD 99)
+target_link_libraries(xmr-stak-c ${LIBS})
+# compile generic backend files
file(GLOB BACKEND_CPP
"xmrstak/*.cpp"
"xmrstak/backend/cpu/*.cpp"
@@ -337,22 +341,37 @@ add_library(xmr-stak-backend
)
target_link_libraries(xmr-stak-backend xmr-stak-c ${CMAKE_DL_LIBS})
+# compile CUDA backend
if(CUDA_FOUND)
file(GLOB CUDASRCFILES
"xmrstak/backend/nvidia/nvcc_code/*.cu"
"xmrstak/backend/nvidia/*.cpp")
- # build device code with nvcc
- cuda_add_library(xmrstak_cuda_backend
- SHARED
- ${CUDASRCFILES}
- )
+ if("${CUDA_COMPILER}" STREQUAL "clang")
+ # build device code with clang
+ add_library(
+ xmrstak_cuda_backend
+ SHARED
+ ${CUDASRCFILES}
+ )
+ set_target_properties(xmrstak_cuda_backend PROPERTIES COMPILE_FLAGS ${CLANG_BUILD_FLAGS})
+ set_target_properties(xmrstak_cuda_backend PROPERTIES LINKER_LANGUAGE CXX)
+ set_source_files_properties(${CUDASRCFILES} PROPERTIES LANGUAGE CXX)
+ else()
+ # build device code with nvcc
+ cuda_add_library(
+ xmrstak_cuda_backend
+ SHARED
+ ${CUDASRCFILES}
+ )
+ endif()
target_link_libraries(xmrstak_cuda_backend ${CUDA_LIBRARIES})
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_link_libraries(xmrstak_cuda_backend xmr-stak-backend)
endif()
endif()
+# compile AMD backend
if(OpenCL_FOUND)
file(GLOB OPENCLSRCFILES
"xmrstak/backend/amd/amd_gpu/*.cpp"
@@ -367,12 +386,10 @@ if(OpenCL_FOUND)
endif()
endif()
+# compile final binary
file(GLOB SRCFILES_CPP "xmrstak/cli/*.cpp")
set_source_files_properties(${SRCFILES_CPP} PROPERTIES LANGUAGE CXX)
-set_property(TARGET xmr-stak-c PROPERTY C_STANDARD 99)
-target_link_libraries(xmr-stak-c ${LIBS})
-
add_executable(xmr-stak
${SRCFILES_CPP}
)
diff --git a/xmrstak/backend/amd/jconf.cpp b/xmrstak/backend/amd/jconf.cpp
index 2132ebf..c2bf1fa 100644
--- a/xmrstak/backend/amd/jconf.cpp
+++ b/xmrstak/backend/amd/jconf.cpp
@@ -252,7 +252,7 @@ bool jconf::parse_config(const char* sFilename)
return false;
}
}
-
+ return true;
}
} // namespace amd
diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp
index 4846d08..66adaf1 100644
--- a/xmrstak/cli/cli-miner.cpp
+++ b/xmrstak/cli/cli-miner.cpp
@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
{
params::inst().useAMD = false;
}
- else if(opName.compare("--noAMD") == 0)
+ else if(opName.compare("--noNVIDIA") == 0)
{
params::inst().useNVIDIA = false;
}
OpenPOWER on IntegriCloud