Library options

New in version 3.0.

See also

Please make sure to read Library Dependency Finder (LDF) guide first.

lib_deps

See also

Please make sure to read Library Dependency Finder (LDF) guide first.

Specify project dependencies that should be installed automatically to libdeps_dir before environment processing. Multiple dependencies are allowed (multi-lines or separated with comma+space “, “).

If you have multiple build environments that depend on the same libraries, you can use Dynamic variables to use common configuration.

Valid forms

; one line definition (comma + space)
[env:myenv]
lib_deps = LIBRARY_1, LIBRARY_2, LIBRARY_N

; multi-line definition
[env:myenv2]
lib_deps =
  LIBRARY_1
  LIBRARY_2
  LIBRARY_N

The each line with LIBRARY_1... LIBRARY_N will be passed automatically to platformio lib install command. Please follow to platformio lib install for detailed documentation about possible values.

Example:

[env:myenv]
lib_deps =
  13
  PubSubClient
  ArduinoJson@~5.6,!=5.4
  https://github.com/gioblu/PJON.git#v2.0
  me-no-dev/ESPAsyncTCP
  IRremoteESP8266=https://github.com/markszabo/IRremoteESP8266/archive/master.zip

lib_ignore

See also

Please make sure to read Library Dependency Finder (LDF) guide first.

Specify libraries which should be ignored by Library Dependency Finder.

The correct value for this option is a library name (not folder name). You will see these names in “Library Dependency Graph” when building a project between < and > symbols.

The multiple library names are allowed, split them with comma+space “, “ or put each library name in a separate new line.

Example:

Build output

...
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain+) COMPATIBILITY(soft)
Collected 54 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <Hash> v1.0
|-- <AsyncMqttClient> v0.8.2
|   |-- <ESPAsyncTCP> v1.1.3
|-- <ESP8266WiFi> v1.0
|-- <ESP Async WebServer> v1.1.1
|   |-- <ESPAsyncTCP> v1.1.3
|   |-- <ESP8266WiFi> v1.0
|   |-- <Hash> v1.0
|   |-- <ArduinoJson> v5.13.1
|-- <ArduinoJson> v5.13.1
|-- <DNSServer> v1.1.0
|   |-- <ESP8266WiFi> v1.0
|-- <Ticker> v1.0
....

platformio.ini

[env:myenv]
; Single line
lib_ignore = AsyncMqttClient, DNSServer

; Multi-line
lib_ignore =
  AsyncMqttClient
  ESP Async WebServer

lib_extra_dirs

See also

Please make sure to read Library Dependency Finder (LDF) guide first.

A list with extra directories/storages where Library Dependency Finder (LDF) will look for dependencies. Multiple paths are allowed. Please separate them using comma+space “, “.

This option can be set by global environment variable PLATFORMIO_LIB_EXTRA_DIRS or using global [platformio] section and lib_extra_dirs option.

Warning

This is a not direct path to a library with source code. It should be a path to storage that contains libraries grouped by folders. For example, D:\PlatformIO\extra\libraries but not D:\PlatformIO\extra\libraries\FooLibrary.

Example:

[env:myenv]
lib_extra_dirs = /common/libraries, /iot/libraries

lib_ldf_mode

New in version 3.0.

See also

Please make sure to read Library Dependency Finder (LDF) guide first.

This option specifies how does Library Dependency Finder should analyze dependencies (#include directives). See Dependency Finder Mode for details.

Example:

[env:myenv]
lib_ldf_mode = chain

lib_compat_mode

See also

Please make sure to read Library Dependency Finder (LDF) guide first.

Library compatibility mode allows to control strictness of Library Dependency Finder. More details Compatibility Mode.

By default, this value is set to lib_compat_mode = soft and means that LDF will check only for framework compatibility.

Example:

[env:myenv]
lib_compat_mode = soft

lib_archive

New in version 3.4.1.

Create an archive (*.a, static library) from the object files and link it into a firmware (program). This is default behavior of PlatformIO Build System (lib_archive = true).

Setting lib_archive = false will instruct PIO Build System to link object files directly (in-line). This could be useful if you need to override weak symbols defined in framework or other libraries.

You can disable library archiving per a custom library using libArchive field in library.json manifest.

Example:

[env:myenv]
lib_archive = false