Merge pull request #1667 from Sonicadvance1/check_llvm_version

Adds LLVM version check to cmake.
This commit is contained in:
Ryan Houdek 2014-12-07 12:11:06 -06:00
commit 25feb7d16c
1 changed files with 9 additions and 9 deletions

View File

@ -8,16 +8,16 @@ list(APPEND LLVM_CONFIG_EXECUTABLES "llvm-config-3.4")
foreach(LLVM_CONFIG_NAME ${LLVM_CONFIG_EXECUTABLES}) foreach(LLVM_CONFIG_NAME ${LLVM_CONFIG_EXECUTABLES})
find_program(LLVM_CONFIG_EXE NAMES ${LLVM_CONFIG_NAME}) find_program(LLVM_CONFIG_EXE NAMES ${LLVM_CONFIG_NAME})
if (LLVM_CONFIG_EXE) if (LLVM_CONFIG_EXE)
set(LLVM_FOUND 1)
execute_process(COMMAND ${LLVM_CONFIG_EXE} --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE )
execute_process(COMMAND ${LLVM_CONFIG_EXE} --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE )
#execute_process(COMMAND ${LLVM_CONFIG_EXE} --libfiles Core OUTPUT_VARIABLE LLVM_LIBRARIES
# OUTPUT_STRIP_TRAILING_WHITESPACE )
execute_process(COMMAND ${LLVM_CONFIG_EXE} --version OUTPUT_VARIABLE LLVM_PACKAGE_VERSION execute_process(COMMAND ${LLVM_CONFIG_EXE} --version OUTPUT_VARIABLE LLVM_PACKAGE_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE ) OUTPUT_STRIP_TRAILING_WHITESPACE )
set(LLVM_LIBRARIES "${LLVM_LDFLAGS} -lLLVM-${LLVM_PACKAGE_VERSION}") if (${LLVM_PACKAGE_VERSION} VERSION_GREATER "3.3")
break() set(LLVM_FOUND 1)
execute_process(COMMAND ${LLVM_CONFIG_EXE} --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE )
execute_process(COMMAND ${LLVM_CONFIG_EXE} --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE )
set(LLVM_LIBRARIES "${LLVM_LDFLAGS} -lLLVM-${LLVM_PACKAGE_VERSION}")
break()
endif()
endif() endif()
endforeach() endforeach()