Skip to content

Commit

Permalink
.pytool: CompilerPlugin: Pass through build vars
Browse files Browse the repository at this point in the history
Pass build variables (those passed to build.py through -D) to the DSC
parser to provide a more accurate parsing of the DSC file.

Signed-off-by: Joey Vagedes <[email protected]>
  • Loading branch information
Javagedes authored and mergify[bot] committed Jul 3, 2024
1 parent 6b256ce commit 4f17469
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .pytool/Plugin/CompilerPlugin/CompilerPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, PLM,
self._env.SetValue("ACTIVE_PLATFORM", AP_Path, "Set in Compiler Plugin")

# Parse DSC to check for SUPPORTED_ARCHITECTURES
build_target = self._env.GetValue("TARGET")
input_vars = self._env.GetAllBuildKeyValues(build_target)
dp = DscParser()
dp.SetBaseAbsPath(Edk2pathObj.WorkspacePath)
dp.SetPackagePaths(Edk2pathObj.PackagePathList)
dp.SetEdk2Path(Edk2pathObj).SetInputVars(input_vars)
dp.ParseFile(AP_Path)
if "SUPPORTED_ARCHITECTURES" in dp.LocalVars:
SUPPORTED_ARCHITECTURES = dp.LocalVars["SUPPORTED_ARCHITECTURES"].split('|')
Expand All @@ -85,7 +86,7 @@ def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, PLM,
# Skip if there is no intersection between SUPPORTED_ARCHITECTURES and TARGET_ARCHITECTURES
if len(set(SUPPORTED_ARCHITECTURES) & set(TARGET_ARCHITECTURES)) == 0:
tc.SetSkipped()
tc.LogStdError("No supported architecutres to build")
tc.LogStdError("No supported architectures to build")
return -1

uefiBuilder = UefiBuilder()
Expand Down

0 comments on commit 4f17469

Please sign in to comment.