Browse Source

Nicer build options.

cl-refactor
Gav Wood 10 years ago
parent
commit
4120e83bb6
  1. 187
      CMakeLists.txt
  2. 2
      test/CMakeLists.txt
  3. 2
      test/natspec.cpp

187
CMakeLists.txt

@ -15,23 +15,26 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Normally, set(...CACHE...) creates cache variables, but does not modify them.
function(createDefaultCacheConfig)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(SERPENT_DEFAULT OFF)
set(DECENT_PLATFORM OFF)
else ()
set(SERPENT_DEFAULT ON)
set(DECENT_PLATFORM ON)
endif ()
set(HEADLESS OFF CACHE BOOL "Do not compile GUI (AlethZero)")
set(VMTRACE OFF CACHE BOOL "VM tracing and run-time checks (useful for cross-implementation VM debugging)")
set(PARANOIA OFF CACHE BOOL "Additional run-time checks")
set(JSONRPC ON CACHE BOOL "Build with jsonprc. default on")
set(EVMJIT OFF CACHE BOOL "Build a just-in-time compiler for EVM code (requires LLVM)")
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.")
set(JUSTTESTS OFF CACHE BOOL "Build only for tests.")
set(SOLIDITY ON CACHE BOOL "Build the Solidity language components (required unless HEADLESS)")
set(SERPENT ${SERPENT_DEFAULT} CACHE BOOL "Build the Serpent language components (required unless HEADLESS)")
set(SDK ON CACHE BOOL "Build the SDK components")
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")
set(BUNDLE "full" CACHE STRING "Predefined bundle of software to build.")
set(SOLIDITY ON CACHE BOOL "Build the Solidity language components")
set(SERPENT ${DECENT_PLATFORM} CACHE BOOL "Build the Serpent language components")
set(TOOLS ON CACHE BOOL "Build the tools components")
set(NCURSES ${DECENT_PLATFORM} CACHE BOOL "Build the NCurses components")
set(GUI ON CACHE BOOL "Build GUI components (AlethZero, Mix)")
set(TESTS ON CACHE BOOL "Build the tests.")
set(EVMJIT OFF CACHE BOOL "Build just-in-time compiler for EVM code (requires LLVM)")
set(ETHASHCL OFF CACHE BOOL "Build in support for GPU mining via OpenCL")
endfunction()
@ -61,8 +64,8 @@ function(configureProject)
add_definitions(-DETH_SOLIDITY)
endif()
if (HEADLESS OR JUSTTESTS)
add_definitions(-DETH_HEADLESS)
if (GUI)
add_definitions(-DETH_GUI)
endif()
endfunction()
@ -153,11 +156,6 @@ if (VMTRACE)
else ()
set(VMTRACE OFF)
endif ()
if (ETHASHCL)
set(ETHASHCL ON)
else ()
set(ETHASHCL OFF)
endif()
if (EVMJIT)
set(EVMJIT ON)
else ()
@ -168,6 +166,23 @@ if (FATDB)
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 ()
set(PROFILING OFF)
endif ()
if (SOLIDITY)
set(SOLIDITY ON)
else ()
@ -178,34 +193,66 @@ if (SERPENT)
else ()
set(SERPENT OFF)
endif()
if (HEADLESS)
set(HEADLESS ON)
if (GUI)
set(GUI ON)
else ()
set(HEADLESS OFF)
set(GUI OFF)
endif ()
if (JUSTTESTS)
set(JUSTTESTS ON)
if (TESTS)
set(TESTS ON)
else ()
set(JUSTTESTS OFF)
set(TESTS OFF)
endif ()
if (JSONRPC)
set(JSONRPC ON)
if (TOOLS)
set(TOOLS ON)
else ()
set(JSONRPC OFF)
set(TOOLS OFF)
endif ()
if (USENPM)
set(USENPM ON)
if (ETHASHCL)
set(ETHASHCL ON)
else ()
set(USENPM OFF)
endif ()
if (PROFILING)
set(PROFILING ON)
set(ETHASHCL OFF)
endif()
if (NCURSES)
set(NCURSES ON)
else ()
set(PROFILING OFF)
set(NCURSES OFF)
endif ()
if (BUNDLE STREQUAL "minimal")
set(SERPENT OFF)
set(SOLIDITY OFF)
set(USENPM OFF)
set(GUI OFF)
set(TESTS OFF)
set(TOOLS ON)
elseif (BUNDLE STREQUAL "full")
set(SERPENT ON)
set(SOLIDITY ON)
set(USENPM ON)
set(GUI ON)
set(TESTS ON)
set(TOOLS ON)
set(FATDB ON)
elseif (BUNDLE STREQUAL "tests")
set(SERPENT ON)
set(SOLIDITY ON)
set(USENPM OFF)
set(GUI OFF)
set(TESTS ON)
set(TOOLS OFF)
set(FATDB ON)
elseif (BUNDLE STREQUAL "user")
set(SERPENT OFF)
set(SOLIDITY OFF)
set(USENPM OFF)
set(GUI ON)
set(TESTS OFF)
set(TOOLS ON)
endif ()
# Default CMAKE_BUILD_TYPE to "Release".
set(CMAKE_BUILD_TYPE CACHE STRING "Relase")
set(CMAKE_BUILD_TYPE CACHE STRING "Release")
if ("x${CMAKE_BUILD_TYPE}" STREQUAL "x")
set(CMAKE_BUILD_TYPE "Release")
endif ()
@ -220,20 +267,23 @@ message("-----------------------------------------------------------------------
message("-- CMake Version ${CMAKE_VERSION}")
message("-- Build type CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}")
message("-- Target platform TARGET_PLATFORM ${TARGET_PLATFORM}")
message("-- Build bundle BUNDLE ${BUNDLE}")
message("------------------------------------------------------------------------ features")
message("-- Chromium support [auto-detected] ${ETH_HAVE_WEBENGINE}")
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("-- JSON-RPC support JSONRPC ${JSONRPC}")
message("-- Javascript source building USENPM ${USENPM}")
message("------------------------------------------------------------------------ components")
message("-- Build GUI components GUI ${GUI}")
message("-- Build NCurses components NCURSES ${NCURSES}")
message("-- Build tests TESTS ${TESTS}")
message("-- Build Solidity language components SOLIDITY ${SOLIDITY}")
message("-- Build Serpent language components SERPENT ${SERPENT}")
message("-- Build SDK components SDK ${SDK}")
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("-- Build OpenCL components (experimental!) ETHASHCL ${ETHASHCL}")
message("-- Build LLVM-based JIT EVM (experimental!) EVMJIT ${EVMJIT}")
message("------------------------------------------------------------------------")
message("")
@ -261,18 +311,16 @@ add_subdirectory(libdevcore)
add_subdirectory(libevmcore)
add_subdirectory(liblll)
if (SDK)
if (SERPENT)
add_subdirectory(libserpent)
add_subdirectory(sc)
endif ()
if (SERPENT)
add_subdirectory(libserpent)
add_subdirectory(sc)
endif ()
if (SOLIDITY)
add_subdirectory(libsolidity)
endif ()
if (SOLIDITY)
add_subdirectory(libsolidity)
endif ()
if (NOT JUSTTESTS)
if (TOOLS)
add_subdirectory(lllc)
if (SOLIDITY)
add_subdirectory(solc)
@ -297,12 +345,14 @@ endif ()
add_subdirectory(libethcore)
add_subdirectory(libevm)
add_subdirectory(libethereum)
add_subdirectory(libwebthree)
add_subdirectory(libtestutils)
add_subdirectory(test)
if (NOT JUSTTESTS)
if (TESTS)
add_subdirectory(libtestutils)
add_subdirectory(test)
endif ()
if (TOOLS)
add_subdirectory(rlp)
add_subdirectory(abi)
@ -312,27 +362,26 @@ if (NOT JUSTTESTS)
add_subdirectory(exp)
endif ()
# TODO check msvc
if(NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC"))
add_subdirectory(neth)
endif ()
if (NOT HEADLESS)
endif()
add_subdirectory(libnatspec)
add_subdirectory(libjsqrc)
if (NCURSES)
add_subdirectory(neth)
endif ()
if (ETH_HAVE_WEBENGINE)
add_subdirectory(alethzero)
# add_subdirectory(third) // reenable once not qtwebkit.
endif()
if (GUI)
if (SDK)
add_subdirectory(mix)
endif ()
add_subdirectory(libnatspec)
add_subdirectory(libjsqrc)
if (ETH_HAVE_WEBENGINE)
add_subdirectory(alethzero)
# add_subdirectory(third) // reenable once not qtwebkit.
endif()
if (SOLIDITY)
add_subdirectory(mix)
endif ()
endif()
#unset(TARGET_PLATFORM CACHE)

2
test/CMakeLists.txt

@ -48,7 +48,7 @@ if (SOLIDITY)
target_link_libraries(testeth solidity)
endif ()
target_link_libraries(testeth testutils)
if (NOT HEADLESS AND NOT JUSTTESTS)
if (GUI AND NOT JUSTTESTS)
target_link_libraries(testeth webthree)
target_link_libraries(testeth natspec)
endif()

2
test/natspec.cpp

@ -19,7 +19,7 @@
* @date 2015
*/
#if !ETH_HEADLESS
#if ETH_GUI
#include <boost/test/unit_test.hpp>
#include <libdevcore/Log.h>

Loading…
Cancel
Save