[Qbs] How to make 'cpp.link: false' part of the Export item within custom item?

resurrection at centrum.cz resurrection at centrum.cz
Sun Oct 22 09:11:30 CEST 2017


And I will answer myself as the answer was in the Parameters item documentation: http://doc.qt.io/qbs/parameters-item.html
 
______________________________________________________________
> Od: <resurrection at centrum.cz>
> Komu: <qbs at qt-project.org>
> Datum: 22.10.2017 08:24
> Předmět: [Qbs] How to make 'cpp.link: false' part of the
>
Having a custom Item I would like to disable linking to the dynamic library for all those that depend on it since it is a plugin just like what Jake talks about in the 1.9 release blog <http://blog.qt.io/blog/2017/09/05/qbs-1-9-released/>. Qbs generates the warning that cpp.link property was not declared when I place it in the Item's Export child item and the compilation fails with missing lib file. Simplified:
 
MyPluginItem.qbs
DynamicLibrary
{
    Export
    {
        Depends { name: "cpp" }
        cpp.link: false //<---- warning
    }
    Depends { name: "cpp" }
}
 
MyProject.qbs
Project
{
    MyPluginItem
    {
        name: "MyPlugin"
    }
 
    QtApplication
    {
        Depends { name: "MyPlugin" } //<---- does not work, compilation fails with missing MyPlugin.lib
        Depends { name: "MyPlugin"; cpp.link: false } //<---- works
    }
}
 
Is there a way to prevent the linking from the plugin's side short of dropping dependency on the cpp module? I was looking throughout the docs and the cpp.link flag seems the the best option albeit unavailable in the Export item.

 
 ----------
 
 _______________________________________________
 Qbs mailing list
 Qbs at qt-project.org
 http://lists.qt-project.org/mailman/listinfo/qbs <http://lists.qt-project.org/mailman/listinfo/qbs>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20171022/e76b8e02/attachment.html>


More information about the Qbs mailing list