Browse Source

Merge pull request #1635 from debris/cmake_cleanup

cleanup CMakeLists.txt
cl-refactor
Gav Wood 10 years ago
parent
commit
452b6ebdf5
  1. 146
      CMakeLists.txt

146
CMakeLists.txt

@ -8,30 +8,26 @@ project(ethereum)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
###################################################################################################### ######################################################################################################
# user defined, defaults # user defined, defaults
# Normally, set(...CACHE...) creates cache variables, but does not modify them. # Normally, set(...CACHE...) creates cache variables, but does not modify them.
function(createDefaultCacheConfig) option(VMTRACE "VM tracing and run-time checks (useful for cross-implementation VM debugging)" OFF)
set(VMTRACE OFF CACHE BOOL "VM tracing and run-time checks (useful for cross-implementation VM debugging)") option(PARANOID "Additional run-time checks" OFF)
set(PARANOID OFF CACHE BOOL "Additional run-time checks") option(JSONRPC "Build with jsonprc. default on" ON)
set(JSONRPC ON CACHE BOOL "Build with jsonprc. default on") 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)
set(FATDB OFF CACHE BOOL "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.") option(USENPM "Use npm to recompile ethereum.js if it was changed" OFF)
set(USENPM OFF CACHE BOOL "Use npm to recompile ethereum.js if it was changed") option(PROFILING "Build in support for profiling" OFF)
set(PROFILING OFF CACHE BOOL "Build in support for profiling")
set(BUNDLE "none" CACHE STRING "Predefined bundle of software to build (none, full, user, tests, minimal).")
set(BUNDLE "none" CACHE STRING "Predefined bundle of software to build (none, full, user, tests, minimal).") option(SOLIDITY "Build the Solidity language components" ON)
set(SOLIDITY ON CACHE BOOL "Build the Solidity language components") option(SERPENT "Build the Serpent language components" ON)
set(SERPENT ON CACHE BOOL "Build the Serpent language components") option(TOOLS "Build the tools components" ON)
set(TOOLS ON CACHE BOOL "Build the tools components") option(NCURSES "Build the NCurses components" ON)
set(NCURSES ON CACHE BOOL "Build the NCurses components") option(GUI "Build GUI components (AlethZero, Mix)" ON)
set(GUI ON CACHE BOOL "Build GUI components (AlethZero, Mix)") option(TESTS "Build the tests." ON)
set(TESTS ON CACHE BOOL "Build the tests.") option(EVMJIT "Build just-in-time compiler for EVM code (requires LLVM)" OFF)
set(EVMJIT OFF CACHE BOOL "Build just-in-time compiler for EVM code (requires LLVM)") option(ETHASHCL "Build in support for GPU mining via OpenCL" OFF)
set(ETHASHCL OFF CACHE BOOL "Build in support for GPU mining via OpenCL")
endfunction()
# propagates CMake configuration options to the compiler # propagates CMake configuration options to the compiler
function(configureProject) function(configureProject)
@ -143,97 +139,57 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
endif () endif ()
endif () endif ()
createDefaultCacheConfig()
# Force chromium. # Force chromium.
set (ETH_HAVE_WEBENGINE 1) set (ETH_HAVE_WEBENGINE 1)
# Normalise build options
# 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 ()
# Backwards compatibility # Backwards compatibility
if (HEADLESS) if (HEADLESS)
message("*** WARNING: -DHEADLESS=1 option is DEPRECATED! Use -DBUNDLE=minimal or -DGUI=0") message("*** WARNING: -DHEADLESS=1 option is DEPRECATED! Use -DBUNDLE=minimal or -DGUI=0")
set(BUNDLE "minimal") set(BUNDLE "minimal")
endif () endif ()
if (PARANOID) # TODO: Abstract into something sensible and move into a function.
set(PARANOID ON) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
else () set(DECENT_PLATFORM OFF)
set(PARANOID OFF)
endif ()
if (VMTRACE)
set(VMTRACE ON)
else ()
set(VMTRACE OFF)
endif ()
if (EVMJIT)
set(EVMJIT ON)
else ()
set(EVMJIT OFF)
endif()
if (FATDB)
set(FATDB ON)
else ()
set(FATDB OFF)
endif()
if (JSONRPC)
set(JSONRPC ON)
else ()
set(JSONRPC OFF)
endif ()
if (USENPM)
set(USENPM ON)
else ()
set(USENPM OFF)
endif ()
if (PROFILING)
set(PROFILING ON)
else () else ()
set(PROFILING OFF) set(DECENT_PLATFORM ON)
endif () endif ()
macro(eth_format_option O)
if (${${O}})
set(${O} ON)
else()
set(${O} OFF)
endif()
endmacro()
macro(eth_format_option_on_decent_platform O)
if (${${O}})
set(${O} ${DECENT_PLATFORM})
else()
set(${O} OFF)
endif()
endmacro()
# Normalise build options
eth_format_option(PARANOID)
eth_format_option(VMTRACE)
eth_format_option(EVMJIT)
eth_format_option(FATDB)
eth_format_option(JSONRPC)
eth_format_option(USENPM)
eth_format_option(PROFILING)
eth_format_option(SOLIDITY)
eth_format_option(GUI)
eth_format_option(TESTS)
eth_format_option(TOOLS)
eth_format_option(ETHASHCL)
eth_format_option_on_decent_platform(SERPENT)
eth_format_option_on_decent_platform(NCURSES)
if (SOLIDITY)
set(SOLIDITY ON)
else ()
set(SOLIDITY OFF)
endif()
if (SERPENT)
set(SERPENT ${DECENT_PLATFORM})
else ()
set(SERPENT OFF)
endif()
if (GUI) if (GUI)
set(GUI ON)
set(JSONRPC ON) set(JSONRPC ON)
else ()
set(GUI OFF)
endif ()
if (TESTS)
set(TESTS ON)
else ()
set(TESTS OFF)
endif ()
if (TOOLS)
set(TOOLS ON)
else ()
set(TOOLS OFF)
endif ()
if (ETHASHCL)
set(ETHASHCL ON)
else ()
set(ETHASHCL OFF)
endif() endif()
if (NCURSES)
set(NCURSES ${DECENT_PLATFORM})
else ()
set(NCURSES OFF)
endif ()
if (BUNDLE STREQUAL "minimal") if (BUNDLE STREQUAL "minimal")
set(SERPENT OFF) set(SERPENT OFF)

Loading…
Cancel
Save