summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-10-24 12:48:39 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-10-24 12:48:42 +0200
commit840f6a40e6218992b5b9d451ee3c0886a4846c89 (patch)
tree2b808decc7adf5218b810d2de6b45c5a8b4cfc42 /mkspecs
parent109bf980b37fed405c6c1eb14cb9c83ff897e389 (diff)
parent2e3870fe37d36ccf4bd84eb90e1d5e08ad00c1bc (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/android-g++/qmake.conf2
-rw-r--r--mkspecs/blackberry-armle-v7-qcc/qmake.conf22
-rw-r--r--mkspecs/blackberry-armle-v7-qcc/qplatformdefs.h42
-rw-r--r--mkspecs/blackberry-armv7le-qcc/qmake.conf23
-rw-r--r--mkspecs/blackberry-armv7le-qcc/qplatformdefs.h4
-rw-r--r--mkspecs/common/shell-win32.conf1
-rw-r--r--mkspecs/devices/blackberry-playbook-armle-v7-qcc/qmake.conf8
-rw-r--r--mkspecs/devices/blackberry-playbook-armle-v7-qcc/qplatformdefs.h42
-rw-r--r--mkspecs/devices/blackberry-playbook-armv7le-qcc/qmake.conf9
-rw-r--r--mkspecs/devices/blackberry-playbook-armv7le-qcc/qplatformdefs.h2
-rw-r--r--mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp10
-rw-r--r--mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp86
-rw-r--r--mkspecs/features/android/android_deployment_settings.prf4
-rw-r--r--mkspecs/features/create_cmake.prf18
-rw-r--r--mkspecs/features/data/cmake/ExtraSourceIncludes.cmake.in7
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in7
-rw-r--r--mkspecs/features/default_post.prf12
-rw-r--r--mkspecs/features/egl.prf2
-rw-r--r--mkspecs/features/ios/default_pre.prf9
-rw-r--r--mkspecs/features/ios/qt.prf75
-rw-r--r--mkspecs/features/mac/default_pre.prf6
-rw-r--r--mkspecs/features/qml_plugin.prf5
-rw-r--r--mkspecs/features/qt.prf82
-rw-r--r--mkspecs/features/qt_config.prf1
-rw-r--r--mkspecs/features/qt_functions.prf4
-rw-r--r--mkspecs/features/resolve_config.prf37
-rw-r--r--mkspecs/features/testcase.prf45
-rw-r--r--mkspecs/features/unix/default_pre.prf4
-rw-r--r--mkspecs/linux-icc/qmake.conf1
-rw-r--r--mkspecs/macx-ios-clang/features/default_post.prf (renamed from mkspecs/features/ios/default_post.prf)20
-rw-r--r--mkspecs/macx-ios-clang/features/default_pre.prf6
-rw-r--r--mkspecs/macx-ios-clang/features/qt.prf49
-rw-r--r--mkspecs/macx-ios-clang/features/qt_config.prf12
-rw-r--r--mkspecs/macx-ios-clang/qmake.conf5
-rw-r--r--mkspecs/macx-xcode/features/default_post.prf7
-rw-r--r--mkspecs/macx-xcode/qmake.conf8
36 files changed, 406 insertions, 271 deletions
diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf
index 0df2509257..11d62a1efb 100644
--- a/mkspecs/android-g++/qmake.conf
+++ b/mkspecs/android-g++/qmake.conf
@@ -178,7 +178,7 @@ QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
QMAKE_LFLAGS_RPATH = -Wl,-rpath=
QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link=
-QMAKE_LIBS = -lgnustl_shared -lsupc++ -llog -lz -lm -ldl -lc -lgcc
+QMAKE_LIBS_PRIVATE = -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc
QMAKE_LIBS_X11 =
QMAKE_LIBS_THREAD =
QMAKE_LIBS_EGL = -lEGL
diff --git a/mkspecs/blackberry-armle-v7-qcc/qmake.conf b/mkspecs/blackberry-armle-v7-qcc/qmake.conf
new file mode 100644
index 0000000000..2e24e4e0d3
--- /dev/null
+++ b/mkspecs/blackberry-armle-v7-qcc/qmake.conf
@@ -0,0 +1,22 @@
+#
+# qmake configuration for blackberry armv7le systems
+#
+
+load(qt_config)
+
+DEFINES += Q_OS_BLACKBERRY
+CONFIG += blackberry
+LIBS += -lbps
+
+# Blackberry also has support for stack smashing protection in its libc
+contains(QT_CONFIG, stack-protector-strong) {
+ QMAKE_CFLAGS += -fstack-protector-strong
+} else {
+ QMAKE_CFLAGS += -fstack-protector -fstack-protector-all
+}
+
+QMAKE_CFLAGS += -mcpu=cortex-a9 -mtune=cortex-a9 -mthumb -D_FORTIFY_SOURCE=2
+
+QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now
+
+include(../common/qcc-base-qnx-armv7le.conf)
diff --git a/mkspecs/blackberry-armle-v7-qcc/qplatformdefs.h b/mkspecs/blackberry-armle-v7-qcc/qplatformdefs.h
new file mode 100644
index 0000000000..32becb2042
--- /dev/null
+++ b/mkspecs/blackberry-armle-v7-qcc/qplatformdefs.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 - 2013 BlackBerry Limited. All rights reserved.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../qnx-armv7le-qcc/qplatformdefs.h"
diff --git a/mkspecs/blackberry-armv7le-qcc/qmake.conf b/mkspecs/blackberry-armv7le-qcc/qmake.conf
index 2e24e4e0d3..ec462457c4 100644
--- a/mkspecs/blackberry-armv7le-qcc/qmake.conf
+++ b/mkspecs/blackberry-armv7le-qcc/qmake.conf
@@ -1,22 +1,5 @@
#
-# qmake configuration for blackberry armv7le systems
+# deprecated, please use blackberry-armle-v7-qcc instead
#
-
-load(qt_config)
-
-DEFINES += Q_OS_BLACKBERRY
-CONFIG += blackberry
-LIBS += -lbps
-
-# Blackberry also has support for stack smashing protection in its libc
-contains(QT_CONFIG, stack-protector-strong) {
- QMAKE_CFLAGS += -fstack-protector-strong
-} else {
- QMAKE_CFLAGS += -fstack-protector -fstack-protector-all
-}
-
-QMAKE_CFLAGS += -mcpu=cortex-a9 -mtune=cortex-a9 -mthumb -D_FORTIFY_SOURCE=2
-
-QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now
-
-include(../common/qcc-base-qnx-armv7le.conf)
+warning("You are using deprecated mkspecs. Please use blackberry-armle-v7-qcc instead.")
+include(../blackberry-armle-v7-qcc/qmake.conf)
diff --git a/mkspecs/blackberry-armv7le-qcc/qplatformdefs.h b/mkspecs/blackberry-armv7le-qcc/qplatformdefs.h
index b15869f163..a3e7b16ef7 100644
--- a/mkspecs/blackberry-armv7le-qcc/qplatformdefs.h
+++ b/mkspecs/blackberry-armv7le-qcc/qplatformdefs.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2012 Research In Motion Limited. <blackberry-qt@qnx.com>
+** Copyright (C) 2012 - 2013 BlackBerry Limited. All rights reserved.
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -39,4 +39,4 @@
**
****************************************************************************/
-#include "../qnx-armv7le-qcc/qplatformdefs.h"
+#include "../blackberry-armle-v7-qcc/qplatformdefs.h"
diff --git a/mkspecs/common/shell-win32.conf b/mkspecs/common/shell-win32.conf
index 131aa746c4..1da8057c43 100644
--- a/mkspecs/common/shell-win32.conf
+++ b/mkspecs/common/shell-win32.conf
@@ -14,3 +14,4 @@ QMAKE_SYMBOLIC_LINK = $$QMAKE_COPY
QMAKE_LN_SHLIB = $$QMAKE_SYMBOLIC_LINK
# xcopy copies the contained files if source is a directory. Deal with it.
CONFIG += copy_dir_files
+QMAKE_STREAM_EDITOR = $(QMAKE) -install sed
diff --git a/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qmake.conf b/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qmake.conf
new file mode 100644
index 0000000000..c9c883a206
--- /dev/null
+++ b/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qmake.conf
@@ -0,0 +1,8 @@
+#
+# qmake configuration for the Blackberry Playbook armv7le
+#
+
+include(../../blackberry-armle-v7-qcc/qmake.conf)
+
+DEFINES += Q_OS_BLACKBERRY_TABLET
+CONFIG += blackberry-playbook
diff --git a/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qplatformdefs.h b/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qplatformdefs.h
new file mode 100644
index 0000000000..a78e441501
--- /dev/null
+++ b/mkspecs/devices/blackberry-playbook-armle-v7-qcc/qplatformdefs.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klarälvdalens Datakonsult AB <info@kdab.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../../blackberry-armle-v7-qcc/qplatformdefs.h"
diff --git a/mkspecs/devices/blackberry-playbook-armv7le-qcc/qmake.conf b/mkspecs/devices/blackberry-playbook-armv7le-qcc/qmake.conf
index cc7435d1dc..1b3299659f 100644
--- a/mkspecs/devices/blackberry-playbook-armv7le-qcc/qmake.conf
+++ b/mkspecs/devices/blackberry-playbook-armv7le-qcc/qmake.conf
@@ -1,8 +1,5 @@
#
-# qmake configuration for the Blackberry Playbook armv7le
+# deprecated, please use blackberry-playbook-armle-v7-qcc instead
#
-
-include(../../blackberry-armv7le-qcc/qmake.conf)
-
-DEFINES += Q_OS_BLACKBERRY_TABLET
-CONFIG += blackberry-playbook
+warning("You are using deprecated mkspecs. Please use blackberry-playbook-armle-v7-qcc instead.")
+include(../blackberry-playbook-armle-v7-qcc/qmake.conf)
diff --git a/mkspecs/devices/blackberry-playbook-armv7le-qcc/qplatformdefs.h b/mkspecs/devices/blackberry-playbook-armv7le-qcc/qplatformdefs.h
index 127ca957dd..61cd7119cc 100644
--- a/mkspecs/devices/blackberry-playbook-armv7le-qcc/qplatformdefs.h
+++ b/mkspecs/devices/blackberry-playbook-armv7le-qcc/qplatformdefs.h
@@ -39,4 +39,4 @@
**
****************************************************************************/
-#include "../../blackberry-armv7le-qcc/qplatformdefs.h"
+#include "../blackberry-playbook-armle-v7-qcc/qplatformdefs.h"
diff --git a/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp b/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp
index 2a5ee74648..c351e3dbc4 100644
--- a/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp
+++ b/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp
@@ -41,6 +41,7 @@
#include "qeglfshooks.h"
#include <EGL/eglvivante.h>
+#include <QDebug>
QT_BEGIN_NAMESPACE
@@ -62,6 +63,15 @@ private:
QEglFSImx6Hooks::QEglFSImx6Hooks()
{
int width, height;
+
+ bool multiBufferNotEnabledYet = qEnvironmentVariableIsEmpty("FB_MULTI_BUFFER");
+ bool multiBuffer = qEnvironmentVariableIsEmpty("QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER");
+ if (multiBufferNotEnabledYet && multiBuffer) {
+ qWarning() << "QEglFSImx6Hooks will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.\n"
+ << "If this is not desired, you can override this via: export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1";
+ qputenv("FB_MULTI_BUFFER", "2");
+ }
+
mNativeDisplay = fbGetDisplayByIndex(0);
fbGetDisplayGeometry(mNativeDisplay, &width, &height);
mScreenSize.setHeight(height);
diff --git a/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp b/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp
index 671f525250..5e57ba382a 100644
--- a/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp
+++ b/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp
@@ -136,89 +136,6 @@ static void destroyDispmanxLayer(EGLNativeWindowType window)
delete eglWindow;
}
-class QEglFSPiCursor : public QEglFSCursor
-{
-public:
- QEglFSPiCursor(QEglFSScreen *screen) : QEglFSCursor(screen) {
- QSurfaceFormat platformFormat;
- platformFormat.setDepthBufferSize(24);
- platformFormat.setStencilBufferSize(8);
- platformFormat.setRedBufferSize(8);
- platformFormat.setGreenBufferSize(8);
- platformFormat.setBlueBufferSize(8);
- platformFormat.setAlphaBufferSize(8);
- m_config = q_configFromGLFormat(m_screen->display(), platformFormat);
-
- createSurface();
- createContext();
- drawInLayer();
- }
-
- ~QEglFSPiCursor() {
- eglDestroySurface(m_screen->display(), m_surface);
- destroyDispmanxLayer(m_window);
- eglDestroyContext(m_screen->display(), m_context);
- }
-
- void createSurface() {
- const QRect cr = cursorRect();
- m_window = createDispmanxLayer(cr.topLeft(), cr.size(), 50, DISPMANX_FLAGS_ALPHA_FROM_SOURCE);
- m_surface = eglCreateWindowSurface(m_screen->display(), m_config, m_window, NULL);
- }
-
- void createContext() {
- eglBindAPI(EGL_OPENGL_ES_API);
- QVector<EGLint> attrs;
- attrs.append(EGL_CONTEXT_CLIENT_VERSION);
- attrs.append(2);
- attrs.append(EGL_NONE);
- m_context = eglCreateContext(m_screen->display(), m_config, EGL_NO_CONTEXT, attrs.constData());
- }
-
- void drawInLayer() {
- eglMakeCurrent(m_screen->display(), m_surface, m_surface, m_context);
-
- glClearColor(0, 0, 0, 0);
- glClear(GL_COLOR_BUFFER_BIT);
- draw(QRectF(QPointF(-1, 1), QPointF(1, -1)));
-
- eglSwapBuffers(m_screen->display(), m_surface);
- eglMakeCurrent(m_screen->display(), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- }
-
- void changeCursor(QCursor *cursor, QWindow *window) Q_DECL_OVERRIDE {
- if (!setCurrentCursor(cursor))
- return;
-
- EGL_DISPMANX_WINDOW_T *eglWindow = static_cast<EGL_DISPMANX_WINDOW_T *>(m_window);
- if (QSize(eglWindow->width, eglWindow->height) != m_cursor.size) {
- eglDestroySurface(m_screen->display(), m_surface);
- destroyDispmanxLayer(m_window);
- createSurface();
- }
- drawInLayer();
- }
-
- void setPos(const QPoint &pos) Q_DECL_OVERRIDE {
- m_cursor.pos = pos;
- moveDispmanxLayer(m_window, cursorRect().topLeft());
- }
-
- void pointerEvent(const QMouseEvent &event) Q_DECL_OVERRIDE {
- if (event.type() != QEvent::MouseMove)
- return;
- m_cursor.pos = event.pos();
- moveDispmanxLayer(m_window, cursorRect().topLeft());
- }
-
- void paintOnScreen() Q_DECL_OVERRIDE { }
-private:
- EGLConfig m_config;
- EGLContext m_context;
- EGLNativeWindowType m_window;
- EGLSurface m_surface;
-};
-
class QEglFSPiHooks : public QEglFSHooks
{
public:
@@ -230,9 +147,6 @@ public:
virtual void destroyNativeWindow(EGLNativeWindowType window);
virtual bool hasCapability(QPlatformIntegration::Capability cap) const;
- QEglFSCursor *createCursor(QEglFSScreen *screen) const {
- return new QEglFSPiCursor(screen);
- }
};
void QEglFSPiHooks::platformInit()
diff --git a/mkspecs/features/android/android_deployment_settings.prf b/mkspecs/features/android/android_deployment_settings.prf
index eb18d38a7f..a903ed025d 100644
--- a/mkspecs/features/android/android_deployment_settings.prf
+++ b/mkspecs/features/android/android_deployment_settings.prf
@@ -25,6 +25,7 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-no-sdk {
else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi
}
FILE_CONTENT += " \"toolchain-prefix\": $$emitString($$NDK_TOOLCHAIN_PREFIX),"
+ FILE_CONTENT += " \"tool-prefix\": $$emitString($$NDK_TOOLS_PREFIX),"
NDK_TOOLCHAIN_VERSION = $$(ANDROID_NDK_TOOLCHAIN_VERSION)
isEmpty(NDK_TOOLCHAIN_VERSION): NDK_TOOLCHAIN_VERSION = $$DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION
@@ -61,9 +62,6 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-no-sdk {
!isEmpty(ANDROID_EXTRA_LIBS): \
FILE_CONTENT += " \"android-extra-libs\": $$emitString($$join(ANDROID_EXTRA_LIBS, ",")),"
- !isEmpty(QMAKE_SUPPORTED_ORIENTATIONS): \
- FILE_CONTENT += " \"supported-orientations\": $$emitString($$join(QMAKE_SUPPORTED_ORIENTATIONS, ",")),"
-
FILE_CONTENT += " \"application-binary\": $$emitString($$absolute_path($$DESTDIR, $$OUT_PWD)/$$TARGET)"
FILE_CONTENT += "}"
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index d799e20c46..4643c3915c 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -30,11 +30,19 @@ split_incpath {
CMAKE_ADD_SOURCE_INCLUDE_DIRS = true
CMAKE_NO_PRIVATE_INCLUDES = true # Don't add private includes in the build dir which don't exist
CMAKE_SOURCE_INCLUDES = \
- $$cmakeTargetPath($$QT_MODULE_INCLUDE_BASE) \
- $$cmakeTargetPath($$QT_MODULE_INCLUDE_BASE/Qt$${CMAKE_MODULE_NAME})
+ $$cmakeTargetPaths($$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/Qt$${CMAKE_MODULE_NAME})
CMAKE_SOURCE_PRIVATE_INCLUDES = \
- $$cmakeTargetPath($$QT_MODULE_INCLUDE_BASE/Qt$${CMAKE_MODULE_NAME}/$$eval(QT.$${MODULE}.VERSION)) \
- $$cmakeTargetPath($$QT_MODULE_INCLUDE_BASE/Qt$${CMAKE_MODULE_NAME}/$$eval(QT.$${MODULE}.VERSION)/Qt$${CMAKE_MODULE_NAME})
+ $$cmakeTargetPaths($$QT_MODULE_INCLUDE_BASE/Qt$${CMAKE_MODULE_NAME}/$$eval(QT.$${MODULE}.VERSION) \
+ $$QT_MODULE_INCLUDE_BASE/Qt$${CMAKE_MODULE_NAME}/$$eval(QT.$${MODULE}.VERSION)/Qt$${CMAKE_MODULE_NAME})
+
+ cmake_extra_source_includes.input = $$PWD/data/cmake/ExtraSourceIncludes.cmake.in
+ cmake_extra_source_includes.output = $$DESTDIR/cmake/Qt5$${CMAKE_MODULE_NAME}/ExtraSourceIncludes.cmake
+
+ !build_pass:QMAKE_SUBSTITUTES += \
+ cmake_extra_source_includes
+
+ cmake_qt5_module_files.files = \
+ $$cmake_extra_source_includes.output
}
CMAKE_INCLUDE_DIR = $$cmakeRelativePath($$[QT_INSTALL_HEADERS], $$[QT_INSTALL_PREFIX])
@@ -68,7 +76,7 @@ contains(CMAKE_PLUGIN_DIR, "^\\.\\./.*") {
CMAKE_PLUGIN_DIR_IS_ABSOLUTE = True
}
-!isEmpty(DLLDESTDIR):!static:!staticlib {
+win32:!wince:!static:!staticlib {
CMAKE_DLL_DIR = $$cmakeRelativePath($$[QT_INSTALL_BINS], $$[QT_INSTALL_PREFIX])
contains(CMAKE_DLL_DIR, "^\\.\\./.*") {
CMAKE_DLL_DIR = $$[QT_INSTALL_BINS]/
diff --git a/mkspecs/features/data/cmake/ExtraSourceIncludes.cmake.in b/mkspecs/features/data/cmake/ExtraSourceIncludes.cmake.in
new file mode 100644
index 0000000000..ec8075f3f7
--- /dev/null
+++ b/mkspecs/features/data/cmake/ExtraSourceIncludes.cmake.in
@@ -0,0 +1,7 @@
+
+list(APPEND _Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
+ $$CMAKE_SOURCE_INCLUDES
+)
+set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
+ $$CMAKE_SOURCE_PRIVATE_INCLUDES
+)
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index 245c0ae768..0cdaafee7f 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -121,12 +121,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!ENDIF
!!ENDIF
!!IF !isEmpty(CMAKE_ADD_SOURCE_INCLUDE_DIRS)
- list(APPEND _Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
- $$CMAKE_SOURCE_INCLUDES
- )
- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
- $$CMAKE_SOURCE_PRIVATE_INCLUDES
- )
+ include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL)
!!ENDIF
!!ELSE
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS)
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index c756455dd2..4501b2a568 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -6,6 +6,18 @@ contains(TEMPLATE, ".*(lib|app)"):CONFIG += have_target
load(resolve_config)
+# If the TARGET looks like a path, split it into DESTDIR and the resulting TARGET
+target_dir_part = $$dirname(TARGET)
+!isEmpty(target_dir_part) {
+ isEmpty(DESTDIR): \
+ DESTDIR = $$target_dir_part
+ else: \
+ DESTDIR = $$DESTDIR/$$target_dir_part
+
+ TARGET = $$basename(TARGET)
+ DESTDIR = $$clean_path($$DESTDIR)
+}
+
QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH)
!isEmpty(QT_BREAKPAD_ROOT_PATH): \ # quick test first whether requested ...
!static:release:have_target: \ # is it applicable?
diff --git a/mkspecs/features/egl.prf b/mkspecs/features/egl.prf
index 7e7d098236..3dd66bce53 100644
--- a/mkspecs/features/egl.prf
+++ b/mkspecs/features/egl.prf
@@ -14,6 +14,8 @@ wince*:contains(QT_CONFIG, opengles1) {
} else {
INCLUDEPATH += $$QMAKE_INCDIR_EGL
LIBS_PRIVATE += $$QMAKE_LIBS_EGL
+ QMAKE_CFLAGS += $$QMAKE_CFLAGS_EGL
+ QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_EGL
LIBS += $$QMAKE_LFLAGS_EGL
for(p, QMAKE_LIBDIR_EGL) {
exists($$p):LIBS_PRIVATE += -L$$p
diff --git a/mkspecs/features/ios/default_pre.prf b/mkspecs/features/ios/default_pre.prf
deleted file mode 100644
index de5a9170d7..0000000000
--- a/mkspecs/features/ios/default_pre.prf
+++ /dev/null
@@ -1,9 +0,0 @@
-
-load(default_pre)
-
-# Check for supported Xcode versions
-lessThan(QMAKE_XCODE_VERSION, "4.3"): \
- error("This mkspec requires Xcode 4.3 or later")
-!contains(QMAKE_XCODE_VERSION, ^(4\\.[3456]|5\\.[0])$): \
- warning("The version of Xcode installed on this system ($$QMAKE_XCODE_VERSION)" \
- "has not been tested fully - custom compiler settings may be necessary")
diff --git a/mkspecs/features/ios/qt.prf b/mkspecs/features/ios/qt.prf
deleted file mode 100644
index 9fa882c99f..0000000000
--- a/mkspecs/features/ios/qt.prf
+++ /dev/null
@@ -1,75 +0,0 @@
-
-equals(TEMPLATE, app):contains(QT, gui(-private)?) {
- !macx-xcode: \
- error("Linking the iOS platform plugin requires bulding through Xcode")
-
- LIBS *= -L$$[QT_INSTALL_PLUGINS/get]/platforms
-
- lib_name = qios
- lib_path_and_base = $$[QT_INSTALL_PLUGINS/get]/platforms/lib$${lib_name}$$qtPlatformTargetSuffix()
- LIBS += -l$${lib_name}$$qtPlatformTargetSuffix() $$fromfile($${lib_path_and_base}.prl, QMAKE_PRL_LIBS)
-
- # By marking qt_registerPlatformPlugin as undefined, we ensure that
- # the plugin.o translation unit is considered for inclusion in
- # the final binary, which in turn ensures that the plugin's
- # static initializer is included and run.
- QMAKE_LFLAGS += -u _qt_registerPlatformPlugin
-
- # We do link and dependency resolution for the platform plugin
- # manually, since we know we always need the plugin, so we don't
- # need to generate an import for it.
- CONFIG -= import_qpa_plugin
-
- !no_main_wrapper {
- # Instead of messing with the user's main function we go the other
- # way and change the application entry point to call our main wrapper.
- # This entry point is the 'start' symbol, provided by crt1.o, so we
- # make a copy of the file and rename the '_main' unresolved symbol
- # to our wrapper function, '_qtmn', injecting ourselves into the app
- # startup. Once Apple starts shipping the LLVM linker (lld) we may
- # get rid of this step completely and just pass -e _qtmn to the
- # linker, taking advantage of the new LC_MAIN load command.
-
- # We know that iOS 3.1 and up uses crt1.3.1.o (technically not
- # true for simulator, but the SDK has a symlink to the correct file).
- original_crt_path = "$(SDK_DIR)/usr/lib/crt1.3.1.o"
-
- xcode_objects_path = "$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/$(CURRENT_ARCH)"
- custom_crt_filename = "crt1_qt.o"
- custom_crt_path = "$$xcode_objects_path/$$custom_crt_filename"
-
- EOC = $$escape_expand(\\n\\t)
- create_custom_crt.commands = \
- # Copy original crt1 to build directory
- "$$QMAKE_COPY_FILE $$original_crt_path $$custom_crt_path $$EOC" \
- # And rename all occurrences of _main to _qtmn
- "strings -t d - $${custom_crt_path}" \
- "| sed -n 's/^\\([0-9]\\{1,\\}\\) _main\$\$/\1/p'" \
- "| while read offset; do" \
- "printf '_qtmn'" \
- "| dd of=$${custom_crt_path} bs=1 seek=\$\$offset conv=notrunc >/dev/null 2>&1" \
- "; done"
- create_custom_crt.depends = $$original_crt_path
- create_custom_crt.target = $$custom_crt_path
- preprocess.depends = create_custom_crt
- QMAKE_EXTRA_TARGETS += create_custom_crt preprocess
-
- clean_custom_crt.commands = "$$QMAKE_DEL_FILE $$custom_crt_path"
- preprocess_clean.depends += clean_custom_crt
- QMAKE_EXTRA_TARGETS += clean_custom_crt preprocess_clean
-
- # Prevent usage of new LC_MAIN load command, which skips start/crt1
- # and calls main from the loader. We rely on injecting into start.
- QMAKE_LFLAGS += -Wl,-no_new_main
-
- # Explicitly link against our modified crt1 object
- QMAKE_LFLAGS += -nostartfiles -l$${custom_crt_filename}
-
- # Workaround for QMAKE_PBX_LIBPATHS mangling the Xcode variables
- lib_search_path.name = LIBRARY_SEARCH_PATHS
- lib_search_path.value = $$xcode_objects_path
- QMAKE_MAC_XCODE_SETTINGS += lib_search_path
- }
-}
-
-load(qt)
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index e535c4d9e9..c0596d5ef0 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -23,3 +23,9 @@ isEmpty(QMAKE_XCODE_VERSION) {
isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
unset(xcode_version)
}
+
+# These two variables are used by the xcode_dynamic_library_suffix
+# feature, which allows Xcode to choose the Qt libraries to link to
+# at build time, depending on the current Xcode SDK and configuration.
+QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
+QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX
diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
index 28fbb392a7..af941058db 100644
--- a/mkspecs/features/qml_plugin.prf
+++ b/mkspecs/features/qml_plugin.prf
@@ -25,6 +25,11 @@ if(win32|mac):!macx-xcode {
}
isEmpty(TARGETPATH): TARGETPATH = $$eval(QT.$${CXX_MODULE}.name)
+# Insert the plugins URI into its meta data to enable usage
+# of static plugins in QtDeclarative:
+URI = $$replace(TARGETPATH, "/", ".")
+QMAKE_MOC_OPTIONS += -Muri=$$URI
+
QMLTYPEFILE = $$_PRO_FILE_PWD_/plugins.qmltypes
exists($$QMLTYPEFILE): QML_FILES += $$QMLTYPEFILE
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index dc80f8d9e1..04375d4ce1 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -73,6 +73,88 @@ wince*:static:gui {
QTLIB += qmenu_wce.res
}
+# static builds: link qml import plugins into the app.
+if(contains(QT, qml)|contains(QT_PRIVATE, qml)): \
+ contains(QT_CONFIG, static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
+ # run qmlimportscanner
+ qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner)
+ for (MODULE, QT_MODULES) {
+ PATH = $$eval(QT.$${MODULE}.qml)
+ !isEmpty(PATH): QMLPATHS += $$PATH
+ }
+ QMLPATHS = $$unique(QMLPATHS)
+ for (QMLPATH, QMLPATHS): \
+ IMPORTPATHS += -importPath $$QMLPATH
+
+ #message(run $$QMLIMPORTSCANNER $$_PRO_FILE_PWD_ $$IMPORTPATHS)
+ JSON = $$system($$QMLIMPORTSCANNER $$_PRO_FILE_PWD_ $$IMPORTPATHS)
+
+ parseJson(JSON, IMPORTS)| error("Failed to parse qmlimportscanner output.")
+
+ !isEmpty(IMPORTS._KEYS_) {
+ # add import plugins to LIBS line
+ for (key, IMPORTS._KEYS_): {
+ PATH = $$eval(IMPORTS.$${key}.path)
+ PLUGIN = $$eval(IMPORTS.$${key}.plugin)
+ !isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$$PLUGIN
+ }
+
+ # create qml_plugin_import.cpp
+ IMPORT_FILE_CONT = \
+ "// This file is autogenerated by qmake. It imports static plugin classes for" \
+ "// static plugins used by QML imports." \
+ "$${LITERAL_HASH}include <QtPlugin>"
+ for (key, IMPORTS._KEYS_) {
+ PLUGIN = $$eval(IMPORTS.$${key}.plugin)
+ CLASSNAME = $$eval(IMPORTS.$${key}.classname)
+ !isEmpty(PLUGIN) {
+ !isEmpty(CLASSNAME) {
+ !contains(ADDED_IMPORTS, $$PLUGIN) {
+ ADDED_IMPORTS += $$PLUGIN
+ IMPORT_FILE_CONT += "Q_IMPORT_PLUGIN($$CLASSNAME)"
+ }
+ } else {
+ error("Plugin $$PLUGIN is missing a classname entry, please add one to the qmldir file.")
+ }
+ }
+ }
+ QML_IMPORT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_qml_plugin_import.cpp
+ write_file($$QML_IMPORT_CPP, IMPORT_FILE_CONT)|error("Aborting.")
+ SOURCES += $$QML_IMPORT_CPP
+ QMAKE_CLEAN += $$QML_IMPORT_CPP
+
+ # copy qml files. this part is platform spesific.
+ macx {
+ # copy to Contents/Resources in the bundle.
+ QmlImports.path = Contents/Resources/
+ QmlImports.files *= $$QMLPATHS
+ QMAKE_BUNDLE_DATA += QmlImports
+
+ # place qt.conf in Contents/Resources in the app bundle
+ QT_CONF_CONTENTS = \
+ "[Paths]" \
+ "Imports = Resources/qml" \
+ "Qml2Imports = Resources/qml"
+ QT_CONF = "$$OUT_PWD/$${TARGET}.app/Contents/Resources/qt.conf"
+ write_file($$QT_CONF, QT_CONF_CONTENTS)|error("Aborting.")
+ } else: ios {
+ # flat bundle layout (no Contents/Resources)
+ QmlImports.files *= $$QMLPATHS
+ QMAKE_BUNDLE_DATA += QmlImports
+
+ # write qt.conf to OUT_PWD and make xcode copy it via QMAKE_BUNDLE_DATA
+ QT_CONF_CONTENTS = \
+ "[Paths]" \
+ "Imports = qml" \
+ "Qml2Imports = qml"
+ QT_CONF = "$$OUT_PWD/qt.conf"
+ write_file($$QT_CONF, QT_CONF_CONTENTS)|error("Aborting.")
+ QtConf.files = $$QT_CONF
+ QMAKE_BUNDLE_DATA += QtConf
+ }
+ }
+}
+
QT_PLUGIN_VERIFY = DEPLOYMENT_PLUGIN
contains(QT_CONFIG, static) {
QT_PLUGIN_VERIFY += QTPLUGIN
diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf
index cbbd136270..208681d98a 100644
--- a/mkspecs/features/qt_config.prf
+++ b/mkspecs/features/qt_config.prf
@@ -29,6 +29,7 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri
include($$mod)
}
}
+ QT_MODULES = $$unique(QT_MODULES) # In case modules appear in multiple places
unset(QT_MODULE_INCLUDE_BASE)
unset(QT_MODULE_LIB_BASE)
unset(QT_MODULE_HOST_LIB_BASE)
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 7bedf6f760..f1f7c00b9e 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -23,13 +23,13 @@ defineReplace(qtLibraryTarget) {
}
defineTest(qtAddLibrary) {
- warning("qtAddLibrary() is deprecated. Use qtAddModule() or QT+= instead.")
+ warning("qtAddLibrary() is deprecated. Use QT+= instead.")
# Reverse-engineer the module name from the library name.
for(var, QT_MODULES) {
isEqual(QT.$${var}.name, $$1) {
qtAddModule($$var, , LIBS)
- return(true):break() # Yes, the break is insanity. But necessary.
+ return(true)
}
}
error("No module matching library '$$1' found.")
diff --git a/mkspecs/features/resolve_config.prf b/mkspecs/features/resolve_config.prf
index 41e82b2382..3884598a94 100644
--- a/mkspecs/features/resolve_config.prf
+++ b/mkspecs/features/resolve_config.prf
@@ -36,11 +36,34 @@ CONFIG(debug, debug|release): \
else: \
CONFIG -= debug
-debug_and_release {
- !macx-xcode: addExclusiveBuilds(debug, Debug, release, Release)
-} else: fix_output_dirs {
- debug: \
- fixExclusiveOutputDirs(debug, release)
- else: \
- fixExclusiveOutputDirs(release, debug)
+!macx-xcode {
+ debug_and_release {
+ addExclusiveBuilds(debug, Debug, release, Release)
+ } else: fix_output_dirs {
+ debug: \
+ fixExclusiveOutputDirs(debug, release)
+ else: \
+ fixExclusiveOutputDirs(release, debug)
+ }
+} else {
+ # The Xcode generator always generates project files with
+ # debug and release configurations, regardless of whether
+ # or not debug_and_release is active.
+ for(build, $$list(debug release)) {
+ suffix =
+ contains(QT_CONFIG, debug_and_release) {
+ equals(build, debug): \
+ suffix = _debug
+ } else {
+ contains(QT_CONFIG, debug): \
+ suffix = _debug
+ }
+
+ library_suffix_$${build}.name = $$QMAKE_XCODE_LIBRARY_SUFFIX_SETTING
+ library_suffix_$${build}.value = $$suffix
+ library_suffix_$${build}.build = $$build
+ QMAKE_MAC_XCODE_SETTINGS += library_suffix_$${build}
+
+ CONFIG *= xcode_dynamic_library_suffix
+ }
}
diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf
index e31d1f4539..10f421a8e2 100644
--- a/mkspecs/features/testcase.prf
+++ b/mkspecs/features/testcase.prf
@@ -10,34 +10,35 @@ check.files =
check.path = .
# If the test ends up in a different directory, we should cd to that directory.
-# Note that qmake modifies DESTDIR after this file is processed,
-# therefore, testing DESTDIR for emptiness is not sufficient.
-# Also note that in debug-and-release mode we don't want to cd into the debug/release
-# directory (e.g. if the test goes to foo/release/tst_thing.exe, we want to do
-# cd foo && release/tst_thing.exe ).
-MUNGED_DESTDIR=$$DESTDIR
-MUNGED_TARGET=$$TARGET
-win32:debug_and_release {
- contains(DESTDIR,^release$)|contains(DESTDIR,^debug$):MUNGED_DESTDIR=
-
- # In debug-and-release mode, the first ../ in TARGET breaks out of the debug/release
- # subdirectory. However, since make's working directory is already outside of the
- # debug/release subdirectory, this first ../ should be ignored when deciding if
- # we have to change directory before running the test.
- MUNGED_TARGET=$$replace(MUNGED_TARGET,^\\.\\./,)
+TESTRUN_CWD = $$DESTDIR
+
+debug_and_release:debug_and_release_target {
+ # But in debug-and-release-target mode we don't want to cd into the debug/release
+ # directory (e.g. if the test goes to foo/release/tst_thing.exe, we want to do
+ # 'cd foo && release/tst_thing.exe', not 'cd foo/release && tst_thing.exe').
+
+ TESTRUN_CWD ~= s/(release|debug)$//
+ TEST_TARGET_DIR = $$relative_path($$absolute_path($$DESTDIR, $$OUT_PWD), $$absolute_path($$TESTRUN_CWD, $$OUT_PWD))
}
-!isEmpty(MUNGED_DESTDIR):!contains(MUNGED_DESTDIR,^\\./?):check.commands = cd $(DESTDIR) &&
-contains(MUNGED_TARGET,.*/.*):check.commands = cd $(DESTDIR) &&
+
+!isEmpty(TESTRUN_CWD):!contains(TESTRUN_CWD,^\\./?): \
+ check.commands = cd $$system_path($$TESTRUN_CWD) &&
# Allow for a custom test runner script
check.commands += $(TESTRUNNER)
-mac {
- app_bundle: check.commands += ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET)
- else: check.commands += ./$(QMAKE_TARGET)
+unix {
+ isEmpty(TEST_TARGET_DIR): TEST_TARGET_DIR = .
+
+ mac:app_bundle: \
+ check.commands += $${TEST_TARGET_DIR}/$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET)
+ else: \
+ check.commands += $${TEST_TARGET_DIR}/$(QMAKE_TARGET)
+} else {
+ # Windows
+ !isEmpty(TEST_TARGET_DIR): TEST_TARGET_DIR = $${TEST_TARGET_DIR}$${QMAKE_DIR_SEP}
+ check.commands += $${TEST_TARGET_DIR}$(TARGET)
}
-else:unix: check.commands += ./$(QMAKE_TARGET)
-else: check.commands += $(DESTDIR_TARGET)
# Allow for custom arguments to tests
check.commands += $(TESTARGS)
diff --git a/mkspecs/features/unix/default_pre.prf b/mkspecs/features/unix/default_pre.prf
deleted file mode 100644
index d978d14166..0000000000
--- a/mkspecs/features/unix/default_pre.prf
+++ /dev/null
@@ -1,4 +0,0 @@
-linux*:CONFIG = wayland-scanner $$CONFIG
-
-load(default_pre)
-
diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf
index 4d51ffb269..7876ef1c34 100644
--- a/mkspecs/linux-icc/qmake.conf
+++ b/mkspecs/linux-icc/qmake.conf
@@ -42,6 +42,7 @@ QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
+QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions
QMAKE_CXXFLAGS_CXX11 = -std=c++0x
QMAKE_INCDIR =
diff --git a/mkspecs/features/ios/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf
index a61db3daea..0d38c058c9 100644
--- a/mkspecs/features/ios/default_post.prf
+++ b/mkspecs/macx-ios-clang/features/default_post.prf
@@ -17,10 +17,13 @@ equals(TEMPLATE, app) {
# building by calling out to xcodebuild.
TEMPLATE = aux
- CONFIG -= have_target qt staticlib dll
+ CONFIG =
SOURCES =
+ OBJECTIVE_SOURCES =
RESOURCES =
INSTALLS =
+ QMAKE_EXTRA_COMPILERS =
+ QMAKE_EXTRA_TARGETS =
TARGET_XCODE_PROJECT_DIR = $${TARGET}.xcodeproj
@@ -41,6 +44,7 @@ equals(TEMPLATE, app) {
# And distclean
xcodebuild_distclean.commands = "$(DEL_FILE) -R $$TARGET_XCODE_PROJECT_DIR"
+ xcodebuild_distclean.depends = xcodebuild_clean
QMAKE_EXTRA_TARGETS += xcodebuild_distclean
distclean.depends = xcodebuild_distclean
QMAKE_EXTRA_TARGETS += distclean
@@ -53,21 +57,11 @@ macx-xcode {
QMAKE_MAC_XCODE_SETTINGS += ios_device_family
}
-isEmpty(QT_ARCH) {
- # The iPhoneOS and iPhoneSimulator targets share the same toolchain,
- # so when configure runs the arch tests it passes the correct sysroot,
- # but we fail to pick up the architecture since we're not passing -arch
- # yet. Xcode does not seem to have a way to run the shared toolchain
- # in a way that will automatically do this (for example xcrun -sdk).
- contains(QMAKE_MAC_SDK, iphoneos.*): QT_ARCH = arm
- else: QT_ARCH = i386 # Simulator
-}
-
# Be more specific about which architecture we're targeting
equals(QT_ARCH, arm): \
- actual_archs = armv7
+ actual_archs = $$QMAKE_IOS_DEVICE_ARCHS
else: \
- actual_archs = $$QT_ARCH
+ actual_archs = $$QMAKE_IOS_SIMULATOR_ARCHS
macx-xcode {
QMAKE_XCODE_ARCHS = $$actual_archs
diff --git a/mkspecs/macx-ios-clang/features/default_pre.prf b/mkspecs/macx-ios-clang/features/default_pre.prf
new file mode 100644
index 0000000000..b37f67495c
--- /dev/null
+++ b/mkspecs/macx-ios-clang/features/default_pre.prf
@@ -0,0 +1,6 @@
+
+load(default_pre)
+
+# Check for supported Xcode versions
+lessThan(QMAKE_XCODE_VERSION, "4.3"): \
+ error("This mkspec requires Xcode 4.3 or later")
diff --git a/mkspecs/macx-ios-clang/features/qt.prf b/mkspecs/macx-ios-clang/features/qt.prf
new file mode 100644
index 0000000000..2897c62819
--- /dev/null
+++ b/mkspecs/macx-ios-clang/features/qt.prf
@@ -0,0 +1,49 @@
+
+equals(TEMPLATE, app):contains(QT, gui(-private)?) {
+ LIBS *= -L$$[QT_INSTALL_PLUGINS/get]/platforms
+
+ lib_name = qios
+ lib_path_and_base = $$[QT_INSTALL_PLUGINS/get]/platforms/lib$${lib_name}$$qtPlatformTargetSuffix()
+ LIBS += -l$${lib_name}$$qtPlatformTargetSuffix() $$fromfile($${lib_path_and_base}.prl, QMAKE_PRL_LIBS)
+
+ # By marking qt_registerPlatformPlugin as undefined, we ensure that
+ # the plugin.o translation unit is considered for inclusion in
+ # the final binary, which in turn ensures that the plugin's
+ # static initializer is included and run.
+ QMAKE_LFLAGS += -u _qt_registerPlatformPlugin
+
+ # We do link and dependency resolution for the platform plugin
+ # manually, since we know we always need the plugin, so we don't
+ # need to generate an import for it.
+ CONFIG -= import_qpa_plugin
+
+ !no_main_wrapper {
+ # We use ld to rename the _main symbol to _qt_main, so that we don't get a symbol clash
+ # with the _main we provide that calls UIApplicationMain. We need to make a copy of the
+ # original object file, as ld will not copy over DWARF debug information to the output
+ # file. Instead, it will inject a reference back to the original object file, so when
+ # Xcode runs dsymutil to make the final dSYM file it will still find the debug info
+ # for the object file that provided the original _main. This back-reference has the
+ # interesting side-effect of the debug information still referring to the original
+ # symbol name, so stack-traces will show both our wrapper main and the original
+ # user main as 'main', and adding a symbolic breakpoint for 'main' will break on
+ # both functions. Although a bit weird, it's a good thing, as the user will still be
+ # able to add symbolic breakpoints for 'main', not caring that the symbol is actually
+ # called 'qt_main' now.
+
+ isEmpty(OBJECTS_DIR): \
+ OBJECTS_DIR = .
+
+ !isEmpty(QMAKE_PRE_LINK): \
+ QMAKE_PRE_LINK += ";"
+
+ QMAKE_PRE_LINK += \
+ "for f in $(find $${OBJECTS_DIR} -name '*.o'); do" \
+ "(nm $f | grep -q 'T _main' && cp $f $f.original" \
+ "&& ld -r -alias _main _qt_main -unexported_symbol _main $f.original -o $f)" \
+ "|| true" \
+ "; done"
+ }
+}
+
+load(qt)
diff --git a/mkspecs/macx-ios-clang/features/qt_config.prf b/mkspecs/macx-ios-clang/features/qt_config.prf
new file mode 100644
index 0000000000..d9a13f65eb
--- /dev/null
+++ b/mkspecs/macx-ios-clang/features/qt_config.prf
@@ -0,0 +1,12 @@
+load(qt_config)
+
+isEmpty(QT_ARCH) {
+ # The configure tests are run without QT_ARCH being resolved yet, which
+ # means we fail to pass -arch to the compiler, resulting in broke tests.
+ # As the Xcode toolchain doesn't seem to have a way to auto-detect the
+ # arch based on the SDK, we have to hard-code the arch for configure.
+ contains(QMAKE_MAC_SDK, iphoneos.*): \
+ QT_ARCH = arm
+ else: \ # Simulator
+ QT_ARCH = i386
+}
diff --git a/mkspecs/macx-ios-clang/qmake.conf b/mkspecs/macx-ios-clang/qmake.conf
index 38de1e9b0a..7b2e7a17e7 100644
--- a/mkspecs/macx-ios-clang/qmake.conf
+++ b/mkspecs/macx-ios-clang/qmake.conf
@@ -10,11 +10,14 @@ QMAKE_MACOSX_DEPLOYMENT_TARGET =
QMAKE_IOS_DEPLOYMENT_TARGET = 5.0
INCLUDEPATH += $$PWD/ios
-DEFINES += DARWIN_NO_CARBON QT_NO_CORESERVICES QT_NO_PRINTER QT_NO_PRINTDIALOG
+DEFINES += DARWIN_NO_CARBON QT_NO_PRINTER QT_NO_PRINTDIALOG
# Universal target (iPhone and iPad)
QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2
+QMAKE_IOS_DEVICE_ARCHS = armv7
+QMAKE_IOS_SIMULATOR_ARCHS = i386
+
include(../common/ios.conf)
include(../common/gcc-base-mac.conf)
include(../common/clang.conf)
diff --git a/mkspecs/macx-xcode/features/default_post.prf b/mkspecs/macx-xcode/features/default_post.prf
deleted file mode 100644
index 4c4746bb2b..0000000000
--- a/mkspecs/macx-xcode/features/default_post.prf
+++ /dev/null
@@ -1,7 +0,0 @@
-
-isEmpty(QMAKE_INFO_PLIST) {
- plist_template = $$absolute_path(../../$$[QMAKE_XSPEC]/Info.plist.$${TEMPLATE})
- exists($$plist_template): QMAKE_INFO_PLIST = $$plist_template
-}
-
-load(default_post)
diff --git a/mkspecs/macx-xcode/qmake.conf b/mkspecs/macx-xcode/qmake.conf
index bfc1c58935..fde682b64b 100644
--- a/mkspecs/macx-xcode/qmake.conf
+++ b/mkspecs/macx-xcode/qmake.conf
@@ -4,6 +4,12 @@
# OS X + Xcode
#
-include(../$$[QMAKE_XSPEC]/qmake.conf)
+QMAKESPEC = $$dirname(PWD)/$$[QMAKE_XSPEC]
+
+include($$QMAKESPEC/qmake.conf)
MAKEFILE_GENERATOR = XCODE
+
+# The active spec is now the original spec, but we still want
+# Xcode specific blocks to be triggered.
+CONFIG += macx-xcode