mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-07 09:55:52 +00:00
Include <filesystem> only if FMT_CPP_LIB_FILESYSTEM is set (#4258)
This change results out of necessity since the Nintendo Switch console SDK does not support `std::filesystem`. The SDK still provides the `<filesystem>` header, but with an `#error` directive, effectively breaking any build that includes `<filesystem>` Because `<filesystem>` is present, `FMT_HAS_INCLUDE` is insufficient here. With this change and `FMT_CPP_LIB_FILESYSTEM` in place, one can define `FMT_CPP_LIB_FILESYSTEM=0` to work around this issue. This assumes that `<filesystem>` can be included (without warnings) if `FMT_CPP_LIB_FILESYSTEM` is set. If this is not the case, fmt would be broken even before this change as `std::filesystem::path` is used without the accompanying header.
This commit is contained in:
parent
47a66c5ecc
commit
9600fee020
@ -27,9 +27,6 @@
|
|||||||
|
|
||||||
// Check FMT_CPLUSPLUS to suppress a bogus warning in MSVC.
|
// Check FMT_CPLUSPLUS to suppress a bogus warning in MSVC.
|
||||||
# if FMT_CPLUSPLUS >= 201703L
|
# if FMT_CPLUSPLUS >= 201703L
|
||||||
# if FMT_HAS_INCLUDE(<filesystem>)
|
|
||||||
# include <filesystem>
|
|
||||||
# endif
|
|
||||||
# if FMT_HAS_INCLUDE(<variant>)
|
# if FMT_HAS_INCLUDE(<variant>)
|
||||||
# include <variant>
|
# include <variant>
|
||||||
# endif
|
# endif
|
||||||
@ -79,6 +76,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FMT_CPP_LIB_FILESYSTEM
|
#if FMT_CPP_LIB_FILESYSTEM
|
||||||
|
# include <filesystem>
|
||||||
FMT_BEGIN_NAMESPACE
|
FMT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
Loading…
Reference in New Issue
Block a user