Browse Source

Cleanup CMake options

cl-refactor
Paweł Bylica 8 years ago
parent
commit
c45fcfc939
No known key found for this signature in database GPG Key ID: 7A0C037434FE77EF
  1. 46
      CMakeLists.txt

46
CMakeLists.txt

@ -33,31 +33,22 @@ cmake_policy(SET CMP0054 NEW)
###################################################################################################### ######################################################################################################
# note: The value "default" which provides the defaults is just a fake value # Default CMAKE_BUILD_TYPE.
# which lets us keep the default values of all build options and is set at set(CMAKE_BUILD_TYPE CACHE STRING Release)
# the beginning of this file.
option(ETHASHCL "Build with OpenCL mining" ON)
#defaults: option(ETHASHCUDA "Build with CUDA mining" OFF)
set(D_ETHASHCL ON) option(ETHSTRATUM "Build with Stratum protocol support" ON)
set(D_ETHASHCUDA OFF)
set(D_JSONRPC ON)
set(D_ETHSTRATUM OFF)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE ${D_CMAKE_BUILD_TYPE})
endif ()
# propagates CMake configuration options to the compiler # propagates CMake configuration options to the compiler
function(configureProject) function(configureProject)
if (ETHASHCL) if (ETHASHCL)
add_definitions(-DETH_ETHASHCL) add_definitions(-DETH_ETHASHCL)
endif() endif()
if (ETHASHCUDA) if (ETHASHCUDA)
add_definitions(-DETH_ETHASHCUDA) add_definitions(-DETH_ETHASHCUDA)
endif() endif()
if (ETHSTRATUM) if (ETHSTRATUM)
add_definitions(-DETH_STRATUM) add_definitions(-DETH_STRATUM)
endif() endif()
@ -99,27 +90,6 @@ function(createBuildInfo)
endfunction() endfunction()
######################################################################################################
macro(eth_format_option O)
if (${${O}})
set(${O} ON)
elseif ("${${O}}" STREQUAL "" AND ${D_${O}})
set(${O} ON)
else()
set(${O} OFF)
endif()
endmacro()
# Normalise build options
eth_format_option(ETHASHCL)
eth_format_option(ETHASHCUDA)
eth_format_option(ETHSTRATUM)
# Default CMAKE_BUILD_TYPE accordingly.
set(CMAKE_BUILD_TYPE CACHE STRING Release)
hunter_add_package(Boost COMPONENTS system) hunter_add_package(Boost COMPONENTS system)
find_package(Boost CONFIG REQUIRED COMPONENTS system) find_package(Boost CONFIG REQUIRED COMPONENTS system)
@ -145,7 +115,6 @@ include(EthCompilerSettings)
createBuildInfo() createBuildInfo()
add_subdirectory(libdevcore) add_subdirectory(libdevcore)
add_subdirectory(libethash) add_subdirectory(libethash)
if (ETHASHCL) if (ETHASHCL)
add_subdirectory(libethash-cl) add_subdirectory(libethash-cl)
@ -156,6 +125,5 @@ endif ()
if(ETHSTRATUM) if(ETHSTRATUM)
add_subdirectory(libstratum) add_subdirectory(libstratum)
endif() endif()
add_subdirectory(libethcore) add_subdirectory(libethcore)
add_subdirectory(ethminer) add_subdirectory(ethminer)

Loading…
Cancel
Save