Distinguish between 'mac' and 'macx' qmake scopes

The former applies both on Mac OS X and iOS, but 'macx' is specific to
Mac OS X.

ios.conf and macx.conf now share most of their settings in the common
mac.conf. We set the default QMAKE_MAC_SDK before loading mac.conf, so
that any overrides in the device config will apply afterwards. This
means configure's mkspec parsing will be able to read the QMAKE_MAC_SDK.

Change-Id: I0c7e26a6a0103e19b23ef152aa9e4ab461cee632
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
This commit is contained in:
Tor Arne Vestbø 2013-03-02 15:46:37 +01:00 committed by The Qt Project
parent 950b35cf97
commit d28073d9eb
19 changed files with 67 additions and 79 deletions

View File

@ -2,24 +2,7 @@
# qmake common configuration for iOS
#
MAKEFILE_GENERATOR = UNIX
CONFIG += app_bundle reduce_exports incremental global_init_link_order lib_version_first plugin_no_soname sdk
QMAKE_INCREMENTAL_STYLE = sublib
QMAKE_PLATFORM += ios
QMAKE_MAC_SDK = iphoneos
# FIXME: Transform ios.conf to follow the same inheritance pattern as eg mac.conf and unix.conf
QMAKE_PLATFORM = ios $$QMAKE_PLATFORM
# Not deploying to Mac OSX
QMAKE_MACOSX_DEPLOYMENT_TARGET =
# But to iOS
QMAKE_IOS_DEPLOYMENT_TARGET = 4.3
# Add iOS common folder to include path
INCLUDEPATH += $$PWD/ios
# iOS defines
DEFINES += DARWIN_NO_CARBON QT_NO_CORESERVICES QT_NO_PRINTER QT_NO_PRINTDIALOG
# Universal target (iPhone and iPad)
QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2
include(mac.conf)

29
mkspecs/common/mac.conf Normal file
View File

@ -0,0 +1,29 @@
#
# qmake configuration for common Mac OS (OSX and iOS)
#
!load(device_config): error(Could not successfully load device configuration)
QMAKE_PLATFORM += mac
QMAKE_RESOURCE = /Developer/Tools/Rez
QMAKE_EXTENSION_SHLIB = dylib
QMAKE_LIBDIR =
# sdk.prf will prefix the proper SDK sysroot
QMAKE_INCDIR_OPENGL = \
/System/Library/Frameworks/OpenGL.framework/Headers \
/System/Library/Frameworks/AGL.framework/Headers/
QMAKE_FIX_RPATH = install_name_tool -id
QMAKE_LFLAGS_RPATH =
QMAKE_LIBS_DYNLOAD =
QMAKE_LIBS_OPENGL = -framework OpenGL -framework AGL
QMAKE_LIBS_THREAD =
QMAKE_AR = ar cq
QMAKE_RANLIB = ranlib -s
include(unix.conf)

View File

@ -1,34 +1,8 @@
#
# qmake configuration for common Mac OS X
#
!load(device_config) {
error(Could not successfully load device configuration)
}
QMAKE_PLATFORM += macx mac
QMAKE_PLATFORM += macx
QMAKE_MAC_SDK = macosx
isEmpty(QMAKE_MAC_SDK): QMAKE_MAC_SDK = macosx
QMAKE_RESOURCE = /Developer/Tools/Rez
QMAKE_EXTENSION_SHLIB = dylib
QMAKE_LIBDIR =
# sdk.prf will prefix the proper SDK sysroot
QMAKE_INCDIR_OPENGL = \
/System/Library/Frameworks/OpenGL.framework/Headers \
/System/Library/Frameworks/AGL.framework/Headers/
QMAKE_FIX_RPATH = install_name_tool -id
QMAKE_LFLAGS_RPATH =
QMAKE_LIBS_DYNLOAD =
QMAKE_LIBS_OPENGL = -framework OpenGL -framework AGL
QMAKE_LIBS_THREAD =
QMAKE_AR = ar cq
QMAKE_RANLIB = ranlib -s
include(unix.conf)
include(mac.conf)

View File

