-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tools: Track dependencies properly also for NMAKE on windows
- Loading branch information
Showing
2 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (c) Stefano Cristiano | ||
# SPDX-License-Identifier: MIT | ||
param( | ||
[string]$jsonFilePath, | ||
[string]$objFile | ||
) | ||
|
||
# Read the JSON file | ||
$jsonContent = Get-Content -Raw -Path $jsonFilePath | ConvertFrom-Json | ||
|
||
# Define an array of patterns that indicate system header files | ||
$systemHeaderPatterns = @( | ||
"windows kits", | ||
"microsoft visual studio" | ||
) | ||
|
||
# Get the dependencies, removing system header paths | ||
$dependencies = $jsonContent.Data.Includes | Where-Object { $dependency = $_; -not ($systemHeaderPatterns | Where-Object { $dependency -like "*$_*" }) } | ||
|
||
# Write the dependencies in .d format | ||
Write-Output "${objFile}: \" | ||
foreach ($dependency in $dependencies) { | ||
Write-Output " $dependency \" | ||
} |