Allow to control maximum depth of nested includes for conditional PreProcessor

This commit is contained in:
Ivan Kravets
2018-03-08 16:29:09 +02:00
parent 105cd0fa71
commit 7e875553c2
2 changed files with 10 additions and 2 deletions

View File

@ -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(

View File

@ -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