mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Allow to control maximum depth of nested includes for conditional PreProcessor
This commit is contained in:
@ -91,6 +91,11 @@ class LibBuilderBase(object):
|
||||
|
||||
CLASSIC_SCANNER = SCons.Scanner.C.CScanner()
|
||||
CCONDITIONAL_SCANNER = SCons.Scanner.C.CConditionalScanner()
|
||||
# Max depth of nested includes:
|
||||
# -1 = unlimited
|
||||
# 0 - disabled nesting
|
||||
# >0 - number of allowed nested includes
|
||||
CCONDITIONAL_SCANNER_DEPTH = 99
|
||||
PARSE_SRC_BY_H_NAME = True
|
||||
|
||||
_INCLUDE_DIRS_CACHE = None
|
||||
@ -344,7 +349,10 @@ class LibBuilderBase(object):
|
||||
try:
|
||||
assert "+" in self.lib_ldf_mode
|
||||
incs = LibBuilderBase.CCONDITIONAL_SCANNER(
|
||||
self.env.File(path), self.env, tuple(include_dirs))
|
||||
self.env.File(path),
|
||||
self.env,
|
||||
tuple(include_dirs),
|
||||
depth=self.CCONDITIONAL_SCANNER_DEPTH)
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
if self.verbose and "+" in self.lib_ldf_mode:
|
||||
sys.stderr.write(
|
||||
|
@ -25,7 +25,7 @@ CORE_PACKAGES = {
|
||||
"contrib-pysite": ">=0.1.5,<2",
|
||||
"tool-pioplus": ">=0.14.3,<2",
|
||||
"tool-unity": "~1.20302.1",
|
||||
"tool-scons": "~2.20501.3"
|
||||
"tool-scons": "~2.20501.4"
|
||||
}
|
||||
|
||||
PIOPLUS_AUTO_UPDATES_MAX = 100
|
||||
|
Reference in New Issue
Block a user