Closed fredemmott closed 2 years ago
Operator overloading should make most of the functions with the same name already distinct for linkage.
I could add a build option that removes the shared modules in cmake.
What other conflicts have you encountered
Here's a proposed solution:
The conflict I was hitting was for classes like DirectX::SpriteBatch
- where, for example, DirectX::SpriteBatch::~SpriteBatch()
is defined in each library
The inline namespace should fix this at least at link time.
For example, it is useful for an OpenXR API Layer to be able to operate seamlessly with games that use either D3D11 or D3D12, which in turn makes it useful to be able to use both the Direct3D 11 and Direct3D 12 versions of DirectXTK in the same library.
One way to do this would be to add a cmake option, then use
configure_file()
to generate a config.h specifying the namespace as a#define
, defaulting toDirectX
, but making it so I could e.g. specify that I want it built withDirectX12
instead.