[Qbs] building for iOS

Jake Petroules Jake.Petroules at qt.io
Sun Nov 26 23:17:58 CET 2017

> On Nov 23, 2017, at 6:42 AM, Журавлев Сергей <Zhuravlev at rutoken.ru> wrote:
> Hello,
> I ran into some problems while building for iOS:
> 1. Flag -syslibroot appears twice in the invocation of ld - one from the invocation of clang and one somewhere from the environment. When I try to run the whole clang command independently I get only one -syslibroot, the one from clang command. I suppose it's because the environment during the execution of qbs is different. So usually it's not a problem, but with bitcode enabled it becomes an issue: "only one -syslibroot is accepted for bitcode bundle for architecture arm64". So now I have to do the following in my qbs product: "cpp.syslibroot: undefined". Is there a better workaround for this?
> 2. I specify -fembed-bitcode flag and get the following warning from ld all the time: "-headerpad_max_install_names is ignored when used with -bitcode-bundle". -headerpad_max_install_names is linker flag that is inserted unconditionally. Is there an issue in bugtracker concerning this?

Bitcode isn't yet supported in Qbs, but there's now an open task for this: https://bugreports.qt.io/browse/QBS-1251

Both problems you note (#1 and #2) will be resolved when support is added. 
> 3. Framework flags are always duplicated. If I specify cpp.frameworks: ["Foundation"], clang's flags will be "-framework Foundation -framework Foundation". Is it really messy qbs behavior, or am I doing something wrong?

You're not doing anything wrong. This "issue" affects regular libraries as well as frameworks. Basically, the list of linked libraries is order-sensitive so it's possible that any attempt by us to deduplicate the list of linked libraries could cause a problem.

> I would also like to discuss following features that could be added to qbs:
> 1. Ability to copy framework into Frameworks folder of application bundle (Xcode has this feature). When an application uses custom framework, there could be an option to put framework bundle into the application bundle.

This is a known issue. Implementing this properly has required the implementation of new engine primitives. Now that those are in place, we can begin to add the feature. It's on the todo list: https://bugreports.qt.io/browse/QBS-643

> 2. Reproducing Apple framework bundle structure for iOS.

This is largely already in place. What specific issues are you running into?

> I use macOS 10.12.6, XCode 9.0.1.
> _
> Sergey
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs

Jake Petroules - jake.petroules at qt.io
The Qt Company - Silicon Valley
Qbs build tool evangelist - qbs.io

More information about the Qbs mailing list