forked from platformio/platformio-core
Rename "lib_compat_level" to "lib_compat_mode"
This commit is contained in:
@ -20,7 +20,7 @@ PlatformIO 3.0
|
||||
+ Check library compatibility with project environment before building
|
||||
(`issue #415 <https://github.com/platformio/platformio/issues/415>`_)
|
||||
+ Control Library Dependency Finder for compatibility using
|
||||
`lib_compat_level <http://docs.platformio.org/en/latest/projectconf.html#lib-compat-level>`__
|
||||
`lib_compat_mode <http://docs.platformio.org/en/latest/projectconf.html#lib-compat-mode>`__
|
||||
option
|
||||
+ Custom library storages/directories with
|
||||
`lib_extra_dirs <http://docs.platformio.org/en/latest/projectconf.html#lib-extra-dirs>`__ option
|
||||
|
@ -57,12 +57,12 @@ order:
|
||||
2. :ref:`projectconf_pio_lib_dir`
|
||||
3. :ref:`projectconf_pio_home_dir`/lib
|
||||
|
||||
Library Dependency Finder has a few key factors from :ref:`projectconf`:
|
||||
Library Dependency Finder has a few controls from :ref:`projectconf`:
|
||||
|
||||
* :ref:`projectconf_lib_ignore`
|
||||
* :ref:`projectconf_lib_deep_search`
|
||||
* :ref:`projectconf_lib_extra_dirs`
|
||||
* :ref:`projectconf_lib_compat_level`
|
||||
* :ref:`projectconf_lib_compat_mode`
|
||||
|
||||
Command completion in Terminal
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -729,25 +729,25 @@ Example:
|
||||
[env:custom_lib_dirs]
|
||||
lib_extra_dirs = /path/to/private/dir1,/path/to/private/dir2
|
||||
|
||||
.. _projectconf_lib_compat_level:
|
||||
.. _projectconf_lib_compat_mode:
|
||||
|
||||
``lib_compat_level``
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
``lib_compat_mode``
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Please make sure to read :ref:`faq_ldf` guides first.
|
||||
|
||||
Library compatibility level that allows to control Library Dependency Finder
|
||||
Library compatibility mode that allows to control Library Dependency Finder
|
||||
strictness. If library contains manifest file (:ref:`library_config`,
|
||||
``library.properties``, ``module.json``), then LDF check compatibility of this
|
||||
library with real build environment. Available compatibility levels:
|
||||
library with real build environment. Available compatibility modes:
|
||||
|
||||
* ``0`` - don't check for compatibility (disable)
|
||||
* ``0`` - don't check for compatibility
|
||||
* ``1`` - check for the compatibility with :ref:`projectconf_env_framework`
|
||||
from build environment
|
||||
* ``2`` - check for the compatibility with :ref:`projectconf_env_framework`
|
||||
and :ref:`projectconf_env_platform` from build environment.
|
||||
|
||||
By default, this value is set to ``lib_compat_level = 1`` and means that LDF
|
||||
By default, this value is set to ``lib_compat_mode = 1`` and means that LDF
|
||||
will check only for framework compatibility.
|
||||
|
||||
-----------
|
||||
|
@ -45,7 +45,7 @@ commonvars.AddVariables(
|
||||
|
||||
# library options
|
||||
("LIB_DEEP_SEARCH",),
|
||||
("LIB_COMPAT_LEVEL",),
|
||||
("LIB_COMPAT_MODE",),
|
||||
("LIB_IGNORE",),
|
||||
("LIB_FORCE",),
|
||||
("LIB_EXTRA_DIRS",),
|
||||
|
@ -463,7 +463,7 @@ def GetLibBuilders(env):
|
||||
env_frameworks = [
|
||||
f.lower().strip() for f in env.get("PIOFRAMEWORK", "").split(",")
|
||||
]
|
||||
compat_level = int(env.get("LIB_COMPAT_LEVEL", 1))
|
||||
compat_mode = int(env.get("LIB_COMPAT_MODE", 1))
|
||||
|
||||
for libs_dir in env['LIBSOURCE_DIRS']:
|
||||
libs_dir = env.subst(libs_dir)
|
||||
@ -477,14 +477,14 @@ def GetLibBuilders(env):
|
||||
if not env.GetOption("silent"):
|
||||
sys.stderr.write("Ignored library %s\n" % lb.path)
|
||||
continue
|
||||
if compat_level > 1 and not lb.is_platform_compatible(env[
|
||||
if compat_mode > 1 and not lb.is_platform_compatible(env[
|
||||
'PIOPLATFORM']):
|
||||
if not env.GetOption("silent"):
|
||||
sys.stderr.write("Platform incompatible library %s\n" %
|
||||
lb.path)
|
||||
continue
|
||||
if compat_level > 0 and not any([lb.is_framework_compatible(f)
|
||||
for f in env_frameworks]):
|
||||
if compat_mode > 0 and not any([lb.is_framework_compatible(f)
|
||||
for f in env_frameworks]):
|
||||
if not env.GetOption("silent"):
|
||||
sys.stderr.write("Framework incompatible library %s\n" %
|
||||
lb.path)
|
||||
|
Reference in New Issue
Block a user