This patch release makes the precompiled and experimental module modes cheaper for clients. Include-what-you-use is followed, more function bodies compile into the library instead of into every translation unit, and the C++20 named module now imports the precompiled implementation instead of the full header-only library. It also fixes the Bazel precompiled build, which could give consumers duplicate implementations.
Changed
- The C++20 named module uses the precompiled implementation and we lowered its floor from C++23 to C++20.
CLI11::Modulenow works for bothfind_packageandadd_subdirectory, and configure fails with a clear message if CMake is older than 3.28. #1413 - Removed
<iostream>,<codecvt>,<iomanip>,<fstream>, and<locale>from the declaration headers, so precompiled clients do not parse them.App::exit()is now three overloads instead of one with stream default arguments. #1411 - Moved the remaining non-template function bodies out of
App.hpp,Option.hpp,Validators.hpp,TypeTools.hpp,ConfigFwd.hpp, andFormatterFwd.hppinto theimpl/*_inl.hppfiles, so they compile into the library in precompiled mode. Header-only mode is unchanged. #1415 #1416 #1417
Fixed
- Fixed the Bazel precompiled build:
CLI11_COMPILEandCLI11_ENABLE_EXTRA_VALIDATORSnow propagate to consumers, which previously got duplicate implementations from both the headers and the library. Added acli11_header_onlytarget, the Windowsshell32link, and more tests. #1420 - Made
ExtraValidators_inl.hppuse the sameCLI11_ENABLE_EXTRA_VALIDATORStest as its header, and gave the file permission validators theCLI11_MODULE_INLINEmarker the other global validators have. #1415
Documentation
- Documented the precompiled mode in the README. #1412
- Added a minimal module example, corrected the
CLI11::Moduletarget name in the book, and noted that macros such asCLI11_PARSEdo not come through an import. #1413
Internal
- Added an
iwyupreset that runs include-what-you-use over the one precompiled translation unit, with a mapping file for both standard libraries, and applied its findings. #1418