diff options
author | Zhao, ZhiqiangX <zhiqiangx.zhao@intel.com> | 2018-09-12 17:19:26 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-09-25 09:43:51 +0800 |
commit | 0fd04efd01b0b3b8f05048343ab5f6109c66e07a (patch) | |
tree | d858e07f69e505bf284129a6523f3c57b5cd3b27 /BaseTools/Source/Python/Workspace | |
parent | b602265d559b2f2ade4d09ba55652c23922c141f (diff) | |
download | edk2-0fd04efd01b0b3b8f05048343ab5f6109c66e07a.tar.gz edk2-0fd04efd01b0b3b8f05048343ab5f6109c66e07a.tar.bz2 edk2-0fd04efd01b0b3b8f05048343ab5f6109c66e07a.zip |
BaseTools: Latter full value should overwrite the former field value.
For structure Pcd, the latter full assign value in commandLine should
override the former field assign value. For example in commandLine,
build --pcd Token.pcd.field="haha" --pcd Token.pcd=H"{0x01,0x02}",
the former field value "haha" will be ignored and overwrite by the latter
full value "{0x01,0x02}".
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: ZhiqiangX Zhao <zhiqiangx.zhao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace')
-rw-r--r-- | BaseTools/Source/Python/Workspace/DscBuildData.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 506ec0688f..ac0f0bee47 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1067,6 +1067,23 @@ class DscBuildData(PlatformBuildClassObject): PcdItem = BuildData.Pcds[key]
if (TokenSpaceGuidCName, TokenCName) == (PcdItem.TokenSpaceGuidCName, PcdItem.TokenCName) and FieldName =="":
PcdItem.DefaultValue = pcdvalue
+ #In command line, the latter full assign value in commandLine should override the former field assign value.
+ #For example, --pcd Token.pcd.field="" --pcd Token.pcd=H"{}"
+ delete_assign = []
+ field_assign = {}
+ if GlobalData.BuildOptionPcd:
+ for pcdTuple in GlobalData.BuildOptionPcd:
+ TokenSpaceGuid, Token, Field = pcdTuple[0], pcdTuple[1], pcdTuple[2]
+ if Field:
+ if (TokenSpaceGuid, Token) not in field_assign:
+ field_assign[TokenSpaceGuid, Token] = []
+ field_assign[TokenSpaceGuid, Token].append(pcdTuple)
+ else:
+ if (TokenSpaceGuid, Token) in field_assign:
+ delete_assign.extend(field_assign[TokenSpaceGuid, Token])
+ field_assign[TokenSpaceGuid, Token] = []
+ for item in delete_assign:
+ GlobalData.BuildOptionPcd.remove(item)
@staticmethod
def HandleFlexiblePcd(TokenSpaceGuidCName, TokenCName, PcdValue, PcdDatumType, GuidDict, FieldName=''):
|