Browse Source

CMakeLists updated, should now build without LLVM when EVMJIT is not enabled [#81588646]

cl-refactor
artur-zawlocki 10 years ago
parent
commit
2503741803
  1. 17
      CMakeLists.txt
  2. 2
      eth/CMakeLists.txt
  3. 7
      evmcc/CMakeLists.txt
  4. 2
      exp/CMakeLists.txt
  5. 7
      libevmjit/CMakeLists.txt
  6. 2
      neth/CMakeLists.txt
  7. 9
      test/CMakeLists.txt

17
CMakeLists.txt

@ -15,6 +15,7 @@ function(createDefaultCacheConfig)
set(LANGUAGES OFF CACHE BOOL "Limit build to Serpent/LLL tools")
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(EVMJIT OFF CACHE BOOL "Build a just-in-time compiler for EVM code (requires LLVM)")
endfunction()
@ -39,6 +40,14 @@ function(configureProject)
message(FATAL_ERROR "VM tracing requires debug.")
endif ()
endif ()
if (EVMJIT)
if (LANGUAGES)
message(FATAL_ERROR "Unset LANGUAGES to build EVMJIT")
else()
add_definitions(-DETH_EVMJIT)
endif()
endif()
endfunction()
@ -75,7 +84,7 @@ cmake_policy(SET CMP0015 NEW)
createDefaultCacheConfig()
configureProject()
message("-- LANGUAGES: ${LANGUAGES}; VMTRACE: ${VMTRACE}; PARANOIA: ${PARANOIA}; HEADLESS: ${HEADLESS}")
message("-- LANGUAGES: ${LANGUAGES}; VMTRACE: ${VMTRACE}; PARANOIA: ${PARANOIA}; HEADLESS: ${HEADLESS}; EVMJIT: ${EVMJIT}")
# Default TARGET_PLATFORM to "linux".
@ -158,9 +167,9 @@ if (NOT LANGUAGES)
endif()
endif()
if (EVMCC)
add_subdirectory(libevmjit)
add_subdirectory(evmcc)
if (EVMJIT)
add_subdirectory(libevmjit)
add_subdirectory(evmcc)
endif()

2
eth/CMakeLists.txt

@ -15,7 +15,7 @@ target_link_libraries(${EXECUTABLE} webthree)
target_link_libraries(${EXECUTABLE} secp256k1)
target_link_libraries(${EXECUTABLE} gmp)
if(EVMCC)
if(EVMJIT)
target_link_libraries(${EXECUTABLE} evmjit)
endif()

7
evmcc/CMakeLists.txt

@ -25,8 +25,6 @@ if ("${TARGET_PLATFORM}" STREQUAL "w64")
target_link_libraries(${EXECUTABLE} iphlpapi)
target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
elseif (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
else ()
find_package(Threads REQUIRED)
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT})
@ -42,13 +40,12 @@ message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
llvm_map_components_to_libnames(llvm_libs core support mcjit x86asmparser x86codegen)
target_link_libraries(evmcc ${llvm_libs})
# llvm_map_components_to_libnames(llvm_libs core support mcjit x86asmparser x86codegen)
# target_link_libraries(evmcc ${llvm_libs})
# end of LLVM specific commands
install( TARGETS ${EXECUTABLE} DESTINATION bin )
cmake_policy(SET CMP0015 NEW)

2
exp/CMakeLists.txt

@ -17,7 +17,7 @@ target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS})
endif()
target_link_libraries(${EXECUTABLE} ${LEVELDB_LS})
if(EVMCC)
if(EVMJIT)
target_link_libraries(${EXECUTABLE} evmjit)
endif()

7
libevmjit/CMakeLists.txt

@ -20,6 +20,7 @@ target_link_libraries(${EXECUTABLE} ethcore)
target_link_libraries(${EXECUTABLE} evm)
target_link_libraries(${EXECUTABLE} evmface)
if ("${TARGET_PLATFORM}" STREQUAL "w64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
target_link_libraries(${EXECUTABLE} gcc)
@ -30,14 +31,12 @@ if ("${TARGET_PLATFORM}" STREQUAL "w64")
target_link_libraries(${EXECUTABLE} iphlpapi)
target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
elseif (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
else ()
find_package(Threads REQUIRED)
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT})
endif ()
# LLVM specific commands
# LLVM specific config
find_package(LLVM REQUIRED CONFIG)
@ -50,7 +49,7 @@ add_definitions(${LLVM_DEFINITIONS})
llvm_map_components_to_libnames(llvm_libs core support mcjit x86asmparser x86codegen)
target_link_libraries(evmjit ${llvm_libs})
# end of LLVM specific commands
# end of LLVM specific config

2
neth/CMakeLists.txt

@ -24,7 +24,7 @@ if(JSONRPC_LS)
target_link_libraries(${EXECUTABLE} ${JSONRPC_LS})
endif()
if(EVMCC)
if(EVMJIT)
target_link_libraries(${EXECUTABLE} evmjit)
endif()

9
test/CMakeLists.txt

@ -7,7 +7,6 @@ include_directories(..)
link_directories(../libethcore)
link_directories(../libethereum)
link_directories(../libevm)
link_directories(../libevmjit)
file(GLOB HEADERS "*.h")
add_executable(testeth ${SRC_LIST} ${HEADERS})
@ -20,13 +19,17 @@ target_link_libraries(testeth gmp)
target_link_libraries(testeth solidity)
target_link_libraries(testeth ${CRYPTOPP_LS})
target_link_libraries(testeth evm)
target_link_libraries(testeth evmjit)
if (EVMJIT)
target_link_libraries(testeth evmjit)
endif()
target_link_libraries(createRandomTest ethereum)
target_link_libraries(createRandomTest ethcore)
target_link_libraries(createRandomTest boost_chrono)
target_link_libraries(createRandomTest boost_unit_test_framework)
target_link_libraries(createRandomTest evmjit)
if (EVMJIT)
target_link_libraries(createRandomTest evmjit)
endif()
if ("${TARGET_PLATFORM}" STREQUAL "w64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")

Loading…
Cancel
Save