mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Fixed an issue with the LDF when recursively scanning dependencies in the "chain" mode
This commit is contained in:
@ -39,6 +39,7 @@ PlatformIO Core 6
|
||||
* Fixed an issue when the `build_unflags <https://docs.platformio.org/en/latest/projectconf/section_env_build.html#build-unflags>`__ operation ignores a flag value (`issue #4309 <https://github.com/platformio/platformio-core/issues/4309>`_)
|
||||
* Fixed an issue when the `build_unflags <https://docs.platformio.org/en/latest/projectconf/section_env_build.html#build-unflags>`__ option was not applied to the ``ASPPFLAGS`` scope
|
||||
* Fixed an issue on Windows OS when flags were wrapped to the temporary file while generating the `Compilation database "compile_commands.json" <https://docs.platformio.org/en/latest/integration/compile_commands.html>`__
|
||||
* Fixed an issue with the `LDF <https://docs.platformio.org/en/latest/librarymanager/ldf.html>`__ when recursively scanning dependencies in the ``chain`` mode
|
||||
|
||||
6.0.2 (2022-06-01)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
@ -318,19 +318,12 @@ class LibBuilderBase:
|
||||
)
|
||||
|
||||
def get_search_files(self):
|
||||
items = [
|
||||
return [
|
||||
os.path.join(self.src_dir, item)
|
||||
for item in self.env.MatchSourceFiles(self.src_dir, self.src_filter)
|
||||
]
|
||||
include_dir = self.include_dir
|
||||
if include_dir:
|
||||
items.extend(
|
||||
[
|
||||
os.path.join(include_dir, item)
|
||||
for item in self.env.MatchSourceFiles(include_dir)
|
||||
]
|
||||
for item in self.env.MatchSourceFiles(
|
||||
self.src_dir, self.src_filter, piotool.SRC_BUILD_EXT
|
||||
)
|
||||
return items
|
||||
]
|
||||
|
||||
def _get_found_includes( # pylint: disable=too-many-branches
|
||||
self, search_files=None
|
||||
@ -366,24 +359,28 @@ class LibBuilderBase:
|
||||
tuple(include_dirs),
|
||||
depth=self.CCONDITIONAL_SCANNER_DEPTH,
|
||||
)
|
||||
# mark candidates already processed via Conditional Scanner
|
||||
self._processed_files.extend(
|
||||
[
|
||||
c.get_abspath()
|
||||
for c in candidates
|
||||
if c.get_abspath() not in self._processed_files
|
||||
]
|
||||
)
|
||||
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
if self.verbose and "+" in self.lib_ldf_mode:
|
||||
sys.stderr.write(
|
||||
"Warning! Classic Pre Processor is used for `%s`, "
|
||||
"advanced has failed with `%s`\n" % (path, e)
|
||||
)
|
||||
candidates = LibBuilderBase.CLASSIC_SCANNER(
|
||||
self.env.File(path), self.env, tuple(include_dirs)
|
||||
candidates = self.env.File(path).get_implicit_deps(
|
||||
self.env,
|
||||
LibBuilderBase.CLASSIC_SCANNER,
|
||||
lambda _: tuple(include_dirs),
|
||||
)
|
||||
|
||||
# mark candidates already processed
|
||||
self._processed_files.extend(
|
||||
[
|
||||
c.get_abspath()
|
||||
for c in candidates
|
||||
if c.get_abspath() not in self._processed_files
|
||||
]
|
||||
)
|
||||
|
||||
# print(path, [c.get_abspath() for c in candidates])
|
||||
for item in candidates:
|
||||
if item not in result:
|
||||
@ -415,11 +412,12 @@ class LibBuilderBase:
|
||||
|
||||
lib_inc_map = {}
|
||||
for inc in self._get_found_includes(search_files):
|
||||
inc_path = inc.get_abspath()
|
||||
for lb in self.env.GetLibBuilders():
|
||||
if inc.get_abspath() in lb:
|
||||
if inc_path in lb:
|
||||
if lb not in lib_inc_map:
|
||||
lib_inc_map[lb] = []
|
||||
lib_inc_map[lb].append(inc.get_abspath())
|
||||
lib_inc_map[lb].append(inc_path)
|
||||
break
|
||||
|
||||
for lb, lb_search_files in lib_inc_map.items():
|
||||
@ -878,16 +876,6 @@ class ProjectAsLibBuilder(LibBuilderBase):
|
||||
def src_dir(self):
|
||||
return self.env.subst("$PROJECT_SRC_DIR")
|
||||
|
||||
def get_include_dirs(self):
|
||||
include_dirs = []
|
||||
project_include_dir = self.env.subst("$PROJECT_INCLUDE_DIR")
|
||||
if os.path.isdir(project_include_dir):
|
||||
include_dirs.append(project_include_dir)
|
||||
for include_dir in super().get_include_dirs():
|
||||
if include_dir not in include_dirs:
|
||||
include_dirs.append(include_dir)
|
||||
return include_dirs
|
||||
|
||||
def get_search_files(self):
|
||||
items = []
|
||||
build_type = self.env.GetBuildType()
|
||||
|
@ -309,10 +309,15 @@ platform = native
|
||||
"""
|
||||
)
|
||||
test_dir = project_dir.mkdir("test")
|
||||
test_dir.join("test_main.c").write(
|
||||
test_dir.join("test_main.h").write(
|
||||
"""
|
||||
#include <stdio.h>
|
||||
#include <unity.h>
|
||||
"""
|
||||
)
|
||||
test_dir.join("test_main.c").write(
|
||||
"""
|
||||
#include "test_main.h"
|
||||
|
||||
void setUp(){
|
||||
printf("setUp called");
|
||||
|
Reference in New Issue
Block a user