microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.75k stars 6.29k forks source link

Vcpkg regression: shaderc no longer supports shared library build #16658

Open jmoguillansky-gpsw opened 3 years ago

jmoguillansky-gpsw commented 3 years ago

Describe the bug As a follow up to this issue: https://github.com/microsoft/vcpkg/issues/16122, seems that shaderc shared library is no longer built?

Environment

To Reproduce Steps to reproduce the behavior:

  1. ./vcpkg install shaderc:x64-windows
  2. See error -- Note: shaderc only supports static library linkage. Building static library."

Expected behavior Shaderc vcpkg used to support both static and shared lib build, now it seems that only static lib is supported?

Failure logs -(please attached failure logs)

Additional context Add any other context about the problem here.

Package: shaderc:x64-windows Vcpkg version: 2021-01-13-d67989bce1043b98092ac45996a8230a059a2d7e

NancyLi1013 commented 3 years ago

Hi @jmoguillansky-gpsw

Thanks for posting this issue. Currently shaderc only supports static build. Please see

#Note: glslang and spir tools doesn't export symbol and need to be build as static lib for cmake to work
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

https://github.com/microsoft/vcpkg/blob/master/ports/shaderc/portfile.cmake#L1-L2

Generally, vcpkg supports both static and dynamic builds. But for some ports, they only support static or dynamic build, which is related with the ports themselves.

So the current behavior is expected.

jmoguillansky-gpsw commented 3 years ago

Hi, I saw that comment. Shaderc upstream supports shared library build. Its not a shaderc issue. In the most recent commit vcpkg disabled shaderc shared library build. Its a vcpkg issue

dg0yt commented 8 months ago

This should be revisited. Probably it never was a problem for non-MSVC, and now there is also dllexport: https://github.com/google/shaderc/blob/aaa44b544909600381e1a180074ed7f544e48410/libshaderc/include/shaderc/visibility.h#L21-L25