forked from platformio/platformio-core
LDF: Stop handling "define" and "undef" when condition fails; handle CPP files in "chain+" and "deep+" modes // Resolve #1930
This commit is contained in:
@ -347,7 +347,7 @@ class LibBuilderBase(object):
|
|||||||
for path in self._validate_search_files(search_files):
|
for path in self._validate_search_files(search_files):
|
||||||
try:
|
try:
|
||||||
assert "+" in self.lib_ldf_mode
|
assert "+" in self.lib_ldf_mode
|
||||||
incs = LibBuilderBase.CCONDITIONAL_SCANNER(
|
candidates = LibBuilderBase.CCONDITIONAL_SCANNER(
|
||||||
self.env.File(path),
|
self.env.File(path),
|
||||||
self.env,
|
self.env,
|
||||||
tuple(include_dirs),
|
tuple(include_dirs),
|
||||||
@ -357,26 +357,26 @@ class LibBuilderBase(object):
|
|||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
"Warning! Classic Pre Processor is used for `%s`, "
|
"Warning! Classic Pre Processor is used for `%s`, "
|
||||||
"advanced has failed with `%s`\n" % (path, e))
|
"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))
|
self.env.File(path), self.env, tuple(include_dirs))
|
||||||
incs = []
|
|
||||||
for inc in _incs:
|
# print(path, map(lambda n: n.get_abspath(), candidates))
|
||||||
incs.append(inc)
|
for item in candidates:
|
||||||
if not self.PARSE_SRC_BY_H_NAME:
|
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
|
continue
|
||||||
_h_path = inc.get_abspath()
|
_c_path = self.env.File("%s.%s" % (_f_part, ext))
|
||||||
if not self.env.IsFileWithExt(_h_path,
|
if _c_path not in result:
|
||||||
piotool.SRC_HEADER_EXT):
|
result.append(_c_path)
|
||||||
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)
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def depend_recursive(self, lb, search_files=None):
|
def depend_recursive(self, lb, search_files=None):
|
||||||
|
@ -28,7 +28,7 @@ CORE_PACKAGES = {
|
|||||||
"contrib-pysite": ">=0.3.2,<2",
|
"contrib-pysite": ">=0.3.2,<2",
|
||||||
"tool-pioplus": "^1.5.0",
|
"tool-pioplus": "^1.5.0",
|
||||||
"tool-unity": "~1.20403.0",
|
"tool-unity": "~1.20403.0",
|
||||||
"tool-scons": "~2.20501.6"
|
"tool-scons": "~2.20501.7"
|
||||||
}
|
}
|
||||||
|
|
||||||
PIOPLUS_AUTO_UPDATES_MAX = 100
|
PIOPLUS_AUTO_UPDATES_MAX = 100
|
||||||
|
Reference in New Issue
Block a user