mirror of
https://github.com/yann64/haikuports.git
synced 2026-03-19 01:46:00 +01:00
ccls, revbump, switch to clang 20 (#12491)
This commit is contained in:
@@ -17,14 +17,17 @@ hierarchy
|
||||
HOMEPAGE="https://github.com/MaskRay/ccls"
|
||||
COPYRIGHT="2017-2024 ccls Authors"
|
||||
LICENSE="Apache v2"
|
||||
REVISION="1"
|
||||
REVISION="2"
|
||||
SOURCE_URI="https://github.com/MaskRay/ccls/archive/tags/$portVersion.tar.gz"
|
||||
SOURCE_DIR="ccls-tags-$portVersion"
|
||||
CHECKSUM_SHA256="ef82a5af82f4694b152822d69560d7d881f4f15e4433022a0d985d409a22c173"
|
||||
PATCHES="addapt_llvm20.patch"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
clangVer="20"
|
||||
|
||||
PROVIDES="
|
||||
ccls$secondaryArchSuffix = $portVersion
|
||||
cmd:ccls = $portVersion
|
||||
@@ -38,8 +41,9 @@ REQUIRES="
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libclang_cpp$secondaryArchSuffix >= 19
|
||||
devel:libLLVM$secondaryArchSuffix >= 19
|
||||
devel:libclang_cpp$secondaryArchSuffix >= $clangVer
|
||||
devel:libLLVM$secondaryArchSuffix >= $clangVer
|
||||
devel:libomp$secondaryArchSuffix
|
||||
devel:libz$secondaryArchSuffix
|
||||
devel:librapidjson$secondaryArchSuffix
|
||||
"
|
||||
@@ -52,7 +56,8 @@ BUILD_PREREQUIRES="
|
||||
|
||||
BUILD()
|
||||
{
|
||||
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release .
|
||||
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release . \
|
||||
-DCCLS_VERSION=$portVersion
|
||||
make -C build $jobArgs
|
||||
}
|
||||
|
||||
|
||||
78
dev-util/ccls/patches/addapt_llvm20.patch
Normal file
78
dev-util/ccls/patches/addapt_llvm20.patch
Normal file
@@ -0,0 +1,78 @@
|
||||
From 4331c8958698d42933bf4e132f8a7d61f3cedb8c Mon Sep 17 00:00:00 2001
|
||||
From: Fangrui Song <i@maskray.me>
|
||||
Date: Sat, 23 Nov 2024 18:25:48 -0800
|
||||
Subject: [PATCH] Adapt llvmorg-20-init-12964-gdf9a14d7bbf1: createDiagnostics
|
||||
|
||||
---
|
||||
src/clang_tu.cc | 8 +++++---
|
||||
src/indexer.cc | 6 +++++-
|
||||
src/sema_manager.cc | 13 ++++++++++---
|
||||
3 files changed, 20 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/clang_tu.cc b/src/clang_tu.cc
|
||||
index 32be1733f..54e04ef0e 100644
|
||||
--- a/src/clang_tu.cc
|
||||
+++ b/src/clang_tu.cc
|
||||
@@ -124,9 +124,11 @@ buildCompilerInvocation(const std::string &main, std::vector<const char *> args,
|
||||
args.insert(args.begin() + 1, std::begin(arr), std::end(arr));
|
||||
}
|
||||
|
||||
- IntrusiveRefCntPtr<DiagnosticsEngine> diags(
|
||||
- CompilerInstance::createDiagnostics(new DiagnosticOptions,
|
||||
- new IgnoringDiagConsumer, true));
|
||||
+ IntrusiveRefCntPtr<DiagnosticsEngine> diags(CompilerInstance::createDiagnostics(
|
||||
+#if LLVM_VERSION_MAJOR >= 20
|
||||
+ *vfs,
|
||||
+#endif
|
||||
+ new DiagnosticOptions, new IgnoringDiagConsumer, true));
|
||||
#if LLVM_VERSION_MAJOR < 12 // llvmorg-12-init-5498-g257b29715bb
|
||||
driver::Driver d(args[0], llvm::sys::getDefaultTargetTriple(), *diags, vfs);
|
||||
#else
|
||||
diff --git a/src/indexer.cc b/src/indexer.cc
|
||||
index b81f1d9f6..dff4ae2d8 100644
|
||||
--- a/src/indexer.cc
|
||||
+++ b/src/indexer.cc
|
||||
@@ -1312,7 +1312,11 @@ index(SemaManager *manager, WorkingFiles *wfiles, VFS *vfs,
|
||||
IndexDiags dc;
|
||||
auto clang = std::make_unique<CompilerInstance>(pch);
|
||||
clang->setInvocation(std::move(ci));
|
||||
- clang->createDiagnostics(&dc, false);
|
||||
+ clang->createDiagnostics(
|
||||
+#if LLVM_VERSION_MAJOR >= 20
|
||||
+ *fs,
|
||||
+#endif
|
||||
+ &dc, false);
|
||||
clang->getDiagnostics().setIgnoreAllWarnings(true);
|
||||
clang->setTarget(TargetInfo::CreateTargetInfo(
|
||||
clang->getDiagnostics(), clang->getInvocation().TargetOpts));
|
||||
diff --git a/src/sema_manager.cc b/src/sema_manager.cc
|
||||
index bf806e47d..59aaed021 100644
|
||||
--- a/src/sema_manager.cc
|
||||
+++ b/src/sema_manager.cc
|
||||
@@ -288,7 +288,11 @@ buildCompilerInstance(Session &session, std::unique_ptr<CompilerInvocation> ci,
|
||||
|
||||
auto clang = std::make_unique<CompilerInstance>(session.pch);
|
||||
clang->setInvocation(std::move(ci));
|
||||
- clang->createDiagnostics(&dc, false);
|
||||
+ clang->createDiagnostics(
|
||||
+#if LLVM_VERSION_MAJOR >= 20
|
||||
+ *fs,
|
||||
+#endif
|
||||
+ &dc, false);
|
||||
clang->setTarget(TargetInfo::CreateTargetInfo(
|
||||
clang->getDiagnostics(), clang->getInvocation().TargetOpts));
|
||||
if (!clang->hasTarget())
|
||||
@@ -368,8 +372,11 @@ void buildPreamble(Session &session, CompilerInvocation &ci,
|
||||
#endif
|
||||
|
||||
StoreDiags dc(task.path);
|
||||
- IntrusiveRefCntPtr<DiagnosticsEngine> de =
|
||||
- CompilerInstance::createDiagnostics(&ci.getDiagnosticOpts(), &dc, false);
|
||||
+ IntrusiveRefCntPtr<DiagnosticsEngine> de = CompilerInstance::createDiagnostics(
|
||||
+#if LLVM_VERSION_MAJOR >= 20
|
||||
+ *fs,
|
||||
+#endif
|
||||
+ &ci.getDiagnosticOpts(), &dc, false);
|
||||
if (oldP) {
|
||||
std::lock_guard lock(session.wfiles->mutex);
|
||||
for (auto &include : oldP->includes)
|
||||
Reference in New Issue
Block a user