This commit adds a rudimentary Swift bindings test to MLIR. The basic model for Swift bindings is very similar to Python, in that they are both hidden behind a CMake flag (in Swift's case, MLIR_ENABLE_BINDINGS_SWIFT), and do not affect the build otherwise.
As a compiled, C-style language, Swift can be more deeply integrated into the build system than Python. Specifically, we can actually create Swift targets in CMake that are more-or-less indistinguishable from C and C++ targets (via add_llvm_executable and friends). This will eventually allow us to develop libraries in Swift that do not require a working Swift compiler to be run (assuming we statically link Swift's standard library).
One downside to adding Swift in this way, is that a few places in LLVM's build system add compile definitions and flags which are not compatible with Swift globally to any LLVM target. I have fixed the few such places where this affected Swift bindings for MLIR by using CMake's COMPILE_LANGUAGE generator feature, which allows us to specify directly that certain options or flags are only relevant to C and C++ sources.
Notably, this commit does not add the bindings themselves, just the initial test case demonstrating compiling a Swift target which depends on an MLIR library. My hope is that I can address feedback about how I am integrating with the build system independently of the bindings themselves, and upon merging this to main perhaps add this path to CI so new flags are not added in a way that is incompatible with Swift.