diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2020-04-09 20:57:20 +0200 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2020-04-09 23:36:24 +0200 |
commit | 4a37476f9a524d498204ba6242ac358de3041653 (patch) | |
tree | da8750d148da74f64c0327e0d3569c51d395b9e4 /dev-util/clazy | |
parent | dev-util/clazy: Fix build with >=sys-devel/clang-10 (diff) | |
download | gentoo-4a37476f9a524d498204ba6242ac358de3041653.tar.gz gentoo-4a37476f9a524d498204ba6242ac358de3041653.tar.bz2 gentoo-4a37476f9a524d498204ba6242ac358de3041653.zip |
dev-util/clazy: Allow to link against single clang-cpp lib
Bug: https://bugs.gentoo.org/711642
Package-Manager: Portage-2.3.98, Repoman-2.3.22
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'dev-util/clazy')
-rw-r--r-- | dev-util/clazy/clazy-1.6-r1.ebuild | 5 | ||||
-rw-r--r-- | dev-util/clazy/files/clazy-1.6-clang-cpp.patch | 60 |
2 files changed, 64 insertions, 1 deletions
diff --git a/dev-util/clazy/clazy-1.6-r1.ebuild b/dev-util/clazy/clazy-1.6-r1.ebuild index 075782027ed6..2627d7b7becb 100644 --- a/dev-util/clazy/clazy-1.6-r1.ebuild +++ b/dev-util/clazy/clazy-1.6-r1.ebuild @@ -21,7 +21,10 @@ DEPEND="${RDEPEND}" DOCS=( README.md ) -PATCHES=( "${FILESDIR}/${P}-llvm-10.patch" ) +PATCHES=( + "${FILESDIR}/${P}-llvm-10.patch" + "${FILESDIR}/${P}-clang-cpp.patch" +) src_prepare() { cmake_src_prepare diff --git a/dev-util/clazy/files/clazy-1.6-clang-cpp.patch b/dev-util/clazy/files/clazy-1.6-clang-cpp.patch new file mode 100644 index 000000000000..16b9af00ce37 --- /dev/null +++ b/dev-util/clazy/files/clazy-1.6-clang-cpp.patch @@ -0,0 +1,60 @@ +From 0e295e5a926496f5a5d46ea4feb1b285b084f5e0 Mon Sep 17 00:00:00 2001 +From: Christophe Giboudeaux <christophe@krop.fr> +Date: Mon, 11 Nov 2019 10:31:49 +0100 +Subject: Check if clazy should be linked to clang-cpp + +Summary: +According to [1], clang can now provide a single shared library instead of split +ones. + +We have to check if this library exists and link to it if available. + +[1] https://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNotes.html#build-system-changes + +Reviewers: smartins, kde-buildsystem + +Reviewed By: smartins + +Differential Revision: https://phabricator.kde.org/D25163 +--- + CMakeLists.txt | 11 ++++++++--- + cmake/FindClang.cmake | 1 + + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b7301ed..ce1f887 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -125,9 +125,14 @@ macro(link_to_llvm name is_standalone) + if(WIN32) + target_link_libraries(${name} version.lib) + endif() +- target_link_libraries(${name} clangTooling) +- target_link_libraries(${name} clangToolingCore) +- target_link_libraries(${name} ${clang_tooling_refactoring_lib}) ++ # clang >= 9.0 can provide a single shared library instead of split ones ++ if(CLANG_CLANG-CPP_LIB) ++ target_link_libraries(${name} clang-cpp) ++ else() ++ target_link_libraries(${name} clangTooling) ++ target_link_libraries(${name} clangToolingCore) ++ target_link_libraries(${name} ${clang_tooling_refactoring_lib}) ++ endif() + endmacro() + + macro(add_clang_plugin name) +diff --git a/cmake/FindClang.cmake b/cmake/FindClang.cmake +index 542172e..50e0829 100644 +--- a/cmake/FindClang.cmake ++++ b/cmake/FindClang.cmake +@@ -62,6 +62,7 @@ if (LLVM_FOUND AND LLVM_LIBRARY_DIRS) + # note: On Windows there's 'libclang.dll' instead of 'clang.dll' -> search for 'libclang', too + find_library(CLANG_LIBCLANG_LIB NAMES clang libclang HINTS ${LLVM_LIBRARY_DIRS}) # LibClang: high-level C interface + ++ FIND_AND_ADD_CLANG_LIB(clang-cpp) + FIND_AND_ADD_CLANG_LIB(clangFrontend) + FIND_AND_ADD_CLANG_LIB(clangDriver) + FIND_AND_ADD_CLANG_LIB(clangCodeGen) +-- +cgit v1.1 + |