the library itself needs to be installed before
the fmt-targets.cmake file is installed,
otherwise the installed targets file doesn't
actually point to the library using
IMPORTED_LOCATION
Problem:
- All `-Wshadow` warnings are fixed but there is nothing stopping them
from being reintroduced.
Solution:
- Fail pedantic builds on `-Wshadow` warnings. This allows CI to prevent
reoccurrence of the warning.
Notes:
- Not enabling `-Wshadow` for gcc versions 4 or lower because the
warning is much more aggressive there to the point that it's mostly
just noise.
Use the version range feature introduced in 3.12. On CMake <3.12 the extra dots are simply interpreted as extra version number separators.
The fallback for ancient CMake versions is kept.
On some platform, fmt is using the following link flag:
```cmake
target_link_libraries(fmt -Wl,--as-needed)
```
This is not supported by wasm-ld as of today.
This patch stop using it when compiling using emscripten.
Bug: https://github.com/fmtlib/fmt/issues/1736
CMake Warning (dev) at /usr/share/cmake-3.17/Modules/GNUInstallDirs.cmake:225 (message):
Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
target architecture is known. Please enable at least one language before
including GNUInstallDirs.
* Support custom FMT_INC_DIR in pkgconfig and cmake configs
When CMAKE_INSTALL_INCLUDEDIR or FMT_INC_DIR override the header
installation directory, they should be used instead of
${CMAKE_INSTALL_PREFIX}/include in fmt-targets.cmake and fmt.pc.
* Put headers into FMT_INC_DIR/fmt rather than directly into FMT_INC_DIR
This makes FMT_INC_DIR an alias for CMAKE_INSTALL_INCLUDEDIR and
simplifies generation of pkgconfig and cmake configs.
* Do not split target_include_directories
* Avoid weak vtables by providing a private virtual member function
* Add warning Wweak-vtables to clang when FMT_PEDANTIC is on
* Add defaulted copy and move operations to format_error and system_error
Compiler generated copy operations are deprecated and move operations
are not generated altogether.
* Add warning Wdeprecated to clang when FMT_PEDANTIC is on