Browse Source

Nicer cmake read out.

Add profiling support.
cl-refactor
Gav Wood 10 years ago
parent
commit
80df4e11fc
  1. 77
      CMakeLists.txt
  2. 6
      cmake/EthCompilerSettings.cmake

77
CMakeLists.txt

@ -24,6 +24,7 @@ function(createDefaultCacheConfig)
set(SOLIDITY ON CACHE BOOL "Build the Solidity language components (requried unless HEADLESS)")
set(USENPM OFF CACHE BOOL "Use npm to recompile ethereum.js if it was changed")
set(ETHASHCL OFF CACHE BOOL "Build in support for GPU mining via OpenCL")
set(PROFILING OFF CACHE BOOL "Build in support for profiling")
endfunction()
@ -56,6 +57,7 @@ function(configureProject)
if (HEADLESS OR JUSTTESTS)
add_definitions(-DETH_HEADLESS)
endif()
endfunction()
set(CPPETHEREUM 1)
@ -133,8 +135,79 @@ configureProject()
# Force chromium.
set (ETH_HAVE_WEBENGINE 1)
message(STATUS "CMAKE_VERSION: ${CMAKE_VERSION}")
message("-- VMTRACE: ${VMTRACE}; PARANOIA: ${PARANOIA}; HEADLESS: ${HEADLESS}; JSONRPC: ${JSONRPC}; EVMJIT: ${EVMJIT}; FATDB: ${FATDB}; CHROMIUM: ${ETH_HAVE_WEBENGINE}; USENPM: ${USENPM}; ETHASHCL: ${ETHASHCL}")
# Normalise build options
# TODO: Abstract into something sensible and move into a function.
if (PARANOIA)
set(PARANOIA ON)
else ()
set (PARANOIA OFF)
endif ()
if (VMTRACE)
set(VMTRACE ON)
else ()
set (VMTRACE OFF)
endif ()
if (ETHASHCL)
set(ETHASHCL ON)
else ()
set (ETHASHCL OFF)
endif()
if (EVMJIT)
set(EVMJIT ON)
else ()
set (EVMJIT OFF)
endif()
if (FATDB)
set(FATDB ON)
else ()
set (FATDB OFF)
endif()
if (SOLIDITY)
set(SOLIDITY ON)
else ()
set (SOLIDITY OFF)
endif()
if (HEADLESS)
set(HEADLESS ON)
else ()
set (HEADLESS OFF)
endif ()
if (JUSTTESTS)
set(JUSTTESTS ON)
else ()
set (JUSTTESTS 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 ()
set (PROFILING OFF)
endif ()
message(STATUS "CMake Version: ${CMAKE_VERSION}")
message("-- VM execution tracing VMTRACE ${VMTRACE}")
message("-- Profiling support PROFILING ${PROFILING}")
message("-- Additional (SLOW) database checking PARANOIA ${PARANOIA}")
message("-- Full database exploring FATDB ${FATDB}")
message("-- Build Javascript components from source USENPM ${USENPM}")
message("-- Build only headless components HEADLESS ${HEADLESS}")
message("-- Build only tests JUSTTESTS ${JUSTTESTS}")
message("-- Build Solidity language components SOLIDITY ${SOLIDITY}")
message("-- Build OpenCL components ETHASHCL ${ETHASHCL}")
message("-- Build LLVM-based JIT EVM EVMJIT ${EVMJIT}")
message("-- Build with support for JSON-RPC JSONRPC ${JSONRPC}")
message("-- Build with support for Chromium ${ETH_HAVE_WEBENGINE}")
message("------------------------------------------------------------------------")
message("")
# Default TARGET_PLATFORM to "linux".

6
cmake/EthCompilerSettings.cmake

@ -7,9 +7,13 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DETH_DEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DETH_RELEASE")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -DETH_RELEASE")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DETH_DEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DETH_RELEASE")
set(ETH_SHARED 1)
if (PROFILING)
set(CMAKE_CXX_FLAGS "-pg ${CMAKE_CXX_FLAGS}")
endif ()
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (NOT (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7))

Loading…
Cancel
Save