forked from Lolliedieb/FishHashMiner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
97 lines (71 loc) · 2.58 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
cmake_minimum_required(VERSION 3.1)
project(fishHashMiner)
set(TARGET_NAME fishHashMiner)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(Boost_USE_MULTITHREADED ON)
#set(Boost_USE_STATIC_LIBS ON)
#set(Boost_USE_STATIC_RUNTIME ON)
#set(OPENSSL_USE_STATIC_LIBS TRUE)
if(UNIX)
find_library(DL_LIB libdl.a REQUIRED)
endif()
find_package(Boost REQUIRED COMPONENTS system)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
endif()
if (MSVC)
# use static runtime
foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
set(OPENSSL_USE_STATIC_LIBS TRUE)
set(OPENSSL_MSVC_STATIC_RT TRUE)
endif()
find_package(OpenSSL REQUIRED)
if( OpenSSL_FOUND )
link_directories(${OPENSSL_LIBRARIES})
include_directories(${OPENSSL_INCLUDE_DIR})
message(STATUS "Using OpenSSL ${OPENSSL_VERSION}")
else()
message(FATAL_ERROR "error, OpenSSL not found, please install: 'apt-get install libssl-dev' on Ubuntu")
endif()
find_package(OpenCLHeaders REQUIRED)
find_package(OpenCLICDLoader REQUIRED)
find_package(OpenCLHeadersCpp REQUIRED)
# Miner Sources & Headers
set (HEADERS
)
set(MINER_SRC
src/clHost.cpp
src/ironFishStratum.cpp
src/main.cpp
)
add_executable(${TARGET_NAME} ${MINER_SRC} ${HEADERS} )
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libFishHash)
add_subdirectory(libFishHash)
target_compile_options(${TARGET_NAME} PRIVATE -Werror -Wall -Wextra)
# Linking packages
target_link_libraries(${TARGET_NAME} OpenCL::Headers OpenCL::OpenCL OpenCL::HeadersCpp)
target_link_libraries(${TARGET_NAME} FishHash)
if(MSVC)
target_link_libraries(${TARGET_NAME} crypt32.lib)
if(MSVC_VERSION GREATER_EQUAL 1900)
target_link_libraries(${TARGET_NAME} legacy_stdio_definitions.lib)
endif()
endif()
if(UNIX)
target_link_libraries(${TARGET_NAME} -ldl)
endif()
target_link_libraries(${TARGET_NAME} ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ${Boost_LIBRARIES})
if(UNIX)
find_package(Threads)
target_link_libraries(${TARGET_NAME} Threads::Threads)
endif()