From 19fe942c1338fac61b46df4823501a532c1b3d0e Mon Sep 17 00:00:00 2001 From: Christian Fersch Date: Tue, 10 Nov 2020 01:47:21 +0100 Subject: Add support for llvm-objdump to applocal.ps1 (#11898) Co-authored-by: Billy Robert O'Neal III --- scripts/buildsystems/msbuild/applocal.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index f0cb6ee1f..2e8d76cc2 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -86,7 +86,13 @@ function resolve([string]$targetBinary) { } $targetBinaryDir = Split-Path $targetBinaryPath -parent - $a = $(dumpbin /DEPENDENTS $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" }) + if (Get-Command "dumpbin" -ErrorAction SilentlyContinue) { + $a = $(dumpbin /DEPENDENTS $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" }) + } elseif (Get-Command "llvm-objdump" -ErrorAction SilentlyContinue) { + $a = $(llvm-objdump -p $targetBinary| ? { $_ -match "^ {4}DLL Name: .*\.dll" } | % { $_ -replace "^ {4}DLL Name: ","" }) + } else { + Write-Error "Neither dumpbin nor llvm-objdump could be found. Can not take care of dll dependencies." + } $a | % { if ([string]::IsNullOrEmpty($_)) { return -- cgit v1.2.3