summaryrefslogtreecommitdiff
path: root/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/clang-common/clang-common-15.0.2.9999.ebuild')
-rw-r--r--sys-devel/clang-common/clang-common-15.0.2.9999.ebuild34
1 files changed, 31 insertions, 3 deletions
diff --git a/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild b/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild
index e318815568c5..993dddec4bf9 100644
--- a/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild
+++ b/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild
@@ -11,7 +11,10 @@ HOMEPAGE="https://llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
SLOT="0"
KEYWORDS=""
-IUSE="default-compiler-rt default-libcxx default-lld llvm-libunwind"
+IUSE="
+ default-compiler-rt default-libcxx default-lld llvm-libunwind
+ stricter
+"
PDEPEND="
sys-devel/clang:*
@@ -75,12 +78,37 @@ src_install() {
# It is used to specify the selected GCC installation.
EOF
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ EOF
+
+ if use stricter; then
+ newins - gentoo-stricter.cfg <<-EOF
+ # This file increases the strictness of older clang versions
+ # to match the newest upstream version.
+
+ # clang-16 defaults
+ -Werror=implicit-function-declaration
+ -Werror=implicit-int
+ -Werror=incompatible-function-pointer-types
+
+ # constructs banned by C2x
+ -Werror=strict-prototypes
+ -Werror=deprecated-non-prototype
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ @gentoo-stricter.cfg
+ EOF
+ fi
+
local tool
for tool in clang{,++,-cpp}; do
newins - "${tool}.cfg" <<-EOF
# This configuration file is used by ${tool} driver.
- @gentoo-runtimes.cfg
- @gentoo-gcc-install.cfg
+ @gentoo-common.cfg
EOF
done
}