Browse Source

Bundle now only sets default, other options can override.

cl-refactor
Gav Wood 10 years ago
parent
commit
239b2a5580
  1. 269
      CMakeLists.txt

269
CMakeLists.txt

@ -1,7 +1,7 @@
# cmake global # cmake global
cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 2.8.12)
set(PROJECT_VERSION "0.9.35") set(PROJECT_VERSION "0.9.36")
if (${CMAKE_VERSION} VERSION_GREATER 3.0) if (${CMAKE_VERSION} VERSION_GREATER 3.0)
cmake_policy(SET CMP0048 NEW) # allow VERSION argument in project() cmake_policy(SET CMP0048 NEW) # allow VERSION argument in project()
project(ethereum VERSION ${PROJECT_VERSION}) project(ethereum VERSION ${PROJECT_VERSION})
@ -28,29 +28,124 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
###################################################################################################### ######################################################################################################
# user defined, defaults # note: The value "default" which provides the defaults is just a fake value
# Normally, set(...CACHE...) creates cache variables, but does not modify them. # which lets us keep the default values of all build options and is set at
option(VMTRACE "VM tracing and run-time checks (useful for cross-implementation VM debugging)" OFF) # the beginning of this file.
option(PARANOID "Additional run-time checks" OFF)
option(JSONRPC "Build with jsonprc. default on" ON) # TODO: Abstract into something sensible and move into a function.
option(FATDB "Build with ability to list entries in the Trie. Doubles DB size, slows everything down, but good for looking at state diffs and trie contents." OFF) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
option(USENPM "Use npm to recompile ethereum.js if it was changed" OFF) set(DECENT_PLATFORM OFF)
option(PROFILING "Build in support for profiling" OFF) else ()
option(ROCKSDB "Use rocksdb rather than leveldb" OFF) set(DECENT_PLATFORM ON)
endif ()
set(BUNDLE "none" CACHE STRING "Predefined bundle of software to build (none, full, user, tests, minimal).")
option(MINER "Build the CLI miner component" ON) #defaults:
option(ETHKEY "Build the CLI key manager component" ON) set(D_CMAKE_BUILD_TYPE "RelWithDebInfo")
option(SOLIDITY "Build the Solidity language components" ON) set(D_SERPENT ${DECENT_PLATFORM})
option(SERPENT "Build the Serpent language components" ON) set(D_SOLIDITY ON)
option(TOOLS "Build the tools components" ON) set(D_USENPM OFF)
option(GUI "Build GUI components (AlethZero, Mix)" ON) set(D_GUI ON)
option(TESTS "Build the tests." ON) set(D_TOOLS ON)
option(NOBOOST "No use of boost macros in test functions" OFF) set(D_TESTS ON)
option(EVMJIT "Build just-in-time compiler for EVM code (requires LLVM)" ON) set(D_FATDB ON)
option(ETHASHCL "Build in support for GPU mining via OpenCL" ON) set(D_ETHASHCL ON)
option(JSCONSOLE "Build in javascript console" ON) set(D_EVMJIT ON)
option(FRONTIER "Build for Frontier network" OFF) set(D_JSCONSOLE ON)
set(D_JSONRPC ON)
set(D_VMTRACE OFF)
set(D_PARANOID OFF)
set(D_PROFILING OFF)
set(D_ROCKSDB OFF)
set(D_NOBOOST OFF)
set(D_FRONTIER OFF)
set(D_MINER ON)
set(D_ETHKEY ON)
if (BUNDLE STREQUAL "minimal")
set(D_SERPENT OFF)
set(D_SOLIDITY OFF)
set(D_USENPM OFF)
set(D_GUI OFF)
set(D_TOOLS ON)
set(D_TESTS OFF)
elseif (BUNDLE STREQUAL "full")
set(D_SERPENT ${DECENT_PLATFORM})
set(D_SOLIDITY ON)
set(D_USENPM ON)
set(D_GUI ON)
set(D_TOOLS ON)
set(D_TESTS ON)
set(D_FATDB ON)
elseif (BUNDLE STREQUAL "cli")
set(D_SERPENT ${DECENT_PLATFORM})
set(D_SOLIDITY ON)
set(D_USENPM ON)
set(D_GUI OFF)
set(D_TOOLS ON)
set(D_TESTS ON)
set(D_FATDB ON)
elseif (BUNDLE STREQUAL "core")
set(D_SERPENT OFF)
set(D_SOLIDITY ON)
set(D_USENPM OFF)
set(D_GUI ON)
set(D_TOOLS ON)
set(D_TESTS OFF)
set(D_FATDB ON)
elseif (BUNDLE STREQUAL "tests")
set(D_SERPENT ${DECENT_PLATFORM})
set(D_SOLIDITY ON)
set(D_USENPM OFF)
set(D_GUI OFF)
set(D_TOOLS OFF)
set(D_TESTS ON)
set(D_FATDB ON)
elseif (BUNDLE STREQUAL "user")
set(D_SERPENT OFF)
set(D_SOLIDITY OFF)
set(D_USENPM OFF)
set(D_GUI ON)
set(D_TOOLS ON)
set(D_TESTS OFF)
elseif (BUNDLE STREQUAL "wallet")
set(D_SERPENT OFF)
set(D_SOLIDITY OFF)
set(D_USENPM OFF)
set(D_GUI OFF)
set(D_TOOLS OFF)
set(D_TESTS OFF)
set(D_ETHKEY ON)
set(D_MINER OFF)
set(D_ETHASHCL ON)
elseif (BUNDLE STREQUAL "miner")
set(D_SERPENT OFF)
set(D_SOLIDITY OFF)
set(D_USENPM OFF)
set(D_GUI OFF)
set(D_TOOLS OFF)
set(D_TESTS OFF)
set(D_ETHKEY OFF)
set(D_MINER ON)
set(D_ETHASHCL ON)
elseif (BUNDLE STREQUAL "release") # release builds
set(D_SERPENT ${DECENT_PLATFORM})
set(D_SOLIDITY ON)
set(D_USENPM OFF)
set(D_GUI ON)
set(D_TOOLS ON)
set(D_TESTS OFF)
set(D_FATDB OFF)
set(D_ETHASHCL ON)
set(D_EVMJIT ON)
set(D_JSCONSOLE ON)
set(D_JSONRPC ON)
set(D_FRONTIER ON)
set(D_CMAKE_BUILD_TYPE "Release")
endif ()
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)
@ -177,24 +272,11 @@ if (HEADLESS)
set(GUI OFF) set(GUI OFF)
endif () endif ()
# TODO: Abstract into something sensible and move into a function.
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(DECENT_PLATFORM OFF)
else ()
set(DECENT_PLATFORM ON)
endif ()
macro(eth_format_option O) macro(eth_format_option O)
if (${${O}}) if (${${O}})
set(${O} ON) set(${O} ON)
else() elseif ("${${O}}" STREQUAL "" AND ${D_${O}})
set(${O} OFF) set(${O} ON)
endif()
endmacro()
macro(eth_format_option_on_decent_platform O)
if (${${O}})
set(${O} ${DECENT_PLATFORM})
else() else()
set(${O} OFF) set(${O} OFF)
endif() endif()
@ -220,7 +302,7 @@ eth_format_option(ETHKEY)
eth_format_option(ETHASHCL) eth_format_option(ETHASHCL)
eth_format_option(JSCONSOLE) eth_format_option(JSCONSOLE)
eth_format_option(FRONTIER) eth_format_option(FRONTIER)
eth_format_option_on_decent_platform(SERPENT) eth_format_option(SERPENT)
if (JSCONSOLE) if (JSCONSOLE)
set(JSONRPC ON) set(JSONRPC ON)
@ -231,110 +313,11 @@ if (GUI)
endif() endif()
# Default CMAKE_BUILD_TYPE to "Release". # Default CMAKE_BUILD_TYPE to "Release".
set(CMAKE_BUILD_TYPE CACHE STRING "Release") set(CMAKE_BUILD_TYPE CACHE STRING ${D_CMAKE_BUILD_TYPE})
# note: The value "default" which provides the defaults is just a fake value
# which lets us keep the default values of all build options and is set at
# the beginning of this file.
if (BUNDLE STREQUAL "minimal")
set(SERPENT OFF)
set(SOLIDITY OFF)
set(USENPM OFF)
set(GUI OFF)
set(TOOLS ON)
set(TESTS OFF)
elseif (BUNDLE STREQUAL "full")
set(SERPENT ${DECENT_PLATFORM})
set(SOLIDITY ON)
set(USENPM ON)
set(GUI ON)
set(TOOLS ON)
set(TESTS ON)
set(FATDB ON)
elseif (BUNDLE STREQUAL "cli")
set(SERPENT ${DECENT_PLATFORM})
set(SOLIDITY ON)
set(USENPM ON)
set(GUI OFF)
set(TOOLS ON)
set(TESTS ON)
set(FATDB ON)
elseif (BUNDLE STREQUAL "core")
set(SERPENT OFF)
set(SOLIDITY ON)
set(USENPM OFF)
set(GUI ON)
set(TOOLS ON)
set(TESTS OFF)
set(FATDB ON)
elseif (BUNDLE STREQUAL "tests")
set(SERPENT ${DECENT_PLATFORM})
set(SOLIDITY ON)
set(USENPM OFF)
set(GUI OFF)
set(TOOLS OFF)
set(TESTS ON)
set(FATDB ON)
elseif (BUNDLE STREQUAL "user")
set(SERPENT OFF)
set(SOLIDITY OFF)
set(USENPM OFF)
set(GUI ON)
set(TOOLS ON)
set(TESTS OFF)
elseif (BUNDLE STREQUAL "wallet")
set(SERPENT OFF)
set(SOLIDITY OFF)
set(USENPM OFF)
set(GUI OFF)
set(TOOLS OFF)
set(TESTS OFF)
set(ETHKEY ON)
set(MINER OFF)
set(ETHASHCL ON)
elseif (BUNDLE STREQUAL "miner")
set(SERPENT OFF)
set(SOLIDITY OFF)
set(USENPM OFF)
set(GUI OFF)
set(TOOLS OFF)
set(TESTS OFF)
set(ETHKEY OFF)
set(MINER ON)
set(ETHASHCL ON)
elseif (BUNDLE STREQUAL "default") # development builds
set(SERPENT ${DECENT_PLATFORM})
set(SOLIDITY ON)
set(USENPM OFF)
set(GUI ON)
set(TOOLS ON)
set(TESTS ON)
set(FATDB ON)
set(ETHASHCL ON)
set(EVMJIT ON)
set(JSCONSOLE ON)
set(JSONRPC ON)
if ("x${CMAKE_BUILD_TYPE}" STREQUAL "x")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif ()
elseif (BUNDLE STREQUAL "release") # release builds
set(SERPENT ${DECENT_PLATFORM})
set(SOLIDITY ON)
set(USENPM OFF)
set(GUI ON)
set(TOOLS ON)
set(TESTS OFF)
set(FATDB OFF)
set(ETHASHCL ON)
set(EVMJIT ON)
set(JSCONSOLE ON)
set(JSONRPC ON)
set(FRONTIER ON)
endif ()
if ("x${CMAKE_BUILD_TYPE}" STREQUAL "x") #if ("x${CMAKE_BUILD_TYPE}" STREQUAL "x")
set(CMAKE_BUILD_TYPE "Release") # set(CMAKE_BUILD_TYPE ${D_CMAKE_BUILD_TYPE})
endif () #endif ()
# Default TARGET_PLATFORM to ${CMAKE_SYSTEM_NAME} # Default TARGET_PLATFORM to ${CMAKE_SYSTEM_NAME}
# change this once we support cross compiling # change this once we support cross compiling

Loading…
Cancel
Save