Skip to content

Document fpm #847: arrays of source file directories #93

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion pages/spec/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ source-dir = "lib"
include-dir = "inc"
```

Similar to *executable* targets, library configurations can also specify multiple source folders for their dependency tree: for example,

```toml
[library]
source-dir=["lib_one","lib_two","lib_three"]
include-dir=["include1","include2"]
```

#### Include directory

:::{note}
Expand Down Expand Up @@ -432,6 +440,26 @@ Dependencies can be declared in the *dependencies* table in the manifest root or
When declared in the manifest root the dependencies are exported with the project.


### Locating source directories

For all executable, library, example and test targets, non-default source directories can be provided instead of the [default](## Automatic target discovery) root values. Keyword ``source-dir`` in the manifest entry is used to specify either a single folder or on array of them:

```toml
[[executable]]
name = "app-1"
source-dir = ["src","src2"] # array of source folders

[[executable]]
name = "app-2"
source-dir = "src" # one source folder only

[[test]]
name = "my_test"
source-dir = ["test_aux"]
```

The list of custom directories does not necessarily have to include the default ones. Fpm will build and search dependencies down the folder tree starting from all user-specified root folders.

### Local dependencies

To declare local dependencies use the *path* entry.
Expand Down Expand Up @@ -502,7 +530,7 @@ library = true

## Preprocessor configuration

Under the *preprocess* section, you can specify one or more preprocessor to use in an fpm project.
Under the *preprocess* section, you can specify one or more preprocessor to use in an fpm project.

### Specifying the preprocessor

Expand Down