@ -27,12 +27,14 @@ endif()
# L L V M
# L L V M
if ( ${ CMAKE_SYSTEM_NAME } STREQUAL "Linux" AND NOT LLVM_DIR )
if ( ${ CMAKE_SYSTEM_NAME } STREQUAL "Linux" AND NOT LLVM_DIR )
# W o r k a r o u n d f o r U b u n t u b r o k e n L L V M p a c k a g e
# W o r k a r o u n d f o r U b u n t u b r o k e n L L V M p a c k a g e
message ( STATUS "Using llvm-3.7-dev package from Ubuntu. If does not work, build LLVM and set -DLLVM_DIR=llvm-build/share/llvm/cmake" )
# U b u n t u 1 4 . 0 4 r e p l a c e d l l v m 3 . 7 - d e v w i t h l l v m 3 . 8 - d e v i n a n t i c i p a t i o n o f l l v m 3 . 7 r e l e a s e .
execute_process ( COMMAND llvm-config-3.7 --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE )
# W e a r e f o r c e d t o u s e t h e 3 . 8 - d e v p a c k a g e u n t i l l l v m 3 . 7 r e l e a s e . T O D O : F i x w h e n 3 . 7 i s r e l e a s e d .
message ( STATUS "Using llvm-3.8-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.8 --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE )
message ( STATUS "LLVM include dirs: ${LLVM_INCLUDE_DIRS}" )
message ( STATUS "LLVM include dirs: ${LLVM_INCLUDE_DIRS}" )
set ( LLVM_LIBS "-lLLVMipo -lLLVMVectorize -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMProfileData -lLLVMInstCombine -lLLVMInstrumentation -lLLVMTransformUtils -lLLVMipa -lLLVMMCJIT -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMMC -lLLVMCore -lLLVMSupport -lz -lpthread -lffi -ltinfo -ldl -lm" )
set ( LLVM_LIBS "-lLLVMipo -lLLVMVectorize -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMProfileData -lLLVMInstCombine -lLLVMInstrumentation -lLLVMTransformUtils -lLLVMipa -lLLVMMCJIT -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMMC -lLLVMCore -lLLVMSupport -lz -lpthread -lffi -ltinfo -ldl -lm" )
set ( LLVM_DEFINITIONS "-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" )
set ( LLVM_DEFINITIONS "-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" )
link_directories ( /usr/lib/llvm-3.7 /lib )
link_directories ( /usr/lib/llvm-3.8 /lib )
else ( )
else ( )
find_package ( LLVM REQUIRED CONFIG )
find_package ( LLVM REQUIRED CONFIG )
if ( ${ LLVM_VERSION } VERSION_LESS 3.7 )
if ( ${ LLVM_VERSION } VERSION_LESS 3.7 )