[Qbs] Exporting libraries to link only for MinGW

Björn Schäpers qt-maillist at hazardy.de
Fri Feb 21 22:17:22 CET 2020


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,

More information about the Qbs mailing list