Skip to content

Commit

Permalink
cppinsights: patch for LLVM 18
Browse files Browse the repository at this point in the history
  • Loading branch information
fxcoudert committed Apr 21, 2024
1 parent 7740d21 commit b2cf50d
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions Formula/c/cppinsights.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class Cppinsights < Formula
cause "Requires C++20"
end

# Patch from https://github.com/andreasfertig/cppinsights/pull/622
# Support for LLVM 18, remove in next version
patch :DATA

def install
ENV.llvm_clang if ENV.compiler == :clang && DevelopmentTools.clang_build_version <= 1500

Expand All @@ -40,3 +44,50 @@ def install
assert_match "{2, 3, 4, 0, 0}", shell_output("#{bin}/insights ./test.cpp")
end
end
__END__
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 31341709..8b7430db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,4 @@
-cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
-# 3.8* is required because of C++17 support
+cmake_minimum_required(VERSION 3.20 FATAL_ERROR)

# For better control enable MSVC_RUNTIME_LIBRARY target property
# see https://cmake.org/cmake/help/latest/policy/CMP0091.html
@@ -33,7 +32,7 @@ option(INSIGHTS_STATIC "Use static linking" Off)

set(INSIGHTS_LLVM_CONFIG "llvm-config" CACHE STRING "LLVM config executable to use")

-set(INSIGHTS_MIN_LLVM_MAJOR_VERSION 17)
+set(INSIGHTS_MIN_LLVM_MAJOR_VERSION 18)
set(INSIGHTS_MIN_LLVM_VERSION ${INSIGHTS_MIN_LLVM_MAJOR_VERSION}.0)

if(NOT DEFINED LLVM_VERSION_MAJOR) # used when build inside the clang tool/extra folder
@@ -372,6 +371,17 @@ if (BUILD_INSIGHTS_OUTSIDE_LLVM)
# additional libs required when building insights outside llvm
set(ADDITIONAL_LIBS
${LLVM_LDFLAGS}
+ )
+
+ if(${LLVM_PACKAGE_VERSION_PLAIN} VERSION_GREATER_EQUAL "18.0.0")
+ set(ADDITIONAL_LIBS
+ ${ADDITIONAL_LIBS}
+ clangAPINotes
+ )
+ endif()
+
+ set(ADDITIONAL_LIBS
+ ${ADDITIONAL_LIBS}
clangFrontend
clangDriver
clangSerialization
@@ -768,6 +778,7 @@ message(STATUS "[ Build summary ]")
message(STATUS "CMAKE_GENERATOR : ${CMAKE_GENERATOR}")
message(STATUS "CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}")
message(STATUS "CMAKE_LINKER : ${CMAKE_LINKER}")
+message(STATUS "CMAKE_OSX_ARCHITECTURES : ${CMAKE_OSX_ARCHITECTURES}")
message(STATUS "Compiler ID : ${CMAKE_CXX_COMPILER_ID}")
message(STATUS "Compiler version : ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "Compiler path : ${CMAKE_CXX_COMPILER}")

0 comments on commit b2cf50d

Please sign in to comment.