Browse Source

Workaround for Ubuntu broken LLVM package (llvm-3.5-dev does not have correct cmake files)

cl-refactor
Paweł Bylica 10 years ago
parent
commit
1b490244bf
  1. 16
      CMakeLists.txt
  2. 2
      evmcc/CMakeLists.txt
  3. 2
      libevmjit/CMakeLists.txt

16
CMakeLists.txt

@ -5,9 +5,19 @@ project(evmjit)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# LLVM
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
if(LLVM_DIR) # local LLVM build
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
# TODO: bitwriter is needed only for evmcc
llvm_map_components_to_libnames(LLVM_LIBS core support mcjit x86asmparser x86codegen bitwriter)
else()
# Workaround for Ubuntu broken LLVM package
message(STATUS "Using llvm-3.5-dev package from Ubuntu. If does not work, build LLVM and set -DLLVM_DIR=llvm-build/share/llvm/cmake")
execute_process(COMMAND llvm-config-3.5 --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS)
message(STATUS "LLVM include dirs: ${LLVM_INCLUDE_DIRS}")
set(LLVM_LIBS "-lLLVMBitWriter -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMX86AsmParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMTarget -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMExecutionEngine -lLLVMMC -lLLVMCore -lLLVMSupport -lz -lpthread -lffi -ltinfo -ldl -lm")
endif()
# Boost
find_package(Boost REQUIRED)

2
evmcc/CMakeLists.txt

@ -14,7 +14,5 @@ include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(${TARGET_NAME} ethereum)
target_link_libraries(${TARGET_NAME} ${Boost_PROGRAM_OPTIONS_LIBRARIES})
llvm_map_components_to_libnames(LLVM_LIBS bitwriter)
target_link_libraries(${TARGET_NAME} ${LLVM_LIBS})
install(TARGETS ${TARGET_NAME} DESTINATION bin )

2
libevmjit/CMakeLists.txt

@ -15,9 +15,7 @@ set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "libs")
include_directories(${LLVM_INCLUDE_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
llvm_map_components_to_libnames(LLVM_LIBS core support mcjit x86asmparser x86codegen)
target_link_libraries(${TARGET_NAME} ${LLVM_LIBS})
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")

Loading…
Cancel
Save