A CMake module that automates precompiled headers and single compilation unit builds to speed up C/C++ compilation.
Cotire is a CMake module that speeds up the build process of C and C++ projects by automating precompiled header generation and single compilation unit (unity) builds. It reduces compilation times by optimizing how headers are processed and enabling faster unity builds, though its functionality has been superseded by native features in CMake 3.16 and later.
C and C++ developers using CMake as their build system, particularly those working on large projects with heavy header usage or seeking to reduce build times without modifying source code.
Developers choose Cotire for its non-intrusive automation of build optimizations, cross-compiler support, and compatibility with existing CMake workflows, offering significant speed improvements with minimal configuration.
CMake module to speed up builds.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Requires no source code modifications and only minimal changes to CMake files, making it easy to adopt in existing projects without disrupting codebases.
Automatically generates precompiled headers and unity builds tailored to each target, with speedups of 10-40% for PCH and up to 90% for unity builds, as documented in the README.
Works with Clang, GCC, Intel, and Visual Studio compilers on Windows, Linux, and macOS, ensuring broad support across development environments.
Compatible with Makefile, Ninja, Visual Studio, and Xcode builds, including multi-core unity builds for efficient parallel compilation.
The README explicitly states that cotire's functionality is built into CMake 3.16 and later, making this module obsolete for new projects and limiting future support.
CMake configure time increases for cotired targets, and precompiled headers are large binaries that bloat the build folder, adding management complexity.
Cotire cannot share precompiled headers between CMake targets, reducing efficiency in multi-target projects where code reuse is common.