<div dir="ltr"><div>Ok, I forgot about objective-C, so yes, I will use explicit property.</div><div><br></div><div>Anyway, I got a question, does product.dependencies contains only strict dependencies (specified at Product item), or the list of all dependencies, including deps from dependent products/modules?<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-08-09 12:16 GMT+03:00 Christian Kandeler <span dir="ltr"><<a href="mailto:christian.kandeler@qt.io" target="_blank">christian.kandeler@qt.io</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, 9 Aug 2018 03:53:50 +0300<br>
Иван Комиссаров <<a href="mailto:abbapoh@gmail.com">abbapoh@gmail.com</a>> wrote:<br>
<br>
> Im a bit stuck with protobuf module. I’m trying to make the module behave different for different languages, i.e. generate .cc files for cpp project, java for java project and so on.<br>
> <br>
> I am trying to use product.dependencies[i].name == «cpp» condition. It works in the outputArtifacts section, but i can’t provide a conditionally exported cpp.staticLibraries: ["protobuf»]<br>
<br>
</span>I  assume you are referring to the suggestion in the bug report to auto-detect the target language? I'm not sure this is so valuable, and we could easily guess wrong. What if a project has both a cpp and a Java dependency? What about C++ vs Objective-C? Both come from the cpp module...<br>
I suggest providing a property targetLanguages where the user can set the language(s) explicitly and have matching conditions in the respective rules (or have just one rule, but different ones might be cleaner).<br>
Coming up with a good default value seems a bit tricky, but perhaps we can just leave it empty and inform the user that it needs to be set.<br>
<br>
> Here’s the code <a href="https://pastebin.com/gNMiNg7G" rel="noreferrer" target="_blank">https://pastebin.com/gNMiNg7G</a> <<a href="https://pastebin.com/gNMiNg7G" rel="noreferrer" target="_blank">https://pastebin.com/gNMiNg7G</a><wbr>><br>
<span class="">> <br>
> I tried to tie cpp.staticLibraries to each artifact (but i guess the libraries are ignored for cpp tags) and i tried to use a Properties but it seems my condition function is not called at all (at least, throwing in it makes no result)<br>
<br>
</span>It makes no sense to set cpp.*Libraries on an artifact. The linker rule reads this property from the product level.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Christian<br>
______________________________<wbr>_________________<br>
Qbs mailing list<br>
<a href="mailto:Qbs@qt-project.org">Qbs@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/qbs" rel="noreferrer" target="_blank">http://lists.qt-project.org/<wbr>mailman/listinfo/qbs</a><br>
</div></div></blockquote></div><br></div>