Skip to content

Commit

Permalink
Update to LLVM 18
Browse files Browse the repository at this point in the history
  • Loading branch information
banach-space committed May 4, 2024
1 parent 4c2d487 commit 5ad0718
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 61 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/x86-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ jobs:
- name: Install Dependencies
run: |
brew update
brew install llvm@17
brew install llvm
brew install lit
- name: Build HelloWorld
run: |
cd HelloWorld
mkdir build && cd build
cmake -DLT_LLVM_INSTALL_DIR="/opt/homebrew/opt/llvm@17/" -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../
cmake -DLT_LLVM_INSTALL_DIR="/opt/homebrew/opt/llvm/" -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../
make -j2
- name: Build llvm-tutor + run tests
run: |
cd $GITHUB_WORKSPACE
mkdir build && cd build
cmake -DLT_LLVM_INSTALL_DIR="/opt/homebrew/opt/llvm@17/" -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../
cmake -DLT_LLVM_INSTALL_DIR="/opt/homebrew/opt/llvm/" -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../
make -j2
lit test/
8 changes: 4 additions & 4 deletions .github/workflows/x86-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
CXX: ${{ matrix.compiler.CXX }}
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main"
sudo apt-get update
sudo apt-get install -y llvm-17 llvm-17-dev llvm-17-tools clang-17
sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools clang-18
sudo apt-get install python3-setuptools
sudo pip3 install lit
- name: Build HelloWorld
Expand All @@ -37,12 +37,12 @@ jobs:
run: |
cd HelloWorld
mkdir build && cd build
cmake -DLT_LLVM_INSTALL_DIR="/usr/lib/llvm-17/" -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../
cmake -DLT_LLVM_INSTALL_DIR="/usr/lib/llvm-18/" -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../
make -j2
- name: Build llvm-tutor + run tests
run: |
cd $GITHUB_WORKSPACE
mkdir build && cd build
cmake -DLT_LLVM_INSTALL_DIR="/usr/lib/llvm-17/" -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../
cmake -DLT_LLVM_INSTALL_DIR="/usr/lib/llvm-18/" -DCMAKE_BUILD_TYPE=${{ matrix.type }} ../
make -j2
lit -va test/
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ list(APPEND CMAKE_PREFIX_PATH "${LT_LLVM_INSTALL_DIR}/lib/cmake/llvm/")
find_package(LLVM CONFIG)

# We defer the version checking to this statement
if("${LLVM_VERSION_MAJOR}" VERSION_LESS 17)
message(FATAL_ERROR "Found LLVM ${LLVM_VERSION_MAJOR}, but need LLVM 17 or above")
if("${LLVM_VERSION_MAJOR}" VERSION_LESS 18)
message(FATAL_ERROR "Found LLVM ${LLVM_VERSION_MAJOR}, but need LLVM 18 or above")
endif()

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
Expand Down
4 changes: 2 additions & 2 deletions HelloWorld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ set(LT_LLVM_INSTALL_DIR "" CACHE PATH "LLVM installation directory")
list(APPEND CMAKE_PREFIX_PATH "${LT_LLVM_INSTALL_DIR}/lib/cmake/llvm/")

find_package(LLVM CONFIG)
if("${LLVM_VERSION_MAJOR}" VERSION_LESS 17)
message(FATAL_ERROR "Found LLVM ${LLVM_VERSION_MAJOR}, but need LLVM 17 or above")
if("${LLVM_VERSION_MAJOR}" VERSION_LESS 18)
message(FATAL_ERROR "Found LLVM ${LLVM_VERSION_MAJOR}, but need LLVM 18 or above")
endif()

# HelloWorld includes headers from LLVM - update the include paths accordingly
Expand Down
Loading

0 comments on commit 5ad0718

Please sign in to comment.