gboisse / gfx

A minimalist and easy to use graphics API.
MIT License
498 stars 35 forks source link

CMake: Improve detection of windows kits needed to find d3d12. #135

Closed maoliver-amd closed 4 months ago

maoliver-amd commented 4 months ago

VSCode wasnt working correctly as it failed to find d3d12.lib. This is in part due to cmake not natively knowing where to search for installed windows SDKs. Previously this worked for regular Visual Studio as it internally knows where the SDK is installed and so just passing "d3d12.lib" was enough as it would search for the lib within its know import locations. Outside of msbuild though cmake would fail to find d3d12 and would fail when run from command line or through another environment (anything not targetting an msbuild target).

This PR updates the logic to explicitly search for and find the latest installed Windows Kit and use that to find d3d12 within cmake itself.

maoliver-amd commented 4 months ago

Still needs #114 to fully fix stock compilation issues in VSCode