diff options
author | BobCF <bob.c.feng@intel.com> | 2018-12-07 10:39:52 +0800 |
---|---|---|
committer | BobCF <bob.c.feng@intel.com> | 2018-12-07 10:39:52 +0800 |
commit | 9601046bf4594be981b6ee9f75f81f0bc0e2cf54 (patch) | |
tree | 3ebfab50ccb17fcc16f58e95d388c11f121b7146 /BaseTools | |
parent | bf9e636605188e291d33ab694ff1c5926b6f0800 (diff) | |
download | edk2-9601046bf4594be981b6ee9f75f81f0bc0e2cf54.zip edk2-9601046bf4594be981b6ee9f75f81f0bc0e2cf54.tar.gz edk2-9601046bf4594be981b6ee9f75f81f0bc0e2cf54.tar.bz2 |
BaseTools: Correct CCFLAG for PcdValueInit
https://bugzilla.tianocore.org/show_bug.cgi?id=1361
This patch is going to correct the CCFlag
for building PcdValueInit
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: BobCF <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/Python/Workspace/DscBuildData.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 59d1182..b485c75 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -2352,16 +2352,16 @@ class DscBuildData(PlatformBuildClassObject): def ParseCCFlags(self, ccflag):
ccflags = set()
- flag = ""
- for ch in ccflag:
- if ch in (r"/", "-"):
- if flag.strip():
- ccflags.add(flag.strip())
- flag = ch
- else:
- flag += ch
- if flag.strip():
- ccflags.add(flag.strip())
+ ccflaglist = ccflag.split(" ")
+ i = 0
+ while i < len(ccflaglist):
+ item = ccflaglist[i].strip()
+ if item in (r"/D", r"/U","-D","-U"):
+ ccflags.add(" ".join((ccflaglist[i],ccflaglist[i+1])))
+ i = i+1
+ elif item.startswith((r"/D", r"/U","-D","-U")):
+ ccflags.add(item)
+ i +=1
return ccflags
def GenerateByteArrayValue (self, StructuredPcds):
#
@@ -2488,7 +2488,7 @@ class DscBuildData(PlatformBuildClassObject): if 'COMMON' not in BuildOptions:
BuildOptions['COMMON'] = set()
if Arch == TAB_STAR:
- BuildOptions['COMMON'].add(self.BuildOptions[Options])
+ BuildOptions['COMMON']|= self.ParseCCFlags(self.BuildOptions[Options])
if Arch in self.SupArchList:
if Arch not in BuildOptions:
BuildOptions[Arch] = set()
@@ -2502,7 +2502,7 @@ class DscBuildData(PlatformBuildClassObject): CommonBuildOptions = reduce(lambda x,y: x&y, ArchBuildOptions.values())
BuildOptions['COMMON'] |= CommonBuildOptions
ValueList = list(BuildOptions['COMMON'])
- CC_FLAGS += " ".join([item for item in ValueList if item.startswith(('-D', '/D', '-U', '/U'))])
+ CC_FLAGS += " ".join(ValueList)
MakeApp += CC_FLAGS
if sys.platform == "win32":
|