Commit Graph

23 Commits

Author SHA1 Message Date
Morten Johan Sørvig
8fc97fdfc7 Revert Mac event loop changes.
"Make QGuiApplication::exec() run within NSApplicationMain()"
"Make Qt process native and timer events on Cocoa applications"
"Cocoa: Fix QFontDialog, QColorDialog auto-tests"

This reverts commits
1e14762b8d
e4b2a0b4ba
df7944e7d7

Change-Id: I80b65b5ee0297b090f807bd420664233dfc44f7b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-02 13:07:35 +02:00
Gabriel de Dietrich
1e14762b8d Make QGuiApplication::exec() run within NSApplicationMain()
We follow the same pattern as for iOS and Windows ports, making
sure the user's main() runs in a platform friendly environment. In
this particular case, it means calling the user's main() during the
call of NSApplicationMain(), and calling the user's main() function
(renamed to qMain() as in Windows) after receiving
NSApplicationDidFinishLaunchingNotification. In practice, this means
that NSApp is running when qMain() is called, and therefore when
QCoreApplication::exec() is called.

For those command-line utilities running on QGuiApplication, or any
deriving class, and that do not provide a bundle, we override the main
bundle's dictionary and get NSApplicationMain() to run as usual.

Added cocoa/cocoamain "subdir" to build libqtcocoamain.a (together with
cocoa/cocoaplugin -- plugins/platforms/cocoa is made a subdirs project).
This library is linked against all GUI Qt apps and provides the actual
main() function. It also catches the launching NSApplication notifications,
and calls the user's qMain() function. Note that this will happen in the
same cases when the user's application will run with the Cocoa QPA plugin.

Launch related code in QCocoaApplicationDelegate is moved to libqtcocoamain,
QNSApplication is removed (but sendEvent: redirection still there), and
code in QCocoaEventDispatcher dealing with calling [NSApp run] and related
has been removed since it's become unreachable.

ChangeLog: [Qt for Mac] Make QGuiApplication::exec() run within NSApplicationMain()
Change-Id: I790e5138c29aac2e0215a9147d0148fece40ca22
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-08-29 12:44:07 +02:00
Frederik Gladhorn
1867ad741a Merge remote-tracking branch 'origin/release' into stable
Change-Id: I4c0ae2ac1c10d4d50c03625c802d981b7850ed6f
2013-06-25 23:25:35 +02:00
Tor Arne Vestbø
d668e19271 Scope cached Mac SDK tool values by mkspec
Otherwise doing stuff like -spec macx-g++ when the default spec is clang
will not have an effect on the tools used.

Change-Id: Ia2769abfdd8c19f79d427b9f09707430e736305a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-06-24 18:22:34 +02:00
Tor Arne Vestbø
d0d158f092 Mac: Ensure that C++11 is always used when linking against a static Qt build
If Qt was built with C++11, it links to libc++, and we need all projects
that use Qt to link against the same library.

Technically, we could do QMAKE_LFLAGS += -stdlib=libc++, but that hasn't
been tested enough without also enabling C++11, so we keep the
relationship between the two for now.

Change-Id: Ic628bcbade60cc82f93707f372c2119c24d9dc8a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
2013-06-24 14:51:50 +02:00
Tor Arne Vestbø
1308aa25fb Cache Xcode and SDK settings in .qmake.cache if it exists
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>
2013-05-08 14:07:41 +02:00
Tor Arne Vestbø
8e27fcb3fe Harden check for SDK platform name on Mac OS
We now use an absolute path, to prevent picking up the wrong plutil binary.
In addition we pipe the possible stderr output of plutil and xpath to the
null device, so that the final QMAKE_MAC_PLATFORM_NAME will be empty in
case of any errors, and caught by the isEmpty() check below.

Change-Id: I8ad24bf63162a76410c2ae223dd2fc48e7886bbf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-04-18 22:02:18 +02:00
Tor Arne Vestbø
4f002f3256 Use absolute paths for Xcode helpers such as xcodebuild/xcrun/xcode-select
We always use the xcodebuild/xcrun/xcode-select binaries in /usr/bin,
as these will dispatch to the right binary based on what Xcode version
has been chosen using xcode-select -switch. This fixes an issue where
a tool was in the path from another Xcode installation. We can rely on
the tools as they are present on a clean Mac OS install.

Change-Id: I1d3cc1e92604f9be6d6f14639cb6322234edd696
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-04-09 10:03:20 +02:00
Tor Arne Vestbø
ced5e2f0e8 Handle errors when sysrooting tools on Mac
xcrun will spit out errors to stderr and nothing to stdout if it fails
to find the tool in question. By checking for an empty return value and
skipping the sysrooting we guard against mangling the tool variable.

Change-Id: I68f59a6c8116696dd75cceed7b33ac666f3468b2
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-04-08 17:23:15 +02:00
Tor Arne Vestbø
3d0a60aaa4 Enable C++11 on OSX when using Clang
This means we have to bump the deployment target to Lion (10.7), as the
LLVM 'libc++' C++ standard library does not support Snow Leopard (10.6).

For iOS the deployment target has to be bumped from 4.3 to 5.0, but we
don't enable C++11 by default yet as it's not tested enough on iOS.

Users who wish to deploy to 10.6 need to build their own Qt,
passing -no-c++11 to configure.

Change-Id: I7b5d20ab002db889d1091a4b7ff600f62caa7f06
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-04-05 14:23:23 +02:00
Tor Arne Vestbø
b2d7168313 Load sdk.prf first, if enabled, so that other features can use QMAKE_CXX
Extra-compilers such as objective_c.prf may reference QMAKE_CXX, so we
need to sysroot it before it's used.

