summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorpsychocrypt <psychocrypt@users.noreply.github.com>2017-06-15 22:23:06 +0200
committerpsychocrypt <psychocrypt@users.noreply.github.com>2017-06-15 22:23:06 +0200
commitd46e805d02c0bed846183708c5baa8793df38431 (patch)
treeb20efbb364d34d2f128dad3941ec22f86098bf42 /CMakeLists.txt
parentae13163dd05a17fd3709e579d7021e2c9b7fda24 (diff)
downloadxmr-stak-d46e805d02c0bed846183708c5baa8793df38431.zip
xmr-stak-d46e805d02c0bed846183708c5baa8793df38431.tar.gz
add Windows VS2017 support
- add windows socket libraries - search for windows name of all dependencies - add missing link step to the intermediate static library
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt48
1 files changed, 39 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 876d68d..2391a0b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@ list(APPEND CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")
# https://github.com/fireice-uk/xmr-stak-nvidia/pull/10#issuecomment-290821792
# If you remove this guard to compile with older gcc versions the miner will produce
# a high rate of wrong shares.
-if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
message(FATAL_ERROR "GCC version must be at least 5.1!")
endif()
@@ -50,7 +50,14 @@ set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
option(MICROHTTPD_ENABLE "Enable or disable the requirement of microhttp (http deamon)" ON)
if(MICROHTTPD_ENABLE)
- find_library(MHTD NAMES microhttpd)
+ find_library(MHTD
+ NAMES
+ microhttpd
+ libmicrohttpd.lib
+ PATHS
+ ENV "MICROHTTPD_ROOT"
+ PATH_SUFFIXES
+ lib)
if("${MHTD}" STREQUAL "MHTD-NOTFOUND")
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http deamon support")
else()
@@ -83,13 +90,27 @@ endif()
option(HWLOC_ENABLE "Enable or disable the requirement of hwloc" ON)
if(HWLOC_ENABLE)
- find_path(HWLOC_INCLUDE_DIR hwloc.h
- $ENV{HWLOC_ROOT}/inlcude
- /opt/local/include
- /usr/local/include
- /usr/include
- )
- find_library(HWLOC NAMES hwloc)
+ find_path(HWLOC_INCLUDE_DIR
+ NAMES
+ hwloc.h
+ PATHS
+ /opt/local
+ /usr/local
+ /usr
+ ENV "PROGRAMFILES(X86)"
+ ENV "HWLOC_ROOT"
+ PATH_SUFFIXES
+ include)
+
+ find_library(HWLOC
+ NAMES
+ libhwloc.lib
+ hwloc
+ PATHS
+ ENV "HWLOC_ROOT"
+ PATH_SUFFIXES
+ lib)
+
if("${HWLOC}" STREQUAL "MHTD-NOTFOUND" OR ${HWLOC_INCLUDE_DIR} STREQUAL "HWLOC_INCLUDE_DIR-NOTFOUND")
message(FATAL_ERROR "hwloc NOT found: use `-DHWLOC_ENABLE=OFF` to build without hwloc support")
else()
@@ -101,6 +122,14 @@ else()
endif()
################################################################################
+# Windows Sockets
+################################################################################
+
+if(WIN32)
+ set(LIBS ${LIBS} wsock32 ws2_32)
+endif()
+
+################################################################################
# Compile & Link
################################################################################
@@ -124,6 +153,7 @@ add_library(xmr-stak-c
${SRCFILES_C}
)
set_property(TARGET xmr-stak-c PROPERTY C_STANDARD 99)
+target_link_libraries(xmr-stak-c ${LIBS})
add_executable(xmr-stak-cpu
${SRCFILES_CPP}
OpenPOWER on IntegriCloud