Update Build tool to get build rule by BuildRuleFamily and ToolChainFamily.
authorlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 9 Jul 2009 01:22:05 +0000 (01:22 +0000)
committerlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 9 Jul 2009 01:22:05 +0000 (01:22 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1641 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/AutoGen/AutoGen.py

index 57d9342..68c9967 100755 (executable)
@@ -1536,13 +1536,21 @@ class ModuleAutoGen(AutoGen):
             BuildRules = {}
             BuildRuleDatabase = self.PlatformInfo.BuildRule
             for Type in BuildRuleDatabase.FileTypeList:
+                #first try getting build rule by BuildRuleFamily
                 RuleObject = BuildRuleDatabase[Type, self.BuildType, self.Arch, self.BuildRuleFamily]
                 if not RuleObject:
                     # build type is always module type, but ...
                     if self.ModuleType != self.BuildType:
                         RuleObject = BuildRuleDatabase[Type, self.ModuleType, self.Arch, self.BuildRuleFamily]
+                #second try getting build rule by ToolChainFamily
+                if not RuleObject:
+                    RuleObject = BuildRuleDatabase[Type, self.BuildType, self.Arch, self.ToolChainFamily]
                     if not RuleObject:
-                        continue
+                        # build type is always module type, but ...
+                        if self.ModuleType != self.BuildType:
+                            RuleObject = BuildRuleDatabase[Type, self.ModuleType, self.Arch, self.ToolChainFamily]
+                if not RuleObject:
+                    continue
                 RuleObject = RuleObject.Instantiate(self.Macros)
                 BuildRules[Type] = RuleObject
                 for Ext in RuleObject.SourceFileExtList: