Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
stas2 opened this issue Mar 31, 2021 · 2 comments
Assignees
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

Comments

@stas2
Copy link

stas2 commented Mar 31, 2021

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.

@gulrak
Copy link
Owner

gulrak commented Apr 1, 2021

Thanks for the report, I'll look into the issue. 👍

I still want filesystem.hpp to be a complete single-file implementation usable without the rest of the headers. It is used by quite some projects in that form and that is the reason it is an additional separate artifact of every release. This could be offered by some amalgamation tool, but it would be to much hassle for the platform detection only.
Without the single-file feature, I for sure would prefer separating it out too, so thanks for the suggestion.

@gulrak gulrak added bug Something isn't working macOS macOS platform is affected labels Apr 1, 2021
@gulrak gulrak self-assigned this Apr 1, 2021
@gulrak gulrak added this to the v1.5.6 milestone Apr 1, 2021
@gulrak gulrak added the available on master Fix is done on master branch, issue closed on next release label Apr 6, 2021
@gulrak
Copy link
Owner

gulrak commented May 24, 2021

This is now part of release v1.5.6

@gulrak gulrak closed this as completed May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants