Default to only building LLVM optimisations if the version of LLVM is tested.

main
theraven 13 years ago
parent dbe4ed41fa
commit 4b76f0134d

@ -120,8 +120,23 @@ else ()
add_definitions(-DNO_LEGACY) add_definitions(-DNO_LEGACY)
endif () endif ()
find_package(LLVM) find_package(LLVM QUIET)
set(LLVM_OPTS ${LLVM_FOUND} CACHE BOOL set(DEFAULT_ENABLE_LLVM ${LLVM_FOUND})
if (DEFAULT_ENABLE_LLVM)
exec_program(llvm-config
ARGS --version
OUTPUT_VARIABLE LLVM_VER)
if (LLVM_VER MATCHES ".*svnn")
set(DEFAULT_ENABLE_LLVM FALSE)
message(STATUS "svn version of LLVM found.")
message(STATUS "Disabling LLVM options unless explicitly enabled.")
elseif (LLVM_VER VERSION_GREATER 3.2)
set(DEFAULT_ENABLE_LLVM FALSE)
message(STATUS "Untested version of LLVM (${LLVM_VER}) found.")
message(STATUS "Disabling LLVM options unless explicitly enabled.")
endif()
endif()
set(LLVM_OPTS ${DEFAULT_ENABLE_LLVM} CACHE BOOL
"Build LLVM Objective-C optimisations") "Build LLVM Objective-C optimisations")
if (LLVM_OPTS) if (LLVM_OPTS)
add_subdirectory(opts) add_subdirectory(opts)

Loading…
Cancel
Save