-
Notifications
You must be signed in to change notification settings - Fork 108
Allow optional features in projects #609
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
Comments
Features would be a great to have in fpm! In my opinion there's two crucial features in Cargo's feature functionality that would be great to see in fpm too: Optional dependencies: Feature dependencies: |
@awvwgk @plevold @ivan-pi @LKedward is anyone still interested in and/or working on supporting optional features or specifically making MPI optional? @ktras and I are looking into adding this. Does anyone have suggestions on how and where to start in the |
@everythingfunctional suggested that we take a look at how Rust cargo does handles similar behaviors. |
A preprocessor mechanism is supported already AFAIK. I think @perazz may be able to provide the most accurate comment. |
Motivation
Not all parts of a project are always needed. Many Fortran projects can be build with and without MPI support for example. Currently there is no mechanism to express such features in the package manifest. An option is to rely on preprocessor and set reasonable default using constructs like shown below:
Since preprocessor might be the easiest way to express project local optional features, we could include such mechanism in fpm.
Specification
A project could declare a features table and export this to the project via a preprocessor variable:
When used as a dependency the feature could be toggled using
Prior Art
Cargo has features: https://doc.rust-lang.org/cargo/reference/features.html
Additional Information
A use case would be fortran-lang/test-drive#7
The mechanism required in fpm is similar to the one described in #577 (comment)
The text was updated successfully, but these errors were encountered: