microsoft / ShaderConductor

ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages
MIT License
1.77k stars 250 forks source link

Static Library support #46

Closed Tetrago closed 5 years ago

Tetrago commented 5 years ago

Is your feature request related to a problem? Please describe. If I want to create a portable tool that has shader conversion support, or if I want to add the ability to generate shader code to a library, I need to worry about the DLLs.

Describe the solution you'd like Use of BUILD_SHARED_LIBS in cmake or something. Whatever is easiest to implment.

Describe alternatives you've considered N/A

Additional context N/A

gongminmin commented 5 years ago

However, dxcompiler is DLL, which can't be changed. Even if ShaderConductor is lib, you still need to move DLLs. The down side of lib is you need link 6 other libs from SPIRV-Cross into every exes, instead of just 1. Also, when using lib, you need to have exactly the same compiler options with exes, which is harder to maintain than just use one set of options in DLL.