Skip to content

Use environment variable to pass external module paths to the compiler #452

@milancurcic

Description

@milancurcic

Since #438, it's possible to use external (non-fpm packaged) modules as dependencies.

There are currently two possible ways to do this:

  1. Pass the path explicitly via --flag, e.g.:
fpm build --flag "-I/path/to/my/external/dependencies"
  1. Link all modules into a include (default) directory and let fpm pick them up.

Option 1 is verbose and error-prone, especially when you start to include more than one non-fpm dependency into the project. It's particularly bad during development when I want to type fpm build often.

Option 2 is much easier but inelegant. It's difficult to manage different versions of dependencies or dependencies built by different compilers (both are common use cases in my field) because you'd need to replace the files or symlinks.

Rather than managing the external dependency modules on a file system level, I suggest to introduce an fpm-specific environment variable to pass the paths to the compiler.

Originally proposed by @LKedward here. A candidate variable name, proposed by @certik here, is FPM_EXTERNAL_MODULES_PATH. Which I like as well.

#444 would solve this (variable name aside), but it turns out it was trying to solve something else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions