aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorkoobs <koobs@FreeBSD.org>2016-02-21 23:05:22 +0800
committerkoobs <koobs@FreeBSD.org>2016-02-21 23:05:22 +0800
commit57f1a635adcbef7ed99a8f1e4661edd57af803dc (patch)
treee6574c106d236e8159f2adb70d6f1248e84198a4 /devel
parent84df51c40b16d55a6daeb41e86c15462e2916f1b (diff)
downloadfreebsd-ports-gnome-57f1a635adcbef7ed99a8f1e4661edd57af803dc.tar.gz
freebsd-ports-gnome-57f1a635adcbef7ed99a8f1e4661edd57af803dc.tar.zst
freebsd-ports-gnome-57f1a635adcbef7ed99a8f1e4661edd57af803dc.zip
[NEW] devel/include-what-you-use: Clang tool to analyze #includes in C and C++ sources
"Include what you use" means this: for every symbol (type, function, variable, or macro) that you use in foo.cc (or foo.cpp), either foo.cc or foo.h should include a .h file that exports the declaration of that symbol. (Similarly, for foo_test.cc, either foo_test.cc or foo.h should do the including.) Obviously symbols defined in foo.cc itself are excluded from this requirement. This puts us in a state where every file includes the headers it needs to declare the symbols that it uses. When every file includes what it uses, then it is possible to edit any file and remove unused headers, without fear of accidentally breaking the upwards dependencies of that file. It also becomes easy to automatically track and update dependencies in the source code. WWW: http://include-what-you-use.org
Diffstat (limited to 'devel')
-rw-r--r--devel/Makefile1
-rw-r--r--devel/include-what-you-use/Makefile29
-rw-r--r--devel/include-what-you-use/distinfo2
-rw-r--r--devel/include-what-you-use/pkg-descr15
4 files changed, 47 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index c5096869f15f..c0f1f408ad43 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1034,6 +1034,7 @@
SUBDIR += idutils
SUBDIR += ifd-test
SUBDIR += imake
+ SUBDIR += include-what-you-use
SUBDIR += inilib
SUBDIR += iniparser
SUBDIR += initutil
diff --git a/devel/include-what-you-use/Makefile b/devel/include-what-you-use/Makefile
new file mode 100644
index 000000000000..147ba11f1ae9
--- /dev/null
+++ b/devel/include-what-you-use/Makefile
@@ -0,0 +1,29 @@
+# Created by: Kubilay Kocak <koobs@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= include-what-you-use
+PORTVERSION= 0.5
+CATEGORIES= devel
+
+MAINTAINER= koobs@FreeBSD.org
+COMMENT= Tool for use with clang to analyze #includes in C and C++ source files
+
+LICENSE= NCSA
+LICENSE_FILE= ${WRKSRC}/LICENSE.TXT
+
+BUILD_DEPENDS= clang37:${PORTSDIR}/lang/clang37
+RUN_DEPENDS= clang37:${PORTSDIR}/lang/clang37
+
+USES= cmake:outsource ncurses python:run
+USE_GITHUB= yes
+
+GH_TAGNAME= clang_3.7
+
+CMAKE_ARGS+= -DIWYU_LLVM_INCLUDE_PATH=${LOCALBASE}/llvm37/include \
+ -DIWYU_LLVM_LIB_PATH=${LOCALBASE}/llvm37/lib
+
+PLIST_FILES= bin/fix_includes.py \
+ bin/include-what-you-use \
+ bin/iwyu_tool.py
+
+.include <bsd.port.mk>
diff --git a/devel/include-what-you-use/distinfo b/devel/include-what-you-use/distinfo
new file mode 100644
index 000000000000..943c55c34300
--- /dev/null
+++ b/devel/include-what-you-use/distinfo
@@ -0,0 +1,2 @@
+SHA256 (include-what-you-use-include-what-you-use-0.5-clang_3.7_GH0.tar.gz) = d5ba65de1da9ccbe65f92e80f8d5b0563b0935be13a15c129d6dbdd9dac841a0
+SIZE (include-what-you-use-include-what-you-use-0.5-clang_3.7_GH0.tar.gz) = 404410
diff --git a/devel/include-what-you-use/pkg-descr b/devel/include-what-you-use/pkg-descr
new file mode 100644
index 000000000000..cb8f20d8a874
--- /dev/null
+++ b/devel/include-what-you-use/pkg-descr
@@ -0,0 +1,15 @@
+"Include what you use" means this: for every symbol (type, function,
+variable, or macro) that you use in foo.cc (or foo.cpp), either foo.cc
+or foo.h should include a .h file that exports the declaration of that
+symbol. (Similarly, for foo_test.cc, either foo_test.cc or foo.h should
+do the including.) Obviously symbols defined in foo.cc itself are
+excluded from this requirement.
+
+This puts us in a state where every file includes the headers it needs
+to declare the symbols that it uses. When every file includes what it
+uses, then it is possible to edit any file and remove unused headers,
+without fear of accidentally breaking the upwards dependencies of
+that file. It also becomes easy to automatically track and update
+dependencies in the source code.
+
+WWW: http://include-what-you-use.org