[Qbs] Exporting libraries to link only for MinGW
NIkolai Marchenko
enmarantispam at gmail.com
Fri Feb 21 22:28:32 CET 2020
You don't need a group here in the first place. Just
cpp.dynamicLibraries: {
var libs = [];
if(qbs.toolchain.contains("mingw"))
libs = libs.concat(["pthread", "ole32"] )
return libs;
}
On Sat, Feb 22, 2020 at 12:17 AM Björn Schäpers <qt-maillist at hazardy.de>
wrote:
> Hi,
>
> I'm trying to incorporate Howard Hinnant's date library and he states
> "mingw users: -lpthread and -lole32 are required"
>
> So I tried
>
> StaticLibrary {
> files: ["date/include/date/*.h", "date/src/*.cpp"]
> name: "date"
>
> Depends { name: "cpp" }
>
> cpp.cxxLanguageVersion: "c++17"
> cpp.defines: ["HAS_REMOTE_API=0","AUTO_DOWNLOAD=0","INSTALL=."]
> cpp.includePaths: ["date/include"]
>
> Export {
> Depends { name: "cpp" }
>
> cpp.defines: product.cpp.defines
> cpp.includePaths: ["date/include"]
>
> Group {
> condition: qbs.toolchain.contains("mingw")
>
> cpp.dynamicLibraries: ["pthread", "ole32"]
> }
> }
> }
>
> But that doesn't work, even though QtCreator shows the Group as active. It
> doesn't matter to what I change the condition, only when I remove the
> Group at
> all the Libraries are added to the link command.
>
> How do I correctly state these dependencies?
>
> Best regards,
> Björn.
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> https://lists.qt-project.org/listinfo/qbs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20200222/3354f7ef/attachment.html>
More information about the Qbs
mailing list