forked from platformio/platformio-core
Fixed an issue when `"libArchive": false` in "library.json" does not work // Resolve #3403
This commit is contained in:
1 parent
3a27fbc883
commit
59e1c88726
5 files changed
+12
-7
No files matched your search
@@ -717,9 +717,11 @@ class PlatformIOLibBuilder(LibBuilderBase):
|
||||
|
||||
@property
|
||||
def lib_archive(self):
|
||||
unique_value = "_not_declared_%s" % id(self)
|
||||
global_value = self.env.GetProjectOption("lib_archive", unique_value)
|
||||
if global_value != unique_value:
|
||||
missing = object()
|
||||
global_value = self.env.GetProjectConfig().getraw(
|
||||
"env:" + self.env["PIOENV"], "lib_archive", missing
|
||||
)
|
||||
if global_value != missing:
|
||||
return global_value
|
||||
return self._manifest.get("build", {}).get(
|
||||
"libArchive", LibBuilderBase.lib_archive.fget(self)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from platformio.project.config import ProjectConfig, ProjectOptions
|
||||
from platformio.project.config import MISSING, ProjectConfig, ProjectOptions
|
||||
|
||||
|
||||
def GetProjectConfig(env):
|
||||
@@ -25,7 +25,7 @@ def GetProjectOptions(env, as_dict=False):
|
||||
return env.GetProjectConfig().items(env=env["PIOENV"], as_dict=as_dict)
|
||||
|
||||
|
||||
def GetProjectOption(env, option, default=None):
|
||||
def GetProjectOption(env, option, default=MISSING):
|
||||
return env.GetProjectConfig().get("env:" + env["PIOENV"], option, default)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user