From 1d06b46cf1d0a6e8a36ac1b790333f3c0f1c3733 Mon Sep 17 00:00:00 2001 From: "Feng, Bob C" Date: Mon, 1 Jul 2019 17:48:51 +0800 Subject: BaseTools: Fixed the issue of the CFlag for compile PcdValueInit.c This issue happens when using Structured PCD. Build tool use set to store the cflags for compile PcdValueInit.c, that is the order of cflags is disorder. This patch make -U, /U flags appear before -D, /D Cc: Liming Gao Signed-off-by: Bob Feng Reviewed-by: Liming Gao --- BaseTools/Source/Python/Workspace/DscBuildData.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 9f65ad5425..985f877525 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -2668,7 +2668,8 @@ class DscBuildData(PlatformBuildClassObject): elif len(ArchBuildOptions.keys()) > 1: CommonBuildOptions = reduce(lambda x,y: x&y, ArchBuildOptions.values()) BuildOptions['COMMON'] |= CommonBuildOptions - ValueList = list(BuildOptions['COMMON']) + ValueList = [item for item in BuildOptions['COMMON'] if item.startswith((r"/U","-U"))] + ValueList.extend([item for item in BuildOptions['COMMON'] if item.startswith((r"/D", "-D"))]) CC_FLAGS += " ".join(ValueList) MakeApp += CC_FLAGS -- cgit v1.2.3