Skip to content

Commit

Permalink
Update .travis.yml
Browse files Browse the repository at this point in the history
Use `LLVM_DIR` rather than `CMAKE_PREFIX_PATH` to locate LLVM.  This is more
modern, and avoids the problem of searching for multiple versions as we have
provided an absolute path to the location of the CMake module for LLVM.

Simplify the CMake by unversioning the check for `find_package` and manually
ensuring that we have a new enough LLVM.
  • Loading branch information
compnerd committed Apr 22, 2019
1 parent d555b17 commit 5207eb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -40,7 +40,7 @@ jobs:
- mkdir build && cd build
- CC=gcc-4.8 CXX=g++-4.8 cmake -G Ninja
-DCMAKE_BUILD_TYPE=Debug -DGLOW_WITH_OPENCL=OFF -DGLOW_WITH_CPU=ON
-DCMAKE_PREFIX_PATH=/usr/lib/llvm-7/include/
-DLLVM_DIR=/usr/lib/llvm-7/cmake
-DCMAKE_CXX_FLAGS=-Werror
-DGLOW_USE_COVERAGE=ON
../
Expand Down
17 changes: 3 additions & 14 deletions CMakeLists.txt
Expand Up @@ -105,20 +105,9 @@ endif ()
# Top level setup for external backends
ExternalBackendsInit()

find_package(LLVM 8 CONFIG)
if (NOT LLVM_FOUND)
# Fallback to LLVM 7
find_package(LLVM 7 CONFIG)

if (NOT LLVM_FOUND)
# Fallback to whatever is available.
find_package(LLVM CONFIG)

if (NOT LLVM_FOUND OR LLVM_PACKAGE_VERSION VERSION_LESS "7.0")
message(FATAL_ERROR "LLVM minimum required version is 7. LLVM package version found: ${LLVM_PACKAGE_VERSION}.")
endif()

endif()
find_package(LLVM CONFIG)
if(NOT LLVM_FOUND OR LLVM_VERSION VERSION_LESS 7.0)
message(SEND_ERROR "LLVM >= 7.0 is required to build Glow")
endif()

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
Expand Down

0 comments on commit 5207eb2

Please sign in to comment.