Closed okwasniewski closed 7 months ago
This would make sense if we had swift bindings directory to maybe put it there. But otherwise it really makes no sense to add this to repo.
Hey @bkaradzic,
Maybe I didn't explain my motivation correctly. We are working on extending bgfx support for rendering on Apple Vision Pro in Immersive Spaces. Having module maps is not going to benefit only Swift C++ Interop this is a general feature of Clang modules (https://clang.llvm.org/docs/Modules.html#module-maps) which can improve build times, provide a better structure and as mentioned before allow Swift users to use BGFX without any other bindings. I saw other projects with Swift bindings (https://github.com/SwiftGFX/SwiftBGFX) but they are unmantained and this allows to use bgfx with Swift code without any additional bindings.
Yeah, I would prefer that file is located in bindings/swift directory or something similar. Not where C/C++ includes are.
Would bindings/C++ work as a location, since this is still a purely C++ language feature being used for interop? That is, this should also work in GCC and VC++ when their C++2a support std flag is enabled.
Currently bgfx is C++17 only.
Basically we don't need this feature...
This PR adds a module map that allows the use of BGFX together with Swift C++ interop (https://www.swift.org/documentation/cxx-interop/#creating-a-clang-module).
Example: