From 7322df26ad8d43029b992a9bd3f3369840bc40da Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 19 Nov 2018 19:06:56 +0200 Subject: [PATCH] Fix an issue when Library Dependency Finder (LDF) does not handle project `src_filter ` // Resolve #1905 --- HISTORY.rst | 2 ++ platformio/builder/tools/piolib.py | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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