Help using the TFT_eSPI Arduino library on ESP32 with Swift

I am currently trying to port code using the Arduino TFT_eSPI library, which also works on ESP32, to Swift. However, I get errors related to undefined constants/C enum members in the library. When just using the ESP32 Arduino bridge and TFT_eSPI, everything compiles, but the Swift compiler's stricter rules somehow break the library, and I am not proficient enough to solve it by myself.
I also found this topic, which helped fix some of the issues I was getting, but the aforementioned issues with scopes remain.
(Also, can someone tell me how to attach text files, so I can share the stdout of the build process?)

Would be good to see the actual build log / error messages. Btw you can always create a Github gist and post a link, if the forums prevent you from attaching large files.

problems start in line 1917

I fixed the basic typing errors, which seem to disappear when the actual compiler starts (and fails), but still get the same errors for the library.

Ok, so it seems to complain about several macros not being defined in files that they are used in. VS Code "find definition" does, so this is probably a scoping issue.,

Good progress, feel free to post more logs / errors here. The last log seems to fail to compile some C++ source file? (I can't access the full log for some reason.)

Oh, yeah, I moved all logs to the original Gist. Also, I uploaded the code to GitHub. It's a school project, don't question it.

Looks like the errors are coming from the TFT_eSPI library's C code, and are unrelated to Swift:

In file included from /Users/linus/Documents/code/embedded/swift/swiftflag/components/TFT_eSPI/TFT_eSPI.cpp:24:
/Users/linus/Documents/code/embedded/swift/swiftflag/components/TFT_eSPI/Processors/TFT_eSPI_ESP32.c: At global scope:
/Users/linus/Documents/code/embedded/swift/swiftflag/components/TFT_eSPI/Processors/TFT_eSPI_ESP32.c:17:31: error: 'VSPI' was not declared in this scope; did you mean 'SPI'?
   17 |       SPIClass spi = SPIClass(VSPI);

I did actually find an open bugreport and an unmerged PR against this library with the same symptoms:

Looks like you probably need to pick that branch/diff and apply it?

THANK YOU! Now the only remaining errors are GCC errors about "misleading indentation", which are apparently resolved by passing -Wno-misleading-indentation, however, when adding -Xcc -Wno-misleading-indentation to target-compile-options, nothing happens. When adding a nonexistent -Xcc option, however, I get an error, so it IS parsed. I'm just using the wrong method to suppress this warning.

are GCC errors about "misleading indentation", which are apparently resolved by passing -Wno-misleading-indentation, however, when adding -Xcc -Wno-misleading-indentation to target-compile-options, nothing happens.

The project is building both C/C++ code (using GCC) and Swift code (using swiftc, the Swift compiler). This error is coming from a .cpp file, and it's compiled with GCC, and is again unrelated to Swift. Swift flags (-Xcc ...) only have an effect on the Swift compiler.

Again sounds like a defect in the library itself, and I found this open issue about it: Compilation error for ESP32-S3. [-Werror=misleading-indentation] · Issue #3697 · Bodmer/TFT_eSPI · GitHub