macOS
brew install include-what-you-uselocal Homebrew formula metadata
sudo port install include-what-you-useMacPorts ports tree · devel/include-what-you-use/Portfile · 来源: api.github.com
安装
brew install include-what-you-uselocal Homebrew formula metadata
sudo port install include-what-you-useMacPorts ports tree · devel/include-what-you-use/Portfile · 来源: api.github.com
sudo apk add include-what-you-useAlpine Linux edge package indexes · include-what-you-use · 来源: dl-cdn.alpinelinux.org
nix profile install nixpkgs#include-what-you-usenixpkgs package indexes · include-what-you-use · 来源: raw.githubusercontent.com
sudo zypper install include-what-you-useopenSUSE Tumbleweed package metadata · include-what-you-use · 来源: download.opensuse.org
sudo dnf install iwyuFedora Rawhide package metadata · iwyu · 来源: dl.fedoraproject.org
概览
Tool to analyze #includes in C and C++ source files
历史
Include What You Use, often abbreviated IWYU, is a Clang-based C and C++ include analyzer. It tells developers which headers a source file should include directly and which includes can be removed or replaced with forward declarations.
The project site announced a very-alpha 0.1 release in February 2011 and described an open-source release-early approach after Google-internal origins. Early releases tracked specific LLVM and Clang versions because IWYU depends heavily on Clang internals.
The release notes show a steady pattern: each IWYU release follows an LLVM/Clang line, updates mappings, and improves analysis of C, C++, templates, standard-library headers, and platform-specific headers. Version 0.5 in December 2015 marked migration to GitHub, updated documentation, improved testing infrastructure, and added Boost and Qt mappings.
IWYU spread through C++ build culture because include hygiene directly affects compile time, rebuild fan-out, and refactoring safety. The official documentation explicitly frames the tool around large codebases, where transitive includes make it hard to remove dependencies safely.
Package-manager metadata in this batch lists Homebrew, Alpine, Fedora, MacPorts, Nix, and openSUSE packaging. That is a good fit for a compiler-adjacent developer tool: users install a binary matching their Clang generation and wire it into compilation databases, CMake workflows, CI, or local cleanup scripts.
IWYU is usually run against source files with the same compilation information used by Clang. The companion iwyu_tool.py works with compilation databases, and fix_includes.py can apply suggested include edits.
Its output is used during dependency cleanup, code-review preparation, CI checks, and large refactors where accidental reliance on another file's transitive include would otherwise hide missing direct dependencies.
For package nerds, IWYU is significant because it turns a style rule into a compiler-backed CLI. It also illustrates a packaging challenge common to LLVM ecosystem tools: the useful binary has to stay aligned with Clang internals and therefore tends to move in lockstep with compiler releases.
It matters beyond neatness. Header dependency cleanup can shorten builds, reduce needless rebuilds, and make C++ packages less fragile when upstream headers change.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
fix_includes.py | cli | 全局可执行文件 | |
include-what-you-use | cli | 全局可执行文件 | |
iwyu_tool.py | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://include-what-you-use.org/
安装元数据
| 软件包键 | brew:include-what-you-use |
|---|---|
| 版本 | 0.26 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/include-what-you-use |
| 主页 | https://include-what-you-use.org/ |
| 仓库 | https://github.com/include-what-you-use/include-what-you-use |
| 上游文档 | https://github.com/include-what-you-use/include-what-you-use#readme |
| 许可证 | NCSA |
| 源码归档 | https://include-what-you-use.org/downloads/include-what-you-use-0.26.src.tar.gz |
| 依赖 | llvm |
| 构建依赖 | cmake |
| macOS 提供的库 | ncurses |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | include-what-you-use |
| Aliases |
|
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
include-what-you-use
nix profile install nixpkgs#include-what-you-useinclude-what-you-use 0.26-r0
A tool for use with clang to analyze #includes in C and C++ source files
https://include-what-you-use.org
sudo apk add include-what-you-useinclude-what-you-use-dbg 0.26-r0
A tool for use with clang to analyze #includes in C and C++ source files (debug symbols)
https://include-what-you-use.org
sudo apk add include-what-you-use-dbginclude-what-you-use-doc 0.26-r0
A tool for use with clang to analyze #includes in C and C++ source files (documentation)
https://include-what-you-use.org
sudo apk add include-what-you-use-dociwyu 0.26-3.fc45
C/C++ source files #include analyzer based on clang
https://github.com/include-what-you-use/include-what-you-use
sudo dnf install iwyuinclude-what-you-use 0.26-1.2
A tool to analyze #includes in C and C++ source files
https://include-what-you-use.org/
sudo zypper install include-what-you-useinclude-what-you-use-tools 0.26-1.2
Additional tools to use include-what-you-use effectively
https://include-what-you-use.org/
sudo zypper install include-what-you-use-toolsinclude-what-you-use
sudo port install include-what-you-use来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.