Hi,

How does one use qt6_add_shaders in static libraries?  When running an
application that uses said static library, we get this error messages like
this


Failed to find shader "://shader.vert.qsb"


We're using static linking because the target platform is iOS.  On Windows
where we use dynamic linking, we have no problem.


We follow this practice for qrc resources which works fine
"When embedding resources in static libraries,... explicitly register your
resources by calling Q_INIT_RESOURCE() with the base name of the .qrc file."

https://doc.qt.io/qt-6/resources.html#explicit-loading-and-unloading-of-embedded-resources

How does this relate to shaders added with qt6_add_shaders?  From the
examples we have seen demonstrating qt6_add_resources, it does not seem to
involve qrc.  For example,

https://github.com/qt/qtshadertools/blob/26ffa67b0212255e29ec751bc25ebef65973ee99/tests/auto/buildtimeqsb/CMakeLists.txt

qt6_add_shaders(tst_buildtimeqsb "shaders"
    PREFIX
        "/test"
    FILES
        "color.vert"
        "color.frag"
)

https://github.com/qt/qtshadertools/blob/26ffa67b0212255e29ec751bc25ebef65973ee99/tests/auto/buildtimeqsb/tst_buildtimeqsb.cpp

QShader color_vert = getShader(QLatin1String(":/test/color.vert.qsb"));


(The URI does not have the qrc scheme)


Thanks,

Ranen
-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to