@ -1,7 +1,7 @@
# c m a k e g l o b a l
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 )
cmake_policy ( SET CMP0048 NEW ) # a l l o w V E R S I O N a r g u m e n t i n project ( )
project ( ethereum VERSION ${ PROJECT_VERSION } )
@ -28,29 +28,124 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# u s e r d e f i n e d , d e f a u l t s
# N o r m a l l y , set ( ...CACHE... ) c r e a t e s c a c h e v a r i a b l e s , b u t d o e s n o t m o d i f y t h e m .
option ( VMTRACE "VM tracing and run-time checks (useful for cross-implementation VM debugging)" OFF )
option ( PARANOID "Additional run-time checks" OFF )
option ( JSONRPC "Build with jsonprc. default on" 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 )
option ( USENPM "Use npm to recompile ethereum.js if it was changed" OFF )
option ( PROFILING "Build in support for profiling" OFF )
option ( ROCKSDB "Use rocksdb rather than leveldb" OFF )
set ( BUNDLE "none" CACHE STRING "Predefined bundle of software to build (none, full, user, tests, minimal)." )
option ( MINER "Build the CLI miner component" ON )
option ( ETHKEY "Build the CLI key manager component" ON )
option ( SOLIDITY "Build the Solidity language components" ON )
option ( SERPENT "Build the Serpent language components" ON )
option ( TOOLS "Build the tools components" ON )
option ( GUI "Build GUI components (AlethZero, Mix)" ON )
option ( TESTS "Build the tests." ON )
option ( NOBOOST "No use of boost macros in test functions" OFF )
option ( EVMJIT "Build just-in-time compiler for EVM code (requires LLVM)" ON )
option ( ETHASHCL "Build in support for GPU mining via OpenCL" ON )
option ( JSCONSOLE "Build in javascript console" ON )
option ( FRONTIER "Build for Frontier network" OFF )
# n o t e : T h e v a l u e " d e f a u l t " w h i c h p r o v i d e s t h e d e f a u l t s i s j u s t a f a k e v a l u e
# w h i c h l e t s u s k e e p t h e d e f a u l t v a l u e s o f a l l b u i l d o p t i o n s a n d i s s e t a t
# t h e b e g i n n i n g o f t h i s f i l e .
# T O D O : A b s t r a c t i n t o s o m e t h i n g s e n s i b l e a n d m o v e i n t o a f u n c t i o n .
if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" )
set ( DECENT_PLATFORM OFF )
else ( )
set ( DECENT_PLATFORM ON )
endif ( )
# d e f a u l t s :
set ( D_CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( D_SERPENT ${ DECENT_PLATFORM } )
set ( D_SOLIDITY ON )
set ( D_USENPM OFF )
set ( D_GUI ON )
set ( D_TOOLS ON )
set ( D_TESTS ON )
set ( D_FATDB ON )
set ( D_ETHASHCL ON )
set ( D_EVMJIT ON )
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" ) # r e l e a s e b u i l d s
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 ( )
# p r o p a g a t e s C M a k e c o n f i g u r a t i o n o p t i o n s t o t h e c o m p i l e r
function ( configureProject )
@ -177,24 +272,11 @@ if (HEADLESS)
set ( GUI OFF )
endif ( )
# T O D O : A b s t r a c t i n t o s o m e t h i n g s e n s i b l e a n d m o v e i n t o a f u n c t i o n .
if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" )
set ( DECENT_PLATFORM OFF )
else ( )
set ( DECENT_PLATFORM ON )
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 } )
elseif ( "${${O}}" STREQUAL "" AND ${ D_${O } } )
set ( ${ O } ON )
else ( )
set ( ${ O } OFF )
endif ( )
@ -220,7 +302,7 @@ eth_format_option(ETHKEY)
eth_format_option ( ETHASHCL )
eth_format_option ( JSCONSOLE )
eth_format_option ( FRONTIER )
eth_format_option_on_decent_platform ( SERPENT )
eth_format_option ( SERPENT )
if ( JSCONSOLE )
set ( JSONRPC ON )
@ -231,110 +313,11 @@ if (GUI)
endif ( )
# D e f a u l t C M A K E _ B U I L D _ T Y P E t o " R e l e a s e " .
set ( CMAKE_BUILD_TYPE CACHE STRING "Release" )
# n o t e : T h e v a l u e " d e f a u l t " w h i c h p r o v i d e s t h e d e f a u l t s i s j u s t a f a k e v a l u e
# w h i c h l e t s u s k e e p t h e d e f a u l t v a l u e s o f a l l b u i l d o p t i o n s a n d i s s e t a t
# t h e b e g i n n i n g o f t h i s f i l e .
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" ) # d e v e l o p m e n t b u i l d s
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" ) # r e l e a s e b u i l d s
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 ( )
set ( CMAKE_BUILD_TYPE CACHE STRING ${ D_CMAKE_BUILD_TYPE } )
if ( "x${CMAKE_BUILD_TYPE}" STREQUAL "x" )
set ( CMAKE_BUILD_TYPE "Release" )
endif ( )
# if ( "x${CMAKE_BUILD_TYPE}" STREQUAL "x" )
# set ( CMAKE_BUILD_TYPE ${ D_CMAKE_BUILD_TYPE } )
# endif ( )
# D e f a u l t T A R G E T _ P L A T F O R M t o $ { C M A K E _ S Y S T E M _ N A M E }
# c h a n g e t h i s o n c e w e s u p p o r t c r o s s c o m p i l i n g