fortran-lang/fpm-docs

Source file scoping specification

zoziha opened this issue · 0 comments

Description

There is a source file scoping specification in the fpm developer specification, but it is somewhat hidden and not obvious, and it is important enough to be included in the user documentation.

Specification contents:

## Source file scoping
Source files are assigned a scope of either FPM_SCOPE_LIB, FPM_SCOPE_APP or FPM_SCOPE_TEST.
The scope controls which modules may be used by the source file:

- Library sources (FPM_SCOPE_LIB) may only use modules also with library scope.
  This includes library modules from dependencies.

- Executable sources (FPM_SCOPE_APP,FPM_SCOPE_TEST) may use library modules (including dependencies)
  as well as any modules corresponding to source files in the same directory
  or a subdirectory of the executable source file.

Links

  1. intended design
  2. specification
  3. Unable to find dependency from parent directory when building exe