- We need to confirm compiler support for module scanning before
creating the CXX_MODULE FILE_SET using the `target_sources` command
- This is especially relevant for compilers that have module support but
do not support the module scanning such as g++13, clang15. For these
we can use the older way of creating the fmt-module target
Co-authored-by: Mathew Benson <mathew@benson.co.ke>
The dummy argument {fmt_int} was there as a workaround for MSVC and to
avoid needing to rely on another GCC extension for zero-size arrays. Use
macro magic similar to FMT_NARG() instead that replaces the problematic
zero-size array with NULL.
In order to avoid a quadratic number of expansions, defer creating the
mapped argument list until after selection of whether to use NULL or
the fmt_arg array.
Signed-off-by: Ferdinand Bachmann <ferdinand.bachmann@yrlf.at>
* Add Separate CMake Target for C++20 Modules
In the same vein as there is the `fmt::fmt-header-only`, `fmt::fmt` and
`fmt::fmt_c` targets, I propose the addition of a new target
`fmt::fmt-module` which will be for the compilation of the FMT_MODULE
library option.
The new target will have the properties requried for Compiling,
Installing and using the C++20 functionality in CMake
The `add_module_library` function is marked as deprecated as its
functionality is superseded.
Updated the logic for setting the FMT_USE_CMAKE_MODULE flag to check the
versions for Ninja and MSVC according the CMAKE Documents and setting
the FMT_MODULE flag based on this
* Add Separate CMake Target for C++20 Modules
In the same vein as there is the `fmt::fmt-header-only`, `fmt::fmt` and
`fmt::fmt_c` targets, I propose the addition of a new target
`fmt::fmt-module` which will be for the compilation of the FMT_MODULE
library option.
The new target will have the properties requried for Compiling,
Installing and using the C++20 functionality in CMake
Updated the logic for setting the FMT_USE_CMAKE_MODULE flag to check the
versions for Ninja and MSVC according the CMAKE Documents and setting
the FMT_MODULE flag based on this
Fixed the test/CMakeLists.txt file which used the FMT_MODULE flag to
separate the module and non-module library testing, in particular
disableing the module version.
The module testing still needs to be fixed, but the expected behavior of
testing the non-modular version is working.
---------
Co-authored-by: Mathew Benson <mathew@benson.co.ke>
Co-authored-by: ClausKlein <claus.klein@arcormail.de>
In some cases, people might want to format the std::unexpected type itself,
independent of the value type, this commit makes it possible.
Co-authored-by: Robin Oger <robin.oger.work@gmail.com>
* Cleanup documentation
* Fix comment typo in fmt::formatter struct
* Fix formatting and grammar in api.md
Corrected formatting and grammar in the API documentation.