[shaderc] Use build type to build targets#16137
[shaderc] Use build type to build targets#16137ras0219-msft merged 5 commits intomicrosoft:masterfrom
Conversation
Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
|
Waiting for merge #16138. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
This LGTM |
|
Hi @JackBoosY I updated vcpkg to the latest version. It seems that only static shaderc was built. |
|
Seems that this PR disables shaderc shared library build? #Note: glslang and spir tools doesn't export symbol and need to be build as static lib for cmake to work This part doesn't make sense. If glslang and spir-tools require static shaderc then they can link against the static shaderc, that doesn't mean that shaderc doesn't support shared library build? |
|
@jmoguillansky-gpsw For building shared, use command |
Hi @JackBoosY , |
|
@jmoguillansky-gpsw Ops, sorry, I forgot we force it to build as a static library. |
|
The issue is not that glslang and spir-tools require static shaderc -- rather, the problem is that glslang and spir-tools can only be built statically, which means building a shared library for shaderc is extremely suspect (it will contain a duplicate copy of the glslang/spir-tools code along with the main application binary as well as any other consumers). Shaderc consumes glslang, not the other way around. Therefore, until glslang and spir-tools can be built dynamically, we do not want to build shaderc dynamically. |
|
Shaderc upstream supports shared lib build, and its shipped as part of vulkan sdk. There's no issue with shaderc , the tool just decides to use the static lib, thats all |
|
I think there's a broader discussion with regards to vcpkg architecture. Each module doesn't know how it's used, only what it can build. Some executables may choose to always use static lib, some shared lib, etc. From my perspective the vcpkg architecture should accomodate these cases. |
|
Regarding vcpkg integrate install: |
|
glslang and spir-tools only depend on the static library, not dynamic. |
Currently, shaderc has generated dynamic libraries, static libraries and static libraries containing all dependent binaries at the same time.
This PR will:
BUILD_SHARED_LIBS.Partly solved #15452.
Fixes #16122.