@@ -1075,6 +1075,53 @@ function Build-CMakeProject {
10751075 } else {
10761076 TryAdd- KeyValue $Defines CMAKE_Swift_COMPILER (Join-Path - Path (Get-PinnedToolchainTool ) - ChildPath " swiftc.exe" )
10771077 }
1078+
1079+ $DebugSwiftC = $Defines [" CMAKE_Swift_COMPILER" ]
1080+ Write-Host " DEBUG DEBUG DEBUG CMAKE_Swift_COMPILER: $DebugSwiftC "
1081+ $SwiftCDepDlls = dumpbin / Dependents $DebugSwiftC
1082+ Write-Host " DEBUG DEBUG DEBUG SwiftCDepDlls: $SwiftCDepDlls "
1083+ $SwiftCImports = dumpbin / Imports $DebugSwiftC
1084+ Write-Host " DEBUG DEBUG DEBUG SwiftCImports: $SwiftCImports "
1085+
1086+ $BinFolder = Split-Path $DebugSwiftC
1087+ Write-Host " DEBUG DEBUG DEBUG BinFolder: $BinFolder "
1088+ $DumpChildren = Get-ChildItem $BinFolder
1089+ Write-Host " DEBUG DEBUG DEBUG DumpChildren: $DumpChildren "
1090+
1091+ $SwiftDriver = Join-Path - Path $BinFolder - ChildPath " swift-driver.exe"
1092+ Write-Host " DEBUG DEBUG DEBUG SwiftDriver: $SwiftDriver "
1093+ $SwiftDriverDepDlls = dumpbin / Dependents $SwiftDriver
1094+ Write-Host " DEBUG DEBUG DEBUG SwiftDriverDepDlls: $SwiftDriverDepDlls "
1095+ $SwiftDriverImports = dumpbin / Imports $SwiftDriver
1096+ Write-Host " DEBUG DEBUG DEBUG SwiftDriverImports: $SwiftDriverImports "
1097+
1098+ $Dlls = @ (
1099+ " swiftCore.dll"
1100+ " swift_Concurrency.dll"
1101+ " swiftWinSDK.dll"
1102+ " swiftCRT.dll"
1103+ " Foundation.dll"
1104+ " swiftDispatch.dll"
1105+ " BlocksRuntime.dll"
1106+ )
1107+
1108+ foreach ($Dll in $Dlls ) {
1109+ $DllPath = Join-Path - Path $BinFolder - ChildPath $Dll
1110+ if (-Not (Test-Path $DllPath )) {
1111+ # Search through PATH to find the DLL
1112+ $DllPath = Get-Command $Dll - ErrorAction SilentlyContinue
1113+ if ($DllPath ) {
1114+ $DllPath = $DllPath.Path
1115+ } else {
1116+ Write-Host " DEBUG DEBUG DEBUG Could not find ${Dll} in PATH"
1117+ continue
1118+ }
1119+ }
1120+ Write-Host " DEBUG DEBUG DEBUG Found ${Dll} : $DllPath "
1121+ $DllExports = dumpbin / exports $DllPath
1122+ Write-Host " DEBUG DEBUG DEBUG DllExports for ${Dll} : $DllExports "
1123+ }
1124+
10781125 if (-not ($Platform -eq " Windows" )) {
10791126 TryAdd- KeyValue $Defines CMAKE_Swift_COMPILER_WORKS = " YES"
10801127 }
0 commit comments