@ -83,7 +83,7 @@ CMAKE_MKSPEC = $$[QMAKE_XSPEC]
CMAKE_QT_STEM = Qt$$eval(QT.$${MODULE}.MAJOR_VERSION)$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}
macx {
mac {
!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.a
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a

View File

@ -2,7 +2,7 @@ CONFIG += testcase
QT += qml qmltest
macx: CONFIG -= app_bundle
mac: CONFIG -= app_bundle
# If the .pro file specified an IMPORTPATH, then add that to
# the command-line when the test is run.

View File

@ -28,7 +28,7 @@ win32 {
} else {
contains(TEMPLATE, .*lib):LIBPREFIX = lib
macx {
mac {
equals(TEMPLATE, lib) {
lib_bundle {
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${TARGET}.framework/$${TARGET}

View File

@ -32,7 +32,7 @@ contains(MUNGED_TARGET,.*/.*):check.commands = cd $(DESTDIR) &&
# Allow for a custom test runner script
check.commands += $(TESTRUNNER)
macx {
mac {
app_bundle: check.commands += ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET)
else: check.commands += ./$(QMAKE_TARGET)
}

View File

@ -2,24 +2,26 @@
# qmake configuration for macx-ios-clang
#
!load(device_config): error("Could not successfully load device configuration.")
MAKEFILE_GENERATOR = UNIX
CONFIG += app_bundle reduce_exports incremental global_init_link_order lib_version_first plugin_no_soname sdk
QMAKE_INCREMENTAL_STYLE = sublib
isEmpty(QMAKE_MAC_SDK): QMAKE_MAC_SDK = iphoneos
QMAKE_MACOSX_DEPLOYMENT_TARGET =
QMAKE_IOS_DEPLOYMENT_TARGET = 4.3
# iOS is considered a variant of MacOS by Apple. We follow this to
# keep things simple, e.g. by defining Q_OS_MAC _and_ Q_OS_IOS.
include(../../common/macx.conf)
INCLUDEPATH += $$PWD/ios
DEFINES += DARWIN_NO_CARBON QT_NO_CORESERVICES QT_NO_PRINTER QT_NO_PRINTDIALOG
# Universal target (iPhone and iPad)
QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2
include(../../common/gcc-base-mac.conf)
include(../../common/xcode.conf)
include(../../common/clang.conf)
include(../../common/clang-mac.conf)
# Version check
lessThan(QMAKE_XCODE_VERSION, "4.3"): error("This mkspec requires Xcode 4.3 or later")
include(../../common/ios.conf)
include(../../common/gcc-base-mac.conf)
include(../../common/clang.conf)
include(../../common/clang-mac.conf)
include(../../common/ios/clang.conf)
include(../../common/ios/qmake.conf)

View File

@ -117,12 +117,12 @@ win32 {
io/qprocess_unix.cpp \
io/qfilesystemiterator_unix.cpp \
!nacl:macx-*: {
!nacl:mac: {
SOURCES += io/qfilesystemengine_mac.cpp
SOURCES += io/qsettings_mac.cpp
}
macx-*: {
!ios {
mac {
macx {
SOURCES += io/qstandardpaths_mac.cpp
} else {
SOURCES += io/qstandardpaths_unix.cpp
@ -139,7 +139,7 @@ win32 {
}
!nacl {
freebsd-*|macx-*|darwin-*|openbsd-*:{
freebsd-*|mac|darwin-*|openbsd-*:{
SOURCES += io/qfilesystemwatcher_kqueue.cpp
HEADERS += io/qfilesystemwatcher_kqueue_p.h
}

View File

@ -56,7 +56,7 @@ integrity:SOURCES += thread/qmutex_unix.cpp \
thread/qwaitcondition_unix.cpp
unix: {
macx-* {
mac {
SOURCES += thread/qmutex_mac.cpp
} else:linux-*:!linux-lsb-* {
SOURCES += thread/qmutex_linux.cpp

View File

@ -9,7 +9,7 @@ linux*:qtHaveModule(dbus) {
win32:SUBDIRS += generic
blackberry:SUBDIRS += blackberry
win32:!wince*:SUBDIRS += nativewifi
macx:contains(QT_CONFIG, corewlan):SUBDIRS += corewlan
macx:SUBDIRS += generic
mac:contains(QT_CONFIG, corewlan):SUBDIRS += corewlan
mac:SUBDIRS += generic
isEmpty(SUBDIRS):SUBDIRS = generic

View File

@ -1,4 +1,4 @@
TEMPLATE = subdirs
qtHaveModule(dbus) {
!macx:!win32:SUBDIRS += ibus maliit
!mac:!win32:SUBDIRS += ibus maliit
}

View File

@ -6,4 +6,4 @@ unix {
} else {
LIBS *= -loci
}
macx:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ
mac:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ

View File

@ -113,7 +113,7 @@ win32:SOURCES += ../../corelib/io/qfilesystemengine_win.cpp \
../../corelib/io/qsettings_win.cpp \
../../corelib/plugin/qsystemlibrary.cpp \
macx: {
mac {
SOURCES += ../../corelib/io/qfilesystemengine_mac.cpp \
../../corelib/io/qsettings_mac.cpp \
../../corelib/kernel/qcore_mac.cpp

View File

@ -40,7 +40,7 @@ contains( styles, all ) {
styles = fusion mac windows windowsxp windowsvista
}
!macx-*|ios:styles -= mac
!mac:styles -= mac
contains(QT_CONFIG, gtkstyle) {
QMAKE_CXXFLAGS += $$QT_CFLAGS_QGTKSTYLE

View File

@ -36,6 +36,6 @@ win32:!wince* {
SOURCES += util/qsystemtrayicon_qpa.cpp
}
macx {
mac {
OBJECTIVE_SOURCES += util/qscroller_mac.mm
}

View File

@ -3,5 +3,5 @@ CONFIG += parallel_test
TARGET = tst_qmetamethod
QT = core testlib
SOURCES = tst_qmetamethod.cpp
macx:CONFIG -= app_bundle
mac:CONFIG -= app_bundle
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0

View File

@ -2,5 +2,5 @@ CONFIG += testcase parallel_test
TARGET = tst_qmetaobjectbuilder
QT = core-private gui-private testlib
SOURCES = tst_qmetaobjectbuilder.cpp
macx:CONFIG -= app_bundle
mac:CONFIG -= app_bundle
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0

View File

@ -4,7 +4,7 @@ CONFIG += ordered
SUBDIRS = lib \
theplugin \
tst
!win32: !macx-*: SUBDIRS += almostplugin
!win32: !mac: SUBDIRS += almostplugin
TARGET = tst_qpluginloader
# no special install rule for subdir