Change-Id: I1e367b3d0816096300a441786619f298134de0a6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-04-03 17:16:43 +02:00
Axel Waggershauser
1622dca213 Fix whitespace issues in *.prf
Replaced tabs with spaces to align with space-indented code
and removed some trailing whitespace.

Change-Id: I4930afc3df206ef8ee96de3e69f0d69fc4a1c77c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-22 19:52:26 +01:00
Tor Arne Vestbø
c45595d648 Use tools from the SDK's toolchain instead of the ones in /usr/bin
For Mac OS X we currently specify build tools without an absolute path,
which means we end up using the ones in /usr/bin. This is wrong, we
should be using the tools from the toolchain of the chosen SDK.

For iOS we do specify an absolute path, by resolving the toolchain
path in the iOS makespecs.

To solve the situation on Mac OS X, we move the logic of resolving the
toolchain path to sdk.prf, and share it between OSX and iOS.

For configure we need to duplicate some of the logic from sdk.prf, as
configure pulls out QMAKE_CC and QMAKE_CXX for running some initial
tests and building qmake. The new macSDKify function also solves
the issue of missing sysroot and deployment version in the flags.

Change-Id: Ib1d239c9904cf3ccee5214b313cf6205869a1462
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-13 18:40:26 +01:00
Tor Arne Vestbø
e11c2165c5 Simplify how we resolve the SDK root on Mac OS
We now take advantage of the fact that xcodebuild -version allows you to
pass the key that you're interested in, to only print that single value.
This technique is used by Apple's own build scripts as well.

Change-Id: I57b8424590d4137a0e7f263a318e17ee2e0dfad4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-03-13 18:40:26 +01:00
Tor Arne Vestbø
93c6284696 Make host_build re-use the sdk.prf logic
Instead of hard-coding the SDK and deployment target.

A host build will already use the host-makespec, so now that we
always build against an SDK, these mkspecs will have the SDK and
deployment target set.

Change-Id: I2b0343ae75f7de12081bab8346307b96b3883f62
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-02 12:58:18 +01:00
Tor Arne Vestbø
0520631b2b Merge "Merge branch 'ios' into dev" into refs/staging/dev 2013-02-28 19:22:05 +01:00
Tor Arne Vestbø
b997481fcb Don't look up DOCTYPE when resolving SDK settings on Mac OS
We don't want to hit the network, as a flakey network or slow server will
hang the XML parsing. We assume the XML is well formed.

Change-Id: Idc4898a925a46222954bf633a04ea9fe148c6797
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-02-28 19:22:05 +01:00
Tor Arne Vestbø
c3278e3353 iOS: Replace device and simulator makespecs with single makespec
And use configure's -sdk argument to choose between the iphoneos and the
iphonesimulator SDK. xcodebuild -showsdks can be used to list the
available SDKs. Passing an SDK without a version postfix implies
the latest version of the SDK.

Change-Id: I881df754d522fc91aaa16ba3e39cf0c37a21a1f1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 13:07:16 +01:00
Tor Arne Vestbø
736e4258a1 Use sdk.prf to set macosx-version-min instead of static conf files
Allows us to dynamically generate the command line option for iOS later,
and allows the user to override QMAKE_MACOSX_DEPLOYMENT_TARGET with the
expected effect on the command line options.

We unset PERL5LIB to ensure we get the system Perl libraries, since the
Mac OS 10.6 CI machine seems to have a broken XML::Parser::Expat from
macports/CPAN.

Change-Id: I04430c7b1daf9452d72f9a04a6b7f8d0d6926884
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-02-22 19:23:26 +01:00
Tor Arne Vestbø
71b4325cb7 Clean up how we build against SDKs on Mac OS
Instead of setting -isysroot in both arch.test, compile.test, the various
mkspecs, and sdk.prf, we now propgate the chosen SDK as the qmake
variable QMAKE_MAC_SDK, which is then handled exclusivly in sdk.prf.

The QMAKE_MAC_SDK variable, and -sdk argument to configure, is expected
to be of the short-form name, eg macosx or iphoneos, not a full path, as
that's what Xcode also expects. We take care of translating that into
a full path for -isysroot/-syslibroot in sdk.prf, using xcodebuild as
a helper.

Change-Id: I281655b2fa5180c6e78ffdce36824e4a91447570
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-02-19 07:56:34 +01:00
Bradley T. Hughes
7a67c822e3 configure: Remove the -dwarf2 argument for Mac OS X builds
Modern versions of Xcode properly support dwarf2, and as such dwarf2 is
always enabled. This change removes the ability to turn it off, making
dwarf2 non-optional.

Change-Id: I149daeae6048ee8a1ed116363572173ad219102e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-05-11 12:52:21 +02:00
Morten Johan Sorvig
976619bd59 Remove all usages of "arch" CFLAGS on Mac.
Remove all [PPC|PPC64|X86|x86_64] CFLAGS, CXXFLAGS
and OBJECTIVE_CFLAGS. Delete the arch prf files.

32/64 bit arch selection will be made using a different
mechanism in Qt 5. Universal builds are not supported.

Change-Id: I4664f2c31801cec7fb4d240f41c2c5204a109020
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-04 09:19:23 +02:00
Qt by Nokia
38be0d1383 Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
Qt Git wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:

http://qt.gitorious.org/qt/pages/GitIntroductionWithQt

If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.

Branched from the monolithic repo, Qt master branch, at commit
896db169ea224deb96c59ce8af800d019de63f12
2011-04-27 12:05:43 +02:00