Building Swift compiler from source fails when not using Ninja

Now I got this problem, where the build tried to reference the lib/Debug folder instead of the plain Debug folder:

clang: error: no such file or directory: '/Users/philipturner/Documents/Swift-Compiler/swift-project/build/Xcode-DebugAssert/swift-macosx-arm64/lib/Debug/libswiftCompilerModules-bootstrapping1.a'
Command Ld failed with a nonzero exit code

I opened up the Xcode project and pressed Cmd + B. It seems to have encountered that error just as a warning and continued with the build, so hopefully it will work!

Update: the same error happened later on in the build. I just wasted 30% of my MBP's battery on that build when it already started at 80%, and I have a full day ahead!

clang-13: error: no such file or directory: '/Users/philipturner/Documents/Swift-Compiler/swift-project/build/Xcode-DebugAssert/swift-macosx-arm64/lib/Debug/libswiftCompilerModules-bootstrapping1.a'