Automatically enable LDF dependency chain+ mode (evaluates C/C++ Preprocessor conditional syntax) for Arduino library when “library.properties” has “depends” field // Resolve #3607

This commit is contained in:
Ivan Kravets committed 2020-07-21 12:41:38 +03:00
1 parent 1ed462a29a
commit ea30d94324
3 files changed
+22 -1

No files matched your search

+20
View File
@@ -507,6 +507,26 @@ class ArduinoLibBuilder(LibBuilderBase):
src_filter.append("+<utility%s*.%s>" % (sep, ext))
return src_filter
@property
def dependencies(self):
# do not include automatically all libraries for build
# chain+ will decide later
return None
@property
def lib_ldf_mode(self):
if not self._manifest.get("dependencies"):
return LibBuilderBase.lib_ldf_mode.fget(self)
missing = object()
global_value = self.env.GetProjectConfig().getraw(
"env:" + self.env["PIOENV"], "lib_ldf_mode", missing
)
if global_value != missing:
return LibBuilderBase.lib_ldf_mode.fget(self)
# automatically enable C++ Preprocessing in runtime
# (Arduino IDE has this behavior)
return "chain+"
def is_frameworks_compatible(self, frameworks):
return util.items_in_list(frameworks, ["arduino", "energia"])