Where Does Meson Keep Build Directories?
Where Meson keeps the build directory you chose, what meson-info holds, and how the wrap package cache works.
Last updated
Meson has no central cache directory for configuration. The build directory you name in meson setup is the cache: it holds meson-info, meson-logs, and everything the build needs to recompile incrementally. Delete that folder and the configuration is gone with it.
Two smaller caches orbit the build dir. Wrap downloads land in subprojects/packagecache inside the source tree, unless MESON_PACKAGE_CACHE_DIR points elsewhere. ThinLTO objects go under meson-private inside the build dir. Knowing this split saves real confusion when a rebuild misbehaves after a system update.
Where Meson stores this, by platform
<project-dir>\build
You pick this folder when running meson setup, so the path varies per project. meson-info and meson-logs inside it record how the build was configured. Wipe the whole directory for a clean reconfigure and keep wrap downloads in subprojects/packagecache.
<project-dir>/build
Same user-chosen build directory layout as the other platforms. Set MESON_PACKAGE_CACHE_DIR to share wrap sources across projects. IDEs sometimes manage their own build dir inside their cache folder, so check there when no build folder sits in the sources.
<project-dir>/build
Identical to macOS. The build dir carries a CACHEDIR.TAG file marking it disposable for backup tools. ThinLTO cache objects live under meson-private inside it when link time optimization is enabled.
Frequently asked questions
how do I wipe a Meson build and start over
Delete the build directory and run meson setup again with the same options. There is no separate cache to clear for configuration itself, since the build dir is the cache. Downloaded wrap sources in subprojects/packagecache can stay, which makes reconfiguration faster.
how do I share wrap downloads between projects
Set MESON_PACKAGE_CACHE_DIR to a shared folder and every project on the machine reuses those wrap downloads. Without it, each project keeps its own copy under subprojects/packagecache. The variable has been honored since Meson 1.3.
do backups need to include Meson build dirs
Yes. The build directory carries a CACHEDIR.TAG marker so backup tools skip it automatically. Treat build output as disposable and keep anything precious in the source tree or in version control instead.
Notice an outdated path? Let us know.