Support LLVM 3.5.

LLVM 3.5 adds a new required component lto.
This commit is contained in:
Kai Nacke
2013-12-13 07:41:22 +01:00
parent aeba90b9f9
commit d4f8092dde
2 changed files with 9 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ endif()
#
find_package(LLVM 3.1 REQUIRED
all-targets bitwriter linker ipo instrumentation backend support tablegen asmparser ${EXTRA_LLVM_MODULES})
all-targets bitwriter linker ipo instrumentation backend support tablegen asmparser lto ${EXTRA_LLVM_MODULES})
math(EXPR LDC_LLVM_VER ${LLVM_VERSION_MAJOR}*100+${LLVM_VERSION_MINOR})
#

View File

@@ -51,6 +51,10 @@ if (WIN32 OR NOT LLVM_CONFIG)
list(REMOVE_ITEM LLVM_FIND_COMPONENTS "all-targets" index)
list(APPEND LLVM_FIND_COMPONENTS ${LLVM_TARGETS_TO_BUILD})
list(REMOVE_ITEM LLVM_FIND_COMPONENTS "backend" index)
if(${LLVM_VERSION_STRING} MATCHES "3.[0-4][A-Za-z]*")
# Versions below 3.5 do not supoort component lto
list(REMOVE_ITEM LLVM_FIND_COMPONENTS "lto" index)
endif()
llvm_map_components_to_libraries(tmplibs ${LLVM_FIND_COMPONENTS})
if(MSVC)
@@ -102,6 +106,10 @@ else()
endmacro()
llvm_set(VERSION_STRING version)
if(${LLVM_VERSION_STRING} MATCHES "3.[0-4][A-Za-z]*")
# Versions below 3.5 do not supoort component lto
list(REMOVE_ITEM LLVM_FIND_COMPONENTS "lto" index)
endif()
if(${LLVM_VERSION_STRING} MATCHES "3.0[A-Za-z]*")
# Version 3.0 does not support component all-targets
llvm_set(TARGETS_TO_BUILD targets-built)