Minimum deployment target check fails in fs_std.hpp, unless Availability.h is included #114
Labels
available on master
Fix is done on master branch, issue closed on next release
bug
Something isn't working
macOS
macOS platform is affected
Milestone
I want to make use of the dynamic detection feature by only including ghc/fs_std.hpp.
However if only ghc/fs_std.hpp is included, then detection fails when building on Mac for 10.14 target.
Apparently it fails, because it uses __MAC_OS_X_VERSION_MIN_REQUIRED macro definition, which is defined by Availability.h from MacOSX SDK, which is not included prior to fs_std.hpp.
To make the detection work, I need to explicitly include <Availability.h> before including fs_std.hpp.
Should it also be included in ghc/fs_std.hpp for the detection to work properly, without additional includes by the user?
This also appears to be the case for other headers.
Availability.h is also later included in filesystem.hpp, but it is included after the system detection.
It looks like this platform detection code could be extracted from filesystem.hpp (lines 54-94) into a separate internal header file and shared between public header files. What do you think? I am willing to make this change and submit a PR, however I will not be able to test on all platforms.
The text was updated successfully, but these errors were encountered: