Source

Target

Commits (75)
Showing with 217 additions and 200 deletions
......@@ -3032,6 +3032,21 @@ unset tty
eval `LC_ALL=C $TEST_COMPILER $SYSROOT_FLAG $TEST_COMPILER_CXXFLAGS -xc++ -E -v - < /dev/null 2>&1 > /dev/null | $AWK '
BEGIN { ORS = ""; FS = "="; incs = 0; libs = 0; }
function normalize(dir)
{
do {
odir = dir
gsub(/\\/[^\\/]+\\/\\.\\./, "", dir)
} while (dir != odir);
do {
odir = dir
gsub(/\\/\\./, "", dir)
} while (dir != odir);
sub("/$", "", dir);
return dir;
}
function quote(s)
{
# We only handle spaces
......@@ -3047,14 +3062,19 @@ function quote(s)
/^\#include </ { yup=1; print "DEFAULT_INCDIRS=\""; next }
/^End of search/ { yup=0; print "\"\n" }
/ \(framework directory\)$/ { next }
yup { print quote(substr($0, 2)) " "; ++incs }
yup { print quote(normalize(substr($0, 2))) " "; ++incs }
# extract from one line like LIBRARY_PATH=/one/path:/another/path:...
$1 == "LIBRARY_PATH" {
libs = split($2, library_paths, ":");
print "DEFAULT_LIBDIRS=\"";
for (lib in library_paths)
print quote(library_paths[lib]) " ";
for (lib in library_paths) {
dir = normalize(library_paths[lib]);
if (!(dir in dirs)) {
print quote(dir) " ";
dirs[dir] = 1;
}
}
print "\"\n"
}
......@@ -5501,6 +5521,7 @@ elif [ "$CFG_EGL" != "no" ]; then
QMAKE_CFLAGS_EGL=`$PKG_CONFIG --cflags egl 2>/dev/null`
QMakeVar set QMAKE_INCDIR_EGL "$QMAKE_INCDIR_EGL"
QMakeVar set QMAKE_LIBS_EGL "$QMAKE_LIBS_EGL"
QMakeVar set QMAKE_CFLAGS_EGL "`echo " $QMAKE_CFLAGS_EGL " | sed -e 's, -I[^ ]* , ,g;s,^ ,,;s, $,,'`"
fi # detect EGL support
if compileTest qpa/egl "EGL" $QMAKE_CFLAGS_EGL $QMAKE_LIBS_EGL; then
CFG_EGL=yes
......
......@@ -88,6 +88,8 @@ QtGui
QtNetwork
---------
- API was added to store and resume TLS session tickets.
- The minimum support openssl version has been increased to openssl 1.0. The
code to support older versions has not been removed, but is no longer
supported.
......
......@@ -45,8 +45,6 @@
#include <QGuiApplication>
#include <qtconcurrentmap.h>
#ifndef QT_NO_CONCURRENT
QImage scale(const QImage &image)
{
qDebug() << "Scaling image in thread" << QThread::currentThread();
......@@ -70,23 +68,3 @@ int main(int argc, char *argv[])
return 0;
}
#else
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QString text("Qt Concurrent is not yet supported on this platform");
QLabel *label = new QLabel(text);
label->setWordWrap(true);
label->show();
qDebug() << text;
app.exec();
}
#endif
......@@ -38,7 +38,7 @@
**
****************************************************************************/
#include <QtGui>
#include <QtCore>
#include <stdio.h>
#include <stdlib.h>
......
SOURCES += semaphores.cpp
QT = core gui
QT = core
CONFIG -= app_bundle
CONFIG += console
......
......@@ -38,7 +38,7 @@
**
****************************************************************************/
#include <QtGui>
#include <QtCore>
#include <stdio.h>
#include <stdlib.h>
......
QT = core gui
QT = core
CONFIG -= moc app_bundle
CONFIG += console
......
......@@ -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()
......
......@@ -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 += "}"
......
......@@ -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]/
......
list(APPEND _Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
$$CMAKE_SOURCE_INCLUDES
)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
$$CMAKE_SOURCE_PRIVATE_INCLUDES
)
......@@ -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)
......
......@@ -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
......
......@@ -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
......@@ -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
......
......@@ -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
}
}
......@@ -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 =
......
......@@ -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
......
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
......@@ -21,54 +18,31 @@ equals(TEMPLATE, app):contains(QT, gui(-private)?) {
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
# 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_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
}