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. 13
      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

13
CMakeLists.txt

@ -15,6 +15,7 @@ function(createDefaultCacheConfig)
set(LANGUAGES OFF CACHE BOOL "Limit build to Serpent/LLL tools") 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(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(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() endfunction()
@ -39,6 +40,14 @@ function(configureProject)
message(FATAL_ERROR "VM tracing requires debug.") message(FATAL_ERROR "VM tracing requires debug.")
endif () endif ()
endif () endif ()
if (EVMJIT)
if (LANGUAGES)
message(FATAL_ERROR "Unset LANGUAGES to build EVMJIT")
else()
add_definitions(-DETH_EVMJIT)
endif()
endif()
endfunction() endfunction()
@ -75,7 +84,7 @@ cmake_policy(SET CMP0015 NEW)
createDefaultCacheConfig() createDefaultCacheConfig()
configureProject() 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". # Default TARGET_PLATFORM to "linux".
@ -158,7 +167,7 @@ if (NOT LANGUAGES)
endif() endif()
endif() endif()
if (EVMCC) if (EVMJIT)
add_subdirectory(libevmjit) add_subdirectory(libevmjit)
add_subdirectory(evmcc) add_subdirectory(evmcc)
endif() endif()

2
eth/CMakeLists.txt

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

7
evmcc/CMakeLists.txt

@ -25,8 +25,6 @@ if ("${TARGET_PLATFORM}" STREQUAL "w64")
target_link_libraries(${EXECUTABLE} iphlpapi) target_link_libraries(${EXECUTABLE} iphlpapi)
target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
elseif (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
else () else ()
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) 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}) include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS}) add_definitions(${LLVM_DEFINITIONS})
llvm_map_components_to_libnames(llvm_libs core support mcjit x86asmparser x86codegen) # llvm_map_components_to_libnames(llvm_libs core support mcjit x86asmparser x86codegen)
target_link_libraries(evmcc ${llvm_libs}) # target_link_libraries(evmcc ${llvm_libs})
# end of LLVM specific commands # end of LLVM specific commands
install( TARGETS ${EXECUTABLE} DESTINATION bin ) install( TARGETS ${EXECUTABLE} DESTINATION bin )
cmake_policy(SET CMP0015 NEW) cmake_policy(SET CMP0015 NEW)

2
exp/CMakeLists.txt

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

7
libevmjit/CMakeLists.txt

@ -20,6 +20,7 @@ target_link_libraries(${EXECUTABLE} ethcore)
target_link_libraries(${EXECUTABLE} evm) target_link_libraries(${EXECUTABLE} evm)
target_link_libraries(${EXECUTABLE} evmface) target_link_libraries(${EXECUTABLE} evmface)
if ("${TARGET_PLATFORM}" STREQUAL "w64") if ("${TARGET_PLATFORM}" STREQUAL "w64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
target_link_libraries(${EXECUTABLE} gcc) target_link_libraries(${EXECUTABLE} gcc)
@ -30,14 +31,12 @@ if ("${TARGET_PLATFORM}" STREQUAL "w64")
target_link_libraries(${EXECUTABLE} iphlpapi) target_link_libraries(${EXECUTABLE} iphlpapi)
target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
elseif (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
else () else ()
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT})
endif () endif ()
# LLVM specific commands # LLVM specific config
find_package(LLVM REQUIRED 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) llvm_map_components_to_libnames(llvm_libs core support mcjit x86asmparser x86codegen)
target_link_libraries(evmjit ${llvm_libs}) 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}) target_link_libraries(${EXECUTABLE} ${JSONRPC_LS})
endif() endif()
if(EVMCC) if(EVMJIT)
target_link_libraries(${EXECUTABLE} evmjit) target_link_libraries(${EXECUTABLE} evmjit)
endif() endif()

9
test/CMakeLists.txt

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

Loading…
Cancel
Save