You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/spec/manifest.md
+46Lines changed: 46 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -221,6 +221,52 @@ source-dir = "lib"
221
221
include-dir = "inc"
222
222
```
223
223
224
+
Since `fpm v0.12.0`, a library target can be built as a **monolithic**, **static**, or **shared** library using the `[library]` table in your `fpm.toml`. The build mode is selected via the `type` key:
225
+
226
+
```toml
227
+
[library]
228
+
type = "monolithic"# Default: single static archive bundling all code
229
+
# type = "static" # Per-package static archives (.a or .lib)
The root package and all its dependencies are compiled into a single static archive (`.a` or `.lib`). Only the objects required for building the apps, examples, and tests are actually included in the archive; everything else is pruned.
237
+
238
+
***`static`**:
239
+
Each package is compiled into its own static archive. This can be used to integrate `fpm`-built libraries into other build systems at the archive level.
240
+
241
+
***`shared`**:
242
+
Each package is compiled into its own shared/dynamic library (`.so`, `.dll`, or `.dylib`). These are linked dynamically, enabling reuse, faster incremental builds, and smaller binaries.
243
+
244
+
### 🛠️ Platform support
245
+
246
+
* On **Windows** (including MinGW, MSVC, and Intel compilers), `fpm` also generates:
247
+
248
+
* A `.lib` import library for each `.dll`
249
+
* A `.def` export definition file if required by the compiler
250
+
251
+
### 📂 Installation layout
252
+
253
+
When the following setting is enabled:
254
+
255
+
```toml
256
+
[install]
257
+
library = true
258
+
```
259
+
260
+
Then all generated library files are installed to the `lib/` subdirectory of the chosen install prefix.
261
+
262
+
Naming follows the pattern:
263
+
264
+
```text
265
+
lib<package_name>.{a|so|dll|dylib}
266
+
```
267
+
268
+
This convention is versioning-friendly and platform-compatible.
0 commit comments