-
Notifications
You must be signed in to change notification settings - Fork 116
Add explicit include-dir key to manifest #377
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
Conversation
A library package must consist of at least a source directory, an include directory or both. Default values of "src" and "include" are ignored if non-existent.
Header-only libraries may result in no compile targets.
awvwgk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this allows to use fpm as C/C++ package manager by exporting headers!
I suggest to allow include-dir to take a string or an array of strings (similar to build.link) in case multiple include directories are present.
|
Is this PR expected to also work for including pre-built module files? Specifically, I'm trying to use this to build a program with NetCDF as a dependency. A system-provided netcdf.mod is in /usr/include. Here's my fpm.toml: But I get the error during Is the problem perhaps that fpm tries to look for the source file that provides the netcdf module? Compiler options are: So it doesn't look like the path I provided in Or am I not setting it up correctly? |
No, this PR isn't targeting this use-case specifically, but you are right that this is only limited by the fact that fpm tries to identify a source file all modules used. We could loosen this check to only print a warning if the module source file isn't contained within the project and then your example will work. I think your use case should be discussed separately to this PR; using external mod files isn't ideal for fpm IMO, but I guess it can't be avoided for packages like netcdf. Looks like I also just need to update the compiler options output to run after processing the manifest. |
|
Sounds good, in that case, let's just add a note to the manifest reference that this for the time being won't work for pre-built modules. |
Add note about non-support for external mod files
awvwgk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very useful addition, only one minor whitespace nitpick in the manifest reference from my side.
Co-authored-by: Sebastian Ehlert <[email protected]>
|
Thanks for reviewing, I will now merge. |
A minimal set of changes towards improved support for
include/#includestatements (related: #358).include-dirin the[library]table which allows specifying a directory to pass to the compiler as an include directory (i.e.-Iinclude)..f90files to be stored separately to compilable sources so that fpm won't try to compile them.include-diris"include"which is ignored if the directory doesn't exist.source-diror theinclude-diror bothNot addressed in this PR (#358):