Fix an issue when Library Dependency Finder (LDF) does not handle project src_filter // Resolve #1905

This commit is contained in:
Ivan Kravets
2018-11-19 19:06:56 +02:00
parent 32bb9c9d83
commit 7322df26ad
2 changed files with 10 additions and 1 deletions

View File

@ -11,6 +11,8 @@ PlatformIO 3.0
* Fixed incorrect wording when initializing/updating project
* Fixed an issue with incorrect order for library dependencies ``CPPPATH``
(`issue #1914 <https://github.com/platformio/platformio-core/issues/1914>`_)
* Fixed an issue when Library Dependency Finder (LDF) does not handle project `src_filter <http://docs.platformio.org/page/projectconf/section_env_build.html#src-filter>`__
(`issue #1905 <https://github.com/platformio/platformio-core/issues/1905>`_)
3.6.1 (2018-10-29)
~~~~~~~~~~~~~~~~~~

View File

@ -663,6 +663,12 @@ class PlatformIOLibBuilder(LibBuilderBase):
class ProjectAsLibBuilder(LibBuilderBase):
def __init__(self, env, path, manifest=None, verbose=False):
# backup original value, will be reset in base.__init__
project_src_filter = env.get("SRC_FILTER")
super(ProjectAsLibBuilder, self).__init__(env, path)
self.env['SRC_FILTER'] = project_src_filter
@property
def include_dir(self):
include_dir = self.env.subst("$PROJECTINCLUDE_DIR")
@ -701,7 +707,8 @@ class ProjectAsLibBuilder(LibBuilderBase):
@property
def src_filter(self):
return self.env.get("SRC_FILTER", LibBuilderBase.src_filter.fget(self))
return (self.env.get("SRC_FILTER")
or LibBuilderBase.src_filter.fget(self))
def process_extra_options(self):
# skip for project, options are already processed