QBS: Debug output



  • Does QBS have any way to output XML (or makefile, or any kind of readable format) data for what it has decided to do?

    I am trying to port some existing libraries over to QBS... And am finding the lack of any kind of debugging a problem...

    I have two libraries, one depends on the other, the first library exports some include paths. These exported paths don't seem to be picked up in the second library... but I have no idea why (if i set cpp.includedPaths in the second library does it override the Export { ... } data??)

    I notice there is something called the QBS shell in the docs... but cant quite work out how to use it - the docs just suggest using "qbs shell" then i get a prompt with no help.



  • Hi,

    you need to merge the lists:
    cpp.includePaths: base.includePaths.concat([...])
    "base" always refers to the inherited value of the module property on the left-hand side.
    Regarding debugging output, you can get it via the "-v" switch (use twice for even more information). It's probably not of too much use to users, I think (as opposed to qbs developers).
    "qbs shell" just gives you a shell with a product-specific environment.

    Christian



  • thanks, ill have a go with this tonight



  • Hmm...

    I put together a test case:
    https://dl.dropboxusercontent.com/u/28029790/test.zip

    in summary:

    A/a.qbs:
    @
    DynamicLibrary {
    Depends { name: "cpp" }

    cpp.includePaths: [ "." ]
    files: [ "*.h" ]
    
    Export {
        cpp.includePaths: [ "." ]
    }
    

    }
    @

    B/b.qbs
    @
    DynamicLibrary {
    Depends { name: "cpp" }

    Depends { name: "A" }
    
    cpp.includePaths: base.concat( [ "." ] )
    
    files: [ "./*.cpp" ]
    

    }
    @

    C.qbs
    @
    Project {
    references: [
    "A/A.qbs",
    "B/B.qbs"
    ]
    }
    @

    The compile string that ends up being used (and failing), is

    C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64/cl.exe /nologo /c /EHsc /O2 /MD /IC:\Users\Jorj\project\test\B /DNDEBUG /DUNICODE /D_UNICODE /FoC:\Users\Jorj\project\C-build\qtc_Qt_5_0_2_msvc2012_64-release.obj\B\Pork.cpp.obj C:\Users\Jorj\project\test\B\Pork.cpp

    which only contains the include path for the descendant library...

    (i also tried absolute paths for the includePaths - it didnt seem to help, even though i don't think it is required?)

    I have tried poking around in the qbs source, but got lost when trying to trace where "modules", come from, in order to bake them into the include path list...



  • Don't use "." in the Export item, it will be interpreted at the point of import. Say "cpp.includePaths: [path]" instead, which refers to the directory the project file is in.



  • Ah ok, ill have another go...

    I think i copied this from an example... possibly here:

    http://doc-snapshot.qt-project.org/qbs/export-item.html

    Is there an example/unit test using Export items? if not can i submit one?



  • Taking a second look, the problem could also be a missing cpp dependency in the Export item; i.e. if you use cpp properties there, you also have to add the respective Depends item. There are currently insufficient checks in some contexts, so it could be that without the Depends item, the property binding is silently ignored (instead of an error being raised).



  • Yes, that works great!

    So, i changed A/A.qbs to:
    @
    DynamicLibrary {

    cpp.includePaths: [ "." ]
    files: [ "*.h" ]
    
    Export {
        Depends { name: "cpp" }
        cpp.includePaths: [ "." ]
    }
    

    }
    @

    And both include paths come through,

    Thanks!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.