<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks Christian, that's really helpful!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I think I almost got it to work. The problem I have now is that the app seems to link against the wrong version of the library:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff">
<span style="font-variant-ligatures: no-common-ligatures">ld: warning: ignoring file /.../lib.eyJwcm9maWxlIjoiaG9zdFByb2ZpbGUifQ--.cd69e9f1/.tmp/lib, building for iOS-arm64 but attempting to link with file built for macOS-x86_64</span></p>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I tried setting the profile for the app to "targetProfile" but it makes no difference. Also no bundles are generated for the library. There's only the binary in the hidden .tmp folder.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Here's a small test project I set up that has the issue. Note that I have to set qbs.targetPlatform to "macos" because qbs.hostPlatform is undefined. The docs only say '<span style="caret-color: rgb(64, 66, 68); color: rgb(64, 66, 68); font-family: "Titillium Web", Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important">Do
 not use this property'.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Project {<br>
</span>
<div>    Profile {<br>
</div>
<div>        name: "hostProfile"<br>
</div>
<div>        qbs.targetPlatform: "macos"<br>
</div>
<div>    }<br>
</div>
<div><br>
</div>
<div>    Profile {<br>
</div>
<div>        name: "targetProfile"<br>
</div>
<div>        baseProfile: project.profile<br>
</div>
<div>    }<br>
</div>
<div><br>
</div>
<div>    DynamicLibrary {<br>
</div>
<div>        name: "lib"<br>
</div>
<div>        files: ["lib.cpp"]<br>
</div>
<div>        multiplexByQbsProperties: ["profiles"]<br>
</div>
<div><br>
</div>
<div>        qbs.profiles: ["hostProfile", "targetProfile"]<br>
</div>
<div><br>
</div>
<div>        Depends { name: "cpp" }<br>
</div>
<div>    }<br>
</div>
<div><br>
</div>
<div>    CppApplication {<br>
</div>
<div>        consoleApplication: true<br>
</div>
<div>        name: "gen"<br>
</div>
<div>        files: ["gen.cpp"]<br>
</div>
<div><br>
</div>
<div>        qbs.profile: "hostProfile"<br>
</div>
<div><br>
</div>
<div>        Depends { name: "lib" }<br>
</div>
<div>    }<br>
</div>
<div><br>
</div>
<div>    CppApplication {<br>
</div>
<div>        name: "app"<br>
</div>
<div>        files: ["gen.cpp"]<br>
</div>
<div><br>
</div>
<div>        Depends { name: "lib" }<br>
</div>
<div>    }<br>
</div>
<span>}</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Leon</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Qbs <qbs-bounces@qt-project.org> on behalf of Christian Kandeler <christian.kandeler@qt.io><br>
<b>Sent:</b> Friday, March 20, 2020 3:47 PM<br>
<b>To:</b> qbs@qt-project.org <qbs@qt-project.org><br>
<b>Subject:</b> Re: [Qbs] Building code generator and its dependencies for a different architecture than the rest of the products</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">On Fri, 20 Mar 2020 15:41:21 +0100<br>
Christian Kandeler <christian.kandeler@qt.io> wrote:<br>
<br>
> Your app and build tool use normal Depends items for pulling in the library; the matching should work automatically.<br>
<br>
Addendum: Of course, you also need to set the host profile in your build tool:<br>
    CppApplication {<br>
        // ...<br>
        qbs.profile: "hostProfile"<br>
    }<br>
<br>
<br>
Christian<br>
_______________________________________________<br>
Qbs mailing list<br>
Qbs@qt-project.org<br>
<a href="https://lists.qt-project.org/listinfo/qbs">https://lists.qt-project.org/listinfo/qbs</a><br>
</div>
</span></font></div>
</body>
</html>