@@ -1075,6 +1075,51 @@ function Build-CMakeProject {
1075
1075
} else {
1076
1076
TryAdd- KeyValue $Defines CMAKE_Swift_COMPILER (Join-Path - Path (Get-PinnedToolchainTool ) - ChildPath " swiftc.exe" )
1077
1077
}
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
+
1096
+ $Dlls = @ (
1097
+ " swiftCore.dll"
1098
+ " swift_Concurrency.dll"
1099
+ " swiftWinSDK.dll"
1100
+ " swiftCRT.dll"
1101
+ " Foundation.dll"
1102
+ " swiftDispatch.dll"
1103
+ " BlocksRuntime.dll"
1104
+ )
1105
+
1106
+ foreach ($Dll in $Dlls ) {
1107
+ $DllPath = Join-Path - Path $BinFolder - ChildPath $Dll
1108
+ if (-Not (Test-Path $DllPath )) {
1109
+ # Search through PATH to find the DLL
1110
+ $DllPath = Get-Command $Dll - ErrorAction SilentlyContinue
1111
+ if ($DllPath ) {
1112
+ $DllPath = $DllPath.Path
1113
+ } else {
1114
+ Write-Host " DEBUG DEBUG DEBUG Could not find ${Dll} in PATH"
1115
+ continue
1116
+ }
1117
+ }
1118
+ Write-Host " DEBUG DEBUG DEBUG Found ${Dll} : $DllPath "
1119
+ $DllExports = dumpbin / exports $DllPath
1120
+ Write-Host " DEBUG DEBUG DEBUG DllExports for ${Dll} : $DllExports "
1121
+ }
1122
+
1078
1123
if (-not ($Platform -eq " Windows" )) {
1079
1124
TryAdd- KeyValue $Defines CMAKE_Swift_COMPILER_WORKS = " YES"
1080
1125
}
0 commit comments