... except for MAKEFILE_GENERATOR = XCODE. This means the spec no longer
hard-codes g++, and will work regardless of whether the default spec was
clang or g++.
This require us to set QMAKE_XCODE_GCC_VERSION properly for GCC, so that
additional compilation flags passed by Xcode will match the actual
compiler used.
Task-number: QTBUG-31713
Change-Id: If65140a7471cd16f483036742f1d5b86d0485c52
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
We can combine the hybrid and non-hybrid use-cases into a single static
library if we are careful about which symbols are included in which
object files. By limiting the main() and qt_user_main() functions to
their own translation units, the linker will only pick them up if they
are missing at link time (the user's program do not provide them).
This technique is resilient to the -ObjC linker flag, which includes all
object files that implement an ObjectiveC class or category, but will
fail if the -all_load flag is passed to the linker, as we'll then have
duplicate symbols for either main() or qt_user_main(). The latter should
not happen unless the user provides the flag manually, and in the case
he or she does, there's ways to work around it by providing less global
flags such as -ObjC or -force_load.
Change-Id: Ie2f8e10a7265d007bf45cb1dd83f19cff0693551
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Instead of force-loading the whole static library of the platform plugin
we tell the linker to look for the missing symbol qt_registerPlatformPlugin.
This symbol is provided by the same object file as the plugin's static
initializer, so the object file is included in the final binary and
the static initializer is run, resulting in the plugin registering with
Qt.
We could have marked the actual static initializer wrapper provided by
Q_IMPORT_PLUGIN(QIOSIntegrationPlugin) as undefined, but due to the C++
mangling this would look less intuitive on the linker command line than
the custom dummy function that we provide, which has C linkage.
Change-Id: I6805537e1f49260a41d48c555376964cb1fe75d8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
The Xcode and SDK settings are expensive to resolve, as we're using
system() calls to resolve them. We now try to detect the presence of
a .qmake.cache file (and inform the user that creating one would be
a good idea), and use the file to cache the various settings after
resolving them.
The Xcode logic had to be moved form xcode.conf as part of the mkspec,
into default_pre/post.prf, so that we could cache() the resolved values.
Task-number: QTBUG-30586
Change-Id: Ib5368cfee6f7e4a4a33f6be70d0e20d96896fe56
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
On iOS the compiler expects archs like armv6, armv7, armv7s when passed the
-arch flag, or when the ARCHS Xcode variable is set. Instead of mangling
QT_ARCH, which is used other places and assumed to match the values
provided by the arch.test, we use our own variable.
Change-Id: I05e10be8d69dd4d7cbcef04640fef99f1efb253d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Instead we pass the -force-load as a single argument to the linker,
which is not mangled/touched by either the Xcode or Makefile generators.
Change-Id: I72e17638f0a4a8308a352d4b2033c1b5a9b65b84
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
In case they provide their own main that calls UIApplicationMain.
Change-Id: Ia050277ae5cbcbf01bc57b87ec37a74db9568059
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Ideally we'd only have to do QTPLUGIN += ios, but this doesn't work as
we need to link with the force_load linker option. Even trying to build
on QTPLUGIN and then replace the -l line with what we need will fail, as
the prl logic in qmake which runs after all the prf files does not know
about the force_load option and will then fail to resolve dependencies
from the prl file.
Since we load the platform plugin using -force_load, there's no need to
generate a cpp file that does the plugin import.
The main wrapper is not a real Qt plugin, and doesn't have an import
function that we can call, so we link it manually instead of relying
on QTPLUGIN.
Change-Id: I0381a3c9ed7f8d41a4121e1fc0b7c0e210a8b832
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
As long as Qt Creator does not provide any iOS integration, and the
app bundle we create using the Makefile generator is not good enough
to deploy to a device anyways, producing Xcode projects make the most
sense.
We base the decicion on whether or not the project depends
on QtGui and has app_bundles enabled. This prevents configure
tests and other tools from having Xcode projects, but allows
examples and demos to build out of the box.
Instead of setting the generator unconditionally we unset it in
default_pre so that we can detect if the user set it manually. This
means the user won't be able to inspect the MAKEFILE_GENERATOR variable
from the pro file, but this is less of a use-case then overriding the
generator from the command line or prooject file.
Change-Id: I881cf3e29631445f83ea4ff0979f7a566e4810f5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>