diff --git a/platformio/builder/tools/piolib.py b/platformio/builder/tools/piolib.py index 1b3fb653..574c9ed9 100644 --- a/platformio/builder/tools/piolib.py +++ b/platformio/builder/tools/piolib.py @@ -347,7 +347,7 @@ class LibBuilderBase(object): for path in self._validate_search_files(search_files): try: assert "+" in self.lib_ldf_mode - incs = LibBuilderBase.CCONDITIONAL_SCANNER( + candidates = LibBuilderBase.CCONDITIONAL_SCANNER( self.env.File(path), self.env, tuple(include_dirs), @@ -357,26 +357,26 @@ class LibBuilderBase(object): sys.stderr.write( "Warning! Classic Pre Processor is used for `%s`, " "advanced has failed with `%s`\n" % (path, e)) - _incs = LibBuilderBase.CLASSIC_SCANNER( + candidates = LibBuilderBase.CLASSIC_SCANNER( self.env.File(path), self.env, tuple(include_dirs)) - incs = [] - for inc in _incs: - incs.append(inc) - if not self.PARSE_SRC_BY_H_NAME: + + # print(path, map(lambda n: n.get_abspath(), candidates)) + for item in candidates: + if item not in result: + result.append(item) + if not self.PARSE_SRC_BY_H_NAME: + continue + _h_path = item.get_abspath() + if not self.env.IsFileWithExt(_h_path, piotool.SRC_HEADER_EXT): + continue + _f_part = _h_path[:_h_path.rindex(".")] + for ext in piotool.SRC_C_EXT: + if not isfile("%s.%s" % (_f_part, ext)): continue - _h_path = inc.get_abspath() - if not self.env.IsFileWithExt(_h_path, - piotool.SRC_HEADER_EXT): - continue - _f_part = _h_path[:_h_path.rindex(".")] - for ext in piotool.SRC_C_EXT: - if isfile("%s.%s" % (_f_part, ext)): - incs.append( - self.env.File("%s.%s" % (_f_part, ext))) - # print(path, map(lambda n: n.get_abspath(), incs)) - for inc in incs: - if inc not in result: - result.append(inc) + _c_path = self.env.File("%s.%s" % (_f_part, ext)) + if _c_path not in result: + result.append(_c_path) + return result def depend_recursive(self, lb, search_files=None): diff --git a/platformio/managers/core.py b/platformio/managers/core.py index c34da52b..b626a439 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -28,7 +28,7 @@ CORE_PACKAGES = { "contrib-pysite": ">=0.3.2,<2", "tool-pioplus": "^1.5.0", "tool-unity": "~1.20403.0", - "tool-scons": "~2.20501.6" + "tool-scons": "~2.20501.7" } PIOPLUS_AUTO_UPDATES_MAX = 100