From f349ba33166695b6a4d284a753718d37bced4345 Mon Sep 17 00:00:00 2001 From: Jake Hillion Date: Thu, 15 Aug 2024 16:26:21 +0100 Subject: [PATCH] support and test LLVM versions 16 and 17 --- .github/workflows/ci.yml | 2 +- .github/workflows/test-report.yml | 2 +- CMakeLists.txt | 8 ++++++-- flake.nix | 4 +++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a12ac8..2d74a46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: runs-on: 16-core-ubuntu strategy: matrix: - llvm_version: [15] + llvm_version: [15, 16, 17] steps: - uses: actions/checkout@v4.1.7 - uses: cachix/install-nix-action@v27 diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml index 91524b1..1a3fa45 100644 --- a/.github/workflows/test-report.yml +++ b/.github/workflows/test-report.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: dorny/test-reporter@v1 with: - artifact: test-results-15 + artifact: test-results-17 name: CTest Tests path: results.xml reporter: jest-junit diff --git a/CMakeLists.txt b/CMakeLists.txt index 426b68c..ecabd38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,11 +219,15 @@ find_package(Boost REQUIRED COMPONENTS ) message(STATUS "Linking Boost libraries: ${Boost_LIBRARIES}") -### LLVM and Clang - Preferring Clang 15 -find_package(LLVM 15 REQUIRED CONFIG) +### LLVM and Clang +find_package(LLVM REQUIRED CONFIG) message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") +if((${LLVM_VERSION_MAJOR} VERSION_LESS 15) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER 17)) + message(SEND_ERROR "Object Introspection currently requires an LLVM version between 15 and 17!") +endif() + find_package(Clang REQUIRED CONFIG) message(STATUS "Found Clang ${LLVM_PACKAGE_VERSION}") message(STATUS "Using ClangConfig.cmake in: ${Clang_DIR}") diff --git a/flake.nix b/flake.nix index f925621..c66699e 100644 --- a/flake.nix +++ b/flake.nix @@ -99,9 +99,11 @@ in { packages = rec { - default = oid-llvm15; + default = oid-llvm17; oid-llvm15 = mkOidPackage pkgs.llvmPackages_15; + oid-llvm16 = mkOidPackage pkgs.llvmPackages_16; + oid-llvm17 = mkOidPackage pkgs.llvmPackages_17; }; apps.default = {