Description
Steps to Reproduce
Building with C++17, and nlohmann v3.10.4, targeting macOS Deployment Target of 10.14
/Users/distiller/project/app/lib/nlohmann/single_include/nlohmann/json.hpp:4384:57: error: 'path' is unavailable: introduced in macOS 10.15
void from_json(const BasicJsonType& j, std::filesystem::path& p)
^
etc,
Basically since C++ library features are implemented in macOS and not via a redistributable system, Xcode refuses to compile if it knows a feature will be unavailable. For example, std::variant
does not work until 10.12
It is a product requirement for our minimum deployment target to be set at 10.14, but we are building with C++17 regardless and just need to avoid using features we can't rely on being present at runtime.
What is the expected behavior?
Use of std::filesystem
is opt-in rather than automatically used if C++17 is available.
And what is the actual behavior instead?
I guess we would have to lower our compile standard to C++14, however since nlohmann is header only we can't lower our standard for the entire project.
Which compiler and operating system are you using?
MacOS 10.15.7
Xcode 12.4
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Which version of the library did you use?
- latest release version 3.10.4
- other release - please state the version: ___
- the
develop
branch
If you experience a compilation error: can you compile and run the unit tests?
- yes
- no - please copy/paste the error message below