[QBS] Depends and cpp.includePaths

Ruslan Nigmatullin EuroElessar at yandex.ru
Fri Aug 17 12:07:54 CEST 2012



15.08.2012, 20:07, "Ruslan Nigmatullin" <EuroElessar at yandex.ru>:
> 27.02.2012, 23:49, "Oswald Buddenhagen" <oswald.buddenhagen at nokia.com>:
>
>>  On Mon, Feb 27, 2012 at 09:00:54PM +0600, ext Ruslan Nigmatullin wrote:
>>>   Of course, run "qbs -j1" on this project, the issue is that generated
>>>   header doesn't belong to current product:
>>  imo, this should never work out of principle.
>>  if you want to share the generated header across products, you need to
>>  create a source module out of the header - which is unfortunately not
>>  possible yet. see QBS-59.
>>  also, do we even support rules with on input artifacts?
>
> Do I understand idea correctly? Here is a draft of api for module sources, as I understand ModuleSource should provide own artifacts to external products to share build process between them.
> Or it should provide only list of files? But how should we handle in this case possibility of creating several Artifacts on one file, won't be there any conflicts?
>
> // mylibSource.qbs
> ModuleSource {
>         Group {
>                 files: [ "core.h", … ]
>                 fileTags: [ "mylib-devel" ]
>         }
>         Transformer {
>                 files: [ "version.h.in" ]
>                 fileTags: [ "mylib-devel" ]
>                 Artifact {
>                         fileTags: [ "hpp" ]
>                         fileName: "include/mylib/version.h"
>                 }
>                 prepare: {
>                         // Generation logic
>                 }
>         }
>         Rule {
>                 inputs: [ "mylib-devel" ]
>                 Artifact {
>                         fileTags: [ "hpp" ]
>                         fileName: "include/mylib/" + input.fileName
>                 }
>                 prepare: {
>                         // installation
>                 }
>         }
> }
>
> // mylib.qbs
> DynamicLibrary {
>         name: "mylib"
>         Depends { name: "cpp" }
>         // We use generated version.h from cpp files
>         Depends { name: "mylib-devel" }
>         files: [ "core.cpp", "version.cpp", … ]
>         ProductModule {
>                 Depends { name: "cpp" }
>                 // We want other products to depend on this headers
>                 Depends { name: "mylib-devel" }
>         }
> }

I've tried to implement this one and faced with issue that Artifact has to belong to some product (at least with current design, the only exclusion is file dependancies). So how should I make this artifacts a part of a Product? May be it's possible to create pseudo-artifacts (which would be something like symbolic links to real on). Or I should fix code to Artifacts be able to belong to several products or even to source module (and resolve products through modules dependancies)?



More information about the Qbs mailing list