This fixes building for mingw with BUILD_SHARED_LIBS. In static builds, the psapi dependency gets linked in transitively from Support, but when linking Support dynamically, it's revealed that these components also need linking against psapi.
Details
Diff Detail
Event Timeline
I guess this is causing the windows failure on the bot: http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/13320
Yeah, I saw that - highly strange. I'll try to see if I can reproduce similar issues with a similar toolchain, and I'll push a revert soon unless I find some great clue.
Seems like this was nondeterministic? http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/13321 Maybe a dependency issue on the tblgen.exe...
The issue seems to have vanished in the following build, http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/13321, and I built a lldb-tblgen.exe using a fairly new version of MSVC, and that didn't seem to have the same issue ("This version of lldb-tblgen.exe is not compatible with the version of Windows you're running."). And the changes I pushed here shouldn't even affect the build of lldb-tblgen.exe at all. So I'd consider this just a coincidence/fluke for now.