Skip to content

Implement option for using non-prefixed environment variables #576

Open
@awvwgk

Description

@awvwgk

Description

For integration in packaging systems like conda-build or spack or to seamlessly work with environment modules fpm could allow an option to use non-prefixed environment variables.

  • --compiler, FPM_FC, FC to set Fortran compiler
  • --c-compiler, FPM_CC, CC to set C compiler
  • --archiver, FPM_AR, AR to set archiver
  • --flag, FPM_FFLAGS, FFLAGS to set Fortran compiler flags
  • --c-flag, FPM_CFLAGS, CFLAGS to set C compiler flags
  • --link-flag, FPM_LDFLAGS, LDFLAGS to set linker flags

The non-prefixed environment variables will not be used by default to avoid picking up environment variables by accident, i.e. using the non-prefixed variables is always opt-in.

Possible Solution

Use command line flag --env or similar to activate usage of compiler variables. Always provide an option to show to show where a particular default originated from.

Additional Information

Follow-up from #549

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions