diff --git a/HISTORY.rst b/HISTORY.rst index 56dd7863..a83b34f9 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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 `_) +* Fixed an issue when Library Dependency Finder (LDF) does not handle project `src_filter `__ + (`issue #1905 `_) 3.6.1 (2018-10-29) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/builder/tools/piolib.py b/platformio/builder/tools/piolib.py index 720f1eba..39627682 100644 --- a/platformio/builder/tools/piolib.py +++ b/platformio/builder/tools/piolib.py @@ -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