Try / Tempest

3d graphics engine
MIT License
83 stars 24 forks source link

fix: Add DirectXShaderCompiler to CMakeList.txt #46

Closed Accessory closed 1 year ago

Accessory commented 1 year ago

This helps to find the DirectXShaderCompiler. With this edition the code can compile using vscode and vcpkg

Try commented 1 year ago

Hi, @Accessory and thanks for PR!

Can you please explain a use case here and why this find is needed? On my windows machine there is no issue linking DXC as-is, without find-library.

Accessory commented 1 year ago

I compiled OpenGothic with packages from vcpkg and Visual Studio Community 2022 amd64. Using CMake the Header from the DirectXShaderCompiler could not be found during compilation. I could adjust the Include-Folders so the Compiler could find the Headers. With the

find_package(directx-dxc CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectXShaderCompiler)

the Include-Folders contained all the necessary folders to compile without adjusting the configuration, set environment variables or create my own Include Folder.

Try commented 1 year ago

Merged, thanks!