Minimum deployment target check fails in fs_std.hpp, unless Availability.h is included · Issue #114 · gulrak/filesystem · GitHub
Skip to content

Minimum deployment target check fails in fs_std.hpp, unless Availability.h is included #114

Description

@stas2

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

available on masterFix is done on master branch, issue closed on next releasebugSomething isn't workingmacOSmacOS platform is affected

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions