This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathCMakeLists.txt
48 lines (35 loc) · 1.55 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
cmake_minimum_required (VERSION 3.10.2)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_SOURCE_DIR}/ci/ccache_clang")
set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_SOURCE_DIR}/ci/ccache_clang++")
set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_SOURCE_DIR}/ci/ccache_clang")
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_SOURCE_DIR}/ci/ccache_clang++")
endif()
project( koinos-miner )
option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF)
# This is to force color output when using ccache with Unix Makefiles
if( ${FORCE_COLORED_OUTPUT} )
if( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )
add_compile_options (-fdiagnostics-color=always)
elseif( "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" )
add_compile_options (-fcolor-diagnostics)
endif ()
endif ()
set(CMAKE_C_STANDARD 11)
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror" )
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas" )
endif()
if(MINGW)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
endif()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -fopenmp -static-libgcc")
if(APPLE)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE")
endif()
if(${CMAKE_GENERATOR} MATCHES "Xcode")
set(CMAKE_XCODE_GENERATE_SCHEME YES)
endif()
add_subdirectory(miner)