Merge remote-tracking branch 'origin/5.4' into dev

Conflicts:
	src/corelib/io/qiodevice.cpp
	src/plugins/bearer/linux_common/qofonoservice_linux.cpp
	src/plugins/bearer/linux_common/qofonoservice_linux_p.h
	src/plugins/platforms/android/qandroidplatformtheme.cpp
	src/tools/bootstrap/bootstrap.pro
	src/widgets/styles/qmacstyle_mac.mm

Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
This commit is contained in:
Frederik Gladhorn 2014-11-24 13:37:06 +01:00
commit 34aba4724f
690 changed files with 26310 additions and 18496 deletions

8
configure vendored
View File

@ -1434,7 +1434,8 @@ while [ "$#" -gt 0 ]; do
fi fi
;; ;;
feature-*) feature-*)
FEATURE=`echo $VAR | sed 's,^[^-]*-\([^-]*\),\1,' | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` FEATURE=`echo $VAR | sed 's,^[^-]*-\([^-]*\),\1,' | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
if grep "^Feature: *${FEATURE} *\$" "$relpath"/src/corelib/global/qfeatures.txt >/dev/null 2>&1; then
if [ "$VAL" = "no" ]; then if [ "$VAL" = "no" ]; then
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE" QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE"
elif [ "$VAL" = "yes" ] || [ "$VAL" = "unknown" ]; then elif [ "$VAL" = "yes" ] || [ "$VAL" = "unknown" ]; then
@ -1442,6 +1443,10 @@ while [ "$#" -gt 0 ]; do
else else
UNKNOWN_OPT=yes UNKNOWN_OPT=yes
fi fi
else
echo "ERROR: Unknown feature $FEATURE"
UNKNOWN_OPT=yes
fi
;; ;;
shared) shared)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
@ -3183,6 +3188,7 @@ if [ "$XPLATFORM_IOS" = "yes" ]; then
CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS examples" CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS examples"
CFG_SHARED="no" # iOS builds should be static to be able to submit to the App Store CFG_SHARED="no" # iOS builds should be static to be able to submit to the App Store
CFG_SKIP_MODULES="$CFG_SKIP_MODULES qtconnectivity qtdoc qtmacextras qtserialport qtwebkit qtwebkit-examples" CFG_SKIP_MODULES="$CFG_SKIP_MODULES qtconnectivity qtdoc qtmacextras qtserialport qtwebkit qtwebkit-examples"
CFG_PRECOMPILE="no" # Precompiled headers not supported with multiple -arch arguments
# If the user passes -sdk on the command line we build a SDK-specific Qt build. # If the user passes -sdk on the command line we build a SDK-specific Qt build.
# Otherwise we build a joined simulator and device build, which is the default. # Otherwise we build a joined simulator and device build, which is the default.

47
dist/changes-5.4.0 vendored
View File

@ -25,6 +25,10 @@ QtCore
- Added QEnableSharedFromThis, a class that allows obtaining a - Added QEnableSharedFromThis, a class that allows obtaining a
QSharedPointer for an object already managed by a shared pointer. QSharedPointer for an object already managed by a shared pointer.
QtGui
-----
- QImageReader now automatically rotates JPEG images according to Exif orientation
QtSql QtSql
----- -----
@ -43,3 +47,46 @@ OS X
- OS X 10.10 is now supported. - OS X 10.10 is now supported.
- QMacStyle has been updated with better OS 10.10 support. - QMacStyle has been updated with better OS 10.10 support.
- The Qt binary packages are now configured with C++11 enabled. - The Qt binary packages are now configured with C++11 enabled.
Windows
-------
- [QTBUG-38259] Changed configure defaults so that Qt5Core does not
link against ICU libraries anymore. Pass '-icu' to enable it.
****************************************************************************
* Tools *
****************************************************************************
configure & build system
------------------------
- The -process/-fully-process/-dont-process configure options have been
removed due to being unnecessary and counterproductive.
- [QTBUG-36955] The -vcproj configure option was removed. Use "qmake -r -tp vc"
_after_ building Qt in case you want to use Visual Studio to work on Qt.
- [QTBUG-37961] Qt plugins contain version info again.
- [QTBUG-39216] Fixed more cases where the Qt build would pick up headers
from a pre-existing Qt installation.
- [QTBUG-41267] Fixed parallelized (jom) -debug-and-release builds.
qmake
-----
- [QTBUG-21910][Unix] Added 'make dist' target for SUBDIRS projects.
- [QTBUG-32895][iOS] Fixed structure of bundles. They can be signed now.
- [QTBUG-26782][VS] Fixed handling of TARGET_EXT.
- [QTBUG-30712][VS] Fixed handling of QMAKE_LIBFLAGS.
- [QTBUG-30373][VS] Using different RESOURCES in different build variants
no longer produces invalid vcxproj files.
- [QTBUG-37520][VS] Made it possible to suppress qmake warnings about
unknown compiler options. CONFIG+=suppress_vcproj_warnings.
- [QTBUG-37363][MSVC2012+] embed_manifest_exe is now properly supported.
- [QTBUG-41504][MSVC2012+] Building DLLs targeting Windows XP is now
supported. As a side effect, Windows CE makespecs must not add /ENTRY: to
QMAKE_LFLAGS_CONSOLE any more. The flag is hard-coded in console.prf now.
- [QTBUG-35318][Xcode] Fixed QMAKE_BUNDLE_DATA's path resolution.
- [QTBUG-39527] Fixed qtCompile() when used with jom -jN.
- QMAKE_EXTRA_COMPILERS' commands and depend_command are no longer mangled.
Use $$shell_path() and $$shell_quote() to prepare the commands correctly.
- Added link-time optimization support for Clang, GCC and ICC. CONFIG+=ltgc.

View File

@ -483,3 +483,15 @@
\externalpage http://qt-project.org/doc/qtcreator/creator-developing-winrt.html \externalpage http://qt-project.org/doc/qtcreator/creator-developing-winrt.html
\title Qt Creator: Connecting Windows Runtime Devices \title Qt Creator: Connecting Windows Runtime Devices
*/ */
/*!
\externalpage http://qt-project.org/doc/qtcreator/creator-clang-codemodel.html
\title Qt Creator: Parsing C++ Files
*/
/*!
\externalpage http://qt-project.org/doc/qtcreator/creator-quick-ui-forms.html
\title Qt Creator: Qt Quick UI Forms
*/
/*!
\externalpage http://qt-project.org/doc/qtcreator/creator-clang-static-analyzer.html
\title Qt Creator: Using Clang Static Analyzer
*/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -2,7 +2,6 @@ body {
font: normal 400 14px/1.2 Arial; font: normal 400 14px/1.2 Arial;
margin-top: 85px; margin-top: 85px;
font-family: Arial, Helvetica; font-family: Arial, Helvetica;
color: #313131;
text-align: left; text-align: left;
margin-left: 5px; margin-left: 5px;
margin-right: 5px; margin-right: 5px;
@ -365,7 +364,9 @@ h3.fn, span.fn {
margin: 0px; margin: 0px;
margin-top: 45px; margin-top: 45px;
} }
h3.fn code {
float: right;
}
h3.fn:target { h3.fn:target {
background-color: #F6F6D6; background-color: #F6F6D6;
} }
@ -711,8 +712,21 @@ Landing page
float: left; float: left;
} }
.icons1of3 h2 { .icons1of3 h2, .doc-column h2 {
font-size: 15px; font-size: 15px;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
div.multi-column {
position: relative;
}
div.multi-column div {
display: -moz-inline-box;
display: inline-block;
vertical-align: top;
margin-top: 1em;
margin-right: 4em;
width: 24em;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -127,6 +127,9 @@ static void updateItem(QTreeWidgetItem *item, const QNetworkConfiguration &confi
void BearerMonitor::configurationAdded(const QNetworkConfiguration &config, QTreeWidgetItem *parent) void BearerMonitor::configurationAdded(const QNetworkConfiguration &config, QTreeWidgetItem *parent)
{ {
if (!config.isValid())
return;
QTreeWidgetItem *item = new QTreeWidgetItem; QTreeWidgetItem *item = new QTreeWidgetItem;
updateItem(item, config); updateItem(item, config);

View File

@ -181,7 +181,7 @@ void SslClient::sendData()
form->sessionInput->clear(); form->sessionInput->clear();
} }
void SslClient::socketError(QAbstractSocket::SocketError error) void SslClient::socketError(QAbstractSocket::SocketError)
{ {
QMessageBox::critical(this, tr("Connection error"), socket->errorString()); QMessageBox::critical(this, tr("Connection error"), socket->errorString());
} }

View File

@ -26,7 +26,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="hostNameEdit"> <widget class="QLineEdit" name="hostNameEdit">
<property name="text"> <property name="text">
<string>imap.example.com</string> <string>www.qt.io</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -46,7 +46,7 @@
<number>65535</number> <number>65535</number>
</property> </property>
<property name="value"> <property name="value">
<number>993</number> <number>443</number>
</property> </property>
</widget> </widget>
</item> </item>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 916 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 340 B

View File

@ -75,12 +75,12 @@
\snippet mainwindows/application/mainwindow.cpp 0 \snippet mainwindows/application/mainwindow.cpp 0
We start by including \c <QtGui>, a header file that contains the We start by including \c <QtWidgets>, a header file that contains the
definition of all classes in the Qt Core and Qt GUI definition of all classes in the Qt Core, Qt GUI and Qt Widgets
modules. This saves us from the trouble of having to include modules. This saves us from the trouble of having to include
every class individually. We also include \c mainwindow.h. every class individually. We also include \c mainwindow.h.
You might wonder why we don't include \c <QtGui> in \c You might wonder why we don't include \c <QtWidgets> in \c
mainwindow.h and be done with it. The reason is that including mainwindow.h and be done with it. The reason is that including
such a large header from another header file can rapidly degrade such a large header from another header file can rapidly degrade
performances. Here, it wouldn't do any harm, but it's still performances. Here, it wouldn't do any harm, but it's still

View File

@ -55,8 +55,8 @@
\snippet mainwindows/dockwidgets/mainwindow.cpp 0 \snippet mainwindows/dockwidgets/mainwindow.cpp 0
We start by including \c <QtGui>, a header file that contains the We start by including \c <QtWidgets>, a header file that contains the
definition of all classes in the Qt Core and Qt GUI definition of all classes in the Qt Core, Qt GUI and Qt Widgets
modules. This saves us from having to include modules. This saves us from having to include
every class individually and is especially convenient if we add new every class individually and is especially convenient if we add new
widgets. We also include \c mainwindow.h. widgets. We also include \c mainwindow.h.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 834 B

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -41,6 +41,8 @@
#include "buttontester.h" #include "buttontester.h"
#include <QDebug>
void ButtonTester::mousePressEvent(QMouseEvent *e) void ButtonTester::mousePressEvent(QMouseEvent *e)
{ {
int j = ButtonTester::buttonByNumber (e->button()); int j = ButtonTester::buttonByNumber (e->button());

View File

@ -41,10 +41,8 @@
#ifndef BUTTONTESTER_H #ifndef BUTTONTESTER_H
#define BUTTONTESTER_H #define BUTTONTESTER_H
#include <QtWidgets>
#include <QTextEdit> #include <QTextEdit>
#include <QString> #include <QString>
#include <QDebug>
#include <QMouseEvent> #include <QMouseEvent>
#include <QWheelEvent> #include <QWheelEvent>

View File

@ -40,7 +40,10 @@
****************************************************************************/ ****************************************************************************/
#include "buttontester.h" #include "buttontester.h"
#include <QtGui>
#include <QApplication>
#include <QPushButton>
#include <QVBoxLayout>
int main(int argv, char **args) int main(int argv, char **args)
{ {

View File

@ -7,6 +7,9 @@ QMAKE_COMPILER = gcc clang llvm # clang pretends to be gcc
QMAKE_CC = clang QMAKE_CC = clang
QMAKE_CXX = clang++ QMAKE_CXX = clang++
QMAKE_LINK_C = $$QMAKE_CC
QMAKE_LINK_C_SHLIB = $$QMAKE_CC
QMAKE_LINK = $$QMAKE_CXX QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX QMAKE_LINK_SHLIB = $$QMAKE_CXX

View File

@ -11,11 +11,15 @@
QMAKE_COMPILER = rim_qcc gcc # qcc is mostly gcc in disguise QMAKE_COMPILER = rim_qcc gcc # qcc is mostly gcc in disguise
QMAKE_CFLAGS_OPTIMIZE = -O2
QMAKE_CFLAGS_OPTIMIZE_FULL = -O3
QMAKE_CFLAGS += -Wno-psabi QMAKE_CFLAGS += -Wno-psabi
QMAKE_CFLAGS_DEPS += -M QMAKE_CFLAGS_DEPS += -M
QMAKE_CFLAGS_WARN_ON += -Wall -W QMAKE_CFLAGS_WARN_ON += -Wall -W
QMAKE_CFLAGS_WARN_OFF += -w QMAKE_CFLAGS_WARN_OFF += -w
QMAKE_CFLAGS_RELEASE += -O2 QMAKE_CFLAGS_RELEASE += $$QMAKE_CFLAGS_OPTIMIZE
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g
QMAKE_CFLAGS_DEBUG += -g QMAKE_CFLAGS_DEBUG += -g
QMAKE_CFLAGS_SHLIB += -fPIC -shared QMAKE_CFLAGS_SHLIB += -fPIC -shared
QMAKE_CFLAGS_STATIC_LIB += -fPIC QMAKE_CFLAGS_STATIC_LIB += -fPIC
@ -36,6 +40,7 @@ QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS
QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB

View File

@ -34,7 +34,7 @@
<m2:ShowOn Tile=\"square150x150Logo\" /> <m2:ShowOn Tile=\"square150x150Logo\" />
</m2:ShowNameOnTiles> </m2:ShowNameOnTiles>
</m2:DefaultTile> </m2:DefaultTile>
<m2:SplashScreen Image=\"$${WINRT_MANIFEST.logo_splash}\" /> <m2:SplashScreen Image=\"$${WINRT_MANIFEST.logo_splash}\" />$${WINRT_MANIFEST.rotation_preference}
</m2:VisualElements> </m2:VisualElements>
</Application> </Application>
</Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies} </Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies}

View File

@ -37,7 +37,7 @@
<m3:ShowOn Tile=\"square150x150Logo\" /> <m3:ShowOn Tile=\"square150x150Logo\" />
</m3:ShowNameOnTiles> </m3:ShowNameOnTiles>
</m3:DefaultTile> </m3:DefaultTile>
<m3:SplashScreen Image=\"$${WINRT_MANIFEST.logo_480x800}\" /> <m3:SplashScreen Image=\"$${WINRT_MANIFEST.logo_480x800}\" />$${WINRT_MANIFEST.rotation_preference}
</m3:VisualElements> </m3:VisualElements>
</Application> </Application>
</Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies} </Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies}

View File

@ -4,8 +4,6 @@
include(../common/linux_device_pre.conf) include(../common/linux_device_pre.conf)
QT_QPA_DEFAULT_PLATFORM = wayland
QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib
QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/opt/vc/lib QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/opt/vc/lib
@ -21,7 +19,6 @@ QMAKE_LIBS_EGL = -lEGL -lGLESv2
contains(DISTRO, squeeze) { contains(DISTRO, squeeze) {
#Debian Squeeze: Legacy everything #Debian Squeeze: Legacy everything
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 -lEGL QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 -lEGL
QT_QPA_DEFAULT_PLATFORM = eglfs
} else:contains(DISTRO, arch) { } else:contains(DISTRO, arch) {
#On principle: no wizardry required #On principle: no wizardry required
} else { } else {

View File

@ -1,4 +1,7 @@
equals(MAKEFILE_GENERATOR, UNIX) { QMAKE_MAKE = $$(MAKE)
!isEmpty(QMAKE_MAKE) {
# We were called recursively. Use the right make, as MAKEFLAGS may be set as well.
} else:equals(MAKEFILE_GENERATOR, UNIX) {
QMAKE_MAKE = make QMAKE_MAKE = make
} else:equals(MAKEFILE_GENERATOR, MINGW) { } else:equals(MAKEFILE_GENERATOR, MINGW) {
!equals(QMAKE_HOST.os, Windows): \ !equals(QMAKE_HOST.os, Windows): \

View File

@ -35,6 +35,30 @@ qt:!isEmpty(QT_CONFIG) {
QMAKE_LFLAGS += -stdlib=libstdc++ QMAKE_LFLAGS += -stdlib=libstdc++
} }
} }
# If Qt was built with shared libraries with rpath support and project does
# not specify own rpaths (including empty list) add one pointing to Qt
# libraries. This applies only to apps, since all loaded libraries inherit
# rpaths from current process executable.
else:!if(host_build:force_bootstrap):equals(TEMPLATE, app):!defined(QMAKE_RPATHDIR, var):contains(QT_CONFIG, rpath) {
# If app is outside of Qt SDK prefix use absolute path to Qt libraries,
# otherwise make it relative, so all SDK tools and examples work when
# relocated.
# Tests are an exception, since they are launched in their build not
# install location by CI, so we cannot use relative rpaths there.
if(!contains(target.path, "$$re_escape($$[QT_INSTALL_PREFIX])/.*")|\
contains(target.path, "$$re_escape($$[QT_INSTALL_TESTS])/.*")) {
QMAKE_RPATHDIR = $$[QT_INSTALL_LIBS]
} else {
app_bundle {
ios: binpath = $$target.path/$${TARGET}.app
else: binpath = $$target.path/$${TARGET}.app/Contents/MacOS
} else {
binpath = $$target.path
}
QMAKE_RPATHDIR = @loader_path/$$relative_path($$[QT_INSTALL_LIBS], $$binpath)
unset(binpath)
}
}
} }
macx-xcode:!isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) { macx-xcode:!isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {

View File

@ -9,8 +9,12 @@ isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) {
QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null") QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null")
isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'") isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'")
cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set stash, QMAKE_MAC_SDK_PATH) cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set stash, QMAKE_MAC_SDK_PATH)
QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version SDKVersion 2>/dev/null")
isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$$QMAKE_MAC_SDK\'")
cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version, set stash, QMAKE_MAC_SDK_VERSION)
} else { } else {
QMAKE_MAC_SDK_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) QMAKE_MAC_SDK_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path)
QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version)
} }
!equals(MAKEFILE_GENERATOR, XCODE) { !equals(MAKEFILE_GENERATOR, XCODE) {

View File

@ -44,20 +44,20 @@ warnings_are_errors:warning_clean {
# This setting is compiler-dependent anyway because it depends on the version of the # This setting is compiler-dependent anyway because it depends on the version of the
# compiler. # compiler.
clang { clang {
# Apple clang 4.0-4.2,5.0 # Apple clang 4.0-4.2,5.0-5.1
# Regular clang 3.3 & 3.4 # Regular clang 3.3 & 3.4
apple_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION} apple_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
reg_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION} reg_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
contains(apple_ver, "4\\.[012]|5\\.0")|contains(reg_ver, "3\\.[34]") { contains(apple_ver, "4\\.[012]|5\\.[01]")|contains(reg_ver, "3\\.[34]") {
QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR
# glibc's bswap_XX macros use the "register" keyword # glibc's bswap_XX macros use the "register" keyword
linux:equals(reg_ver, "3.4"): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=deprecated-register linux:equals(reg_ver, "3.4"): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=deprecated-register
} }
} else:intel_icc:linux { } else:intel_icc:linux {
# Intel CC 13.0 - 14.0, on Linux only # Intel CC 13.0 - 15.0, on Linux only
ver = $${QT_ICC_MAJOR_VERSION}.$${QT_ICC_MINOR_VERSION} ver = $${QT_ICC_MAJOR_VERSION}.$${QT_ICC_MINOR_VERSION}
linux:contains(ver, "(13\\.|14\\.0)") { linux:contains(ver, "(1[34]\\.|15\\.0)") {
# 177: function "entity" was declared but never referenced # 177: function "entity" was declared but never referenced
# (too aggressive; ICC reports even for functions created due to template instantiation) # (too aggressive; ICC reports even for functions created due to template instantiation)
# 1224: #warning directive # 1224: #warning directive
@ -67,9 +67,9 @@ warnings_are_errors:warning_clean {
QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1881 $$WERROR QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1881 $$WERROR
} }
} else:gcc:!clang:!intel_icc { } else:gcc:!clang:!intel_icc {
# GCC 4.6-4.8 # GCC 4.6-4.9
ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION} ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION}
contains(ver, "4\\.[678]") { contains(ver, "4\\.[6789]") {
QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=cpp -Wno-error=deprecated-declarations $$WERROR QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=cpp -Wno-error=deprecated-declarations $$WERROR
# GCC prints this bogus warning, after it has inlined a lot of code # GCC prints this bogus warning, after it has inlined a lot of code

View File

@ -94,6 +94,8 @@ else: \
# OS X and iOS frameworks # OS X and iOS frameworks
mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
# Set the CFBundleIdentifier prefix for Qt frameworks
QMAKE_TARGET_BUNDLE_PREFIX = org.qt-project
#QMAKE_FRAMEWORK_VERSION = 4.0 #QMAKE_FRAMEWORK_VERSION = 4.0
CONFIG += lib_bundle sliced_bundle qt_framework CONFIG += lib_bundle sliced_bundle qt_framework
CONFIG -= qt_install_headers #no need to install these as well CONFIG -= qt_install_headers #no need to install these as well

View File

@ -58,7 +58,9 @@ MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MOD
MODULE_MASTER_DEPS_HEADER_CONT = $$autogen_warning MODULE_MASTER_DEPS_HEADER_CONT = $$autogen_warning
MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}ifdef __cplusplus /* create empty PCH in C mode */" MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}ifdef __cplusplus /* create empty PCH in C mode */"
for(dep, MODULE_DEPENDS) { for(dep, MODULE_DEPENDS) {
depname = $$eval(QT.$${dep}.name) depname = $$eval(QT.$${dep}.master_header)
isEmpty(depname): \
depname = $$eval(QT.$${dep}.name)
MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>" MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>"
} }
MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}endif" MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}endif"

View File

@ -74,6 +74,10 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
module_plugtypes = "QT.$${MODULE_ID}.plugin_types = $$replace(MODULE_PLUGIN_TYPES, /.*$, )" module_plugtypes = "QT.$${MODULE_ID}.plugin_types = $$replace(MODULE_PLUGIN_TYPES, /.*$, )"
else: \ else: \
module_plugtypes = module_plugtypes =
!isEmpty(MODULE_MASTER_HEADER): \
module_master = "QT.$${MODULE_ID}.master_header = $$MODULE_MASTER_HEADER"
else: \
module_master =
!no_module_headers:!minimal_syncqt { !no_module_headers:!minimal_syncqt {
MODULE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME MODULE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME
MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \
@ -97,6 +101,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
"QT.$${MODULE_ID}.name = $$TARGET" \ "QT.$${MODULE_ID}.name = $$TARGET" \
"QT.$${MODULE_ID}.libs = $$module_libs" \ "QT.$${MODULE_ID}.libs = $$module_libs" \
$$module_rpath \ $$module_rpath \
$$module_master \
"QT.$${MODULE_ID}.includes = $$MODULE_INCLUDES" "QT.$${MODULE_ID}.includes = $$MODULE_INCLUDES"
!host_build: MODULE_PRI_CONT += \ !host_build: MODULE_PRI_CONT += \
"QT.$${MODULE_ID}.bins = \$\$QT_MODULE_BIN_BASE" \ "QT.$${MODULE_ID}.bins = \$\$QT_MODULE_BIN_BASE" \

View File

@ -11,7 +11,7 @@ rcc.name = RCC ${QMAKE_FILE_IN}
rcc.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} rcc.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN}
rcc.CONFIG += add_inputs_as_makefile_deps rcc.CONFIG += add_inputs_as_makefile_deps
resources_small|ltcg|macx-xcode|contains(TEMPLATE, "vc.*") { !resources_big|ltcg|macx-xcode|contains(TEMPLATE, "vc.*") {
rcc.output = $$RCC_DIR/$${first(QMAKE_MOD_RCC)}_${QMAKE_FILE_BASE}$${first(QMAKE_EXT_CPP)} rcc.output = $$RCC_DIR/$${first(QMAKE_MOD_RCC)}_${QMAKE_FILE_BASE}$${first(QMAKE_EXT_CPP)}
rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}

View File

@ -24,6 +24,7 @@
# WINRT_MANIFEST.logo_medium: Medium logo image file. Default provided by the mkspec. # WINRT_MANIFEST.logo_medium: Medium logo image file. Default provided by the mkspec.
# WINRT_MANIFEST.logo_large: Large logo image file. Default provided by the mkspec. # WINRT_MANIFEST.logo_large: Large logo image file. Default provided by the mkspec.
# WINRT_MANIFEST.splash_screen: Splash screen image file. Default provided by the mkspec. # WINRT_MANIFEST.splash_screen: Splash screen image file. Default provided by the mkspec.
# WINRT_MANIFEST.rotation_preference: Orientation specification. Default is empty. (portrait, landscape, landscapeFlipped)
# WINRT_MANIFEST.iconic_tile_icon: Image file for the "iconic" tile template icon. Default provided by the mkspec. # WINRT_MANIFEST.iconic_tile_icon: Image file for the "iconic" tile template icon. Default provided by the mkspec.
# WINRT_MANIFEST.iconic_tile_small: Image file for the small "iconic" tile template logo. Default provided by the mkspec. # WINRT_MANIFEST.iconic_tile_small: Image file for the small "iconic" tile template logo. Default provided by the mkspec.
# WINRT_MANIFEST.default_language: Specifies the default language of the application # WINRT_MANIFEST.default_language: Specifies the default language of the application
@ -87,6 +88,20 @@
isEmpty(WINRT_MANIFEST.foreground): WINRT_MANIFEST.foreground = light isEmpty(WINRT_MANIFEST.foreground): WINRT_MANIFEST.foreground = light
isEmpty(WINRT_MANIFEST.default_language): WINRT_MANIFEST.default_language = en isEmpty(WINRT_MANIFEST.default_language): WINRT_MANIFEST.default_language = en
INDENT = "$$escape_expand(\\r\\n) "
VS_XML_NAMESPACE = "m2"
winphone: VS_XML_NAMESPACE = "m3"
WINRT_MANIFEST.rotation_preference = $$unique(WINRT_MANIFEST.rotation_preference)
!isEmpty(WINRT_MANIFEST.rotation_preference) {
MANIFEST_ROTATION += "<$${VS_XML_NAMESPACE}:InitialRotationPreference>"
for(ROTATION, WINRT_MANIFEST.rotation_preference): \
MANIFEST_ROTATION += " <$${VS_XML_NAMESPACE}:Rotation Preference=\"$$ROTATION\" />"
MANIFEST_ROTATION += "</$${VS_XML_NAMESPACE}:InitialRotationPreference>"
WINRT_MANIFEST.rotation_preference = $$join(MANIFEST_ROTATION, $$INDENT, $$INDENT)
}
INDENT = "$$escape_expand(\\r\\n) " INDENT = "$$escape_expand(\\r\\n) "
# Capabilities are given as a string list and may change with the configuration (network, sensors, etc.) # Capabilities are given as a string list and may change with the configuration (network, sensors, etc.)

View File

@ -14,6 +14,8 @@
<string>@TYPEINFO@</string> <string>@TYPEINFO@</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -14,6 +14,8 @@
<string>@TYPEINFO@</string> <string>@TYPEINFO@</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -14,6 +14,8 @@
<string>@TYPEINFO@</string> <string>@TYPEINFO@</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -14,6 +14,8 @@
<string>@TYPEINFO@</string> <string>@TYPEINFO@</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -14,6 +14,8 @@
<string>@TYPEINFO@</string> <string>@TYPEINFO@</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -14,6 +14,8 @@
<string>@TYPEINFO@</string> <string>@TYPEINFO@</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -14,6 +14,8 @@
<string>@TYPEINFO@</string> <string>@TYPEINFO@</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -52,8 +52,7 @@ QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
# Disabled, due to invalid C++11 code on Apple headers QMAKE_CXXFLAGS_CXX11 = -std=c++11
#QMAKE_CXXFLAGS_CXX11 = -std=c++11
QMAKE_CXXFLAGS_SPLIT_SECTIONS = $$QMAKE_CFLAGS_SPLIT_SECTIONS QMAKE_CXXFLAGS_SPLIT_SECTIONS = $$QMAKE_CFLAGS_SPLIT_SECTIONS
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
@ -85,7 +84,7 @@ QMAKE_CXXFLAGS_PRECOMPILE = -c -pch-create ${QMAKE_PCH_OUTPUT} -include ${QMAKE_
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
include(../common/macx.conf) include(../common/macx.conf)

View File

@ -24,6 +24,8 @@
<string>1.0</string> <string>1.0</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>

View File

@ -0,0 +1,45 @@
<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"6250\" systemVersion=\"14A343f\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\">
<dependencies>
<plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"6244\"/>
<capability name=\"Constraints with non-1.0 multipliers\" minToolsVersion=\"5.1\"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File\'s Owner\"/>
<placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>
<view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">
<rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"480\"/>
<autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>
<subviews>
<label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" misplaced=\"YES\" text=\"\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"9\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"8ie-xW-0ye\">
<rect key=\"frame\" x=\"20\" y=\"439\" width=\"441\" height=\"21\"/>
<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>
<color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>
<nil key=\"highlightedColor\"/>
<variation key=\"widthClass=compact\">
<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"11\"/>
</variation>
</label>
<label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"$$TARGET\"
textAlignment=\"center\" lineBreakMode=\"middleTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"18\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"kId-c2-rCX\">
<rect key=\"frame\" x=\"20\" y=\"140\" width=\"441\" height=\"43\"/>
<fontDescription key=\"fontDescription\" type=\"boldSystem\" pointSize=\"36\"/>
<color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>
<nil key=\"highlightedColor\"/>
</label>
</subviews>
<color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>
<constraints>
<constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"centerY\" secondItem=\"iN0-l3-epB\" secondAttribute=\"bottom\" multiplier=\"1/3\" constant=\"1\" id=\"Kid-kn-2rF\"/>
<constraint firstAttribute=\"centerX\" secondItem=\"kId-c2-rCX\" secondAttribute=\"centerX\" id=\"Koa-jz-hwk\"/>
<constraint firstAttribute=\"bottom\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"bottom\" constant=\"20\" id=\"Kzo-t9-V3l\"/>
<constraint firstItem=\"8ie-xW-0ye\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"MfP-vx-nX0\"/>
<constraint firstAttribute=\"centerX\" secondItem=\"8ie-xW-0ye\" secondAttribute=\"centerX\" id=\"ZEH-qu-HZ9\"/>
<constraint firstItem=\"kId-c2-rCX\" firstAttribute=\"leading\" secondItem=\"iN0-l3-epB\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"fvb-Df-36g\"/>
</constraints>
<nil key=\"simulatedStatusBarMetrics\"/>
<freeformSimulatedSizeMetrics key=\"simulatedDestinationMetrics\"/>
<point key=\"canvasLocation\" x=\"404\" y=\"445\"/>
</view>
</objects>
</document>

View File

@ -184,6 +184,14 @@ macx-xcode {
QMAKE_SUBSTITUTES += copy_image QMAKE_SUBSTITUTES += copy_image
launch_images.files = $$copy_image.output launch_images.files = $$copy_image.output
QMAKE_BUNDLE_DATA += launch_images QMAKE_BUNDLE_DATA += launch_images
# Set up default LaunchScreen to support iPhone6/6+
launch_screen = LaunchScreen.xib
copy_launch_screen.input = $$QMAKESPEC/$$launch_screen
copy_launch_screen.output = $$OUT_PWD/$${TARGET}.xcodeproj/$$launch_screen
QMAKE_SUBSTITUTES += copy_launch_screen
launch_screens.files = $$copy_launch_screen.output
QMAKE_BUNDLE_DATA += launch_screens
} }
macx-xcode { macx-xcode {
@ -193,22 +201,32 @@ macx-xcode {
arch_iphonesimulator.value = $$QMAKE_IOS_SIMULATOR_ARCHS arch_iphonesimulator.value = $$QMAKE_IOS_SIMULATOR_ARCHS
QMAKE_MAC_XCODE_SETTINGS += arch_iphoneos arch_iphonesimulator QMAKE_MAC_XCODE_SETTINGS += arch_iphoneos arch_iphonesimulator
unset(QMAKE_XCODE_ARCHS) QMAKE_XCODE_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS
} else {
# Be more specific about which architecture we're targeting
equals(QT_ARCH, arm): \
actual_archs = $$QMAKE_IOS_DEVICE_ARCHS
else: \
actual_archs = $$QMAKE_IOS_SIMULATOR_ARCHS
for(arch, actual_archs): \ only_active_arch.name = ONLY_ACTIVE_ARCH
arch_flags += -arch $$arch only_active_arch.value = YES
only_active_arch.build = debug
QMAKE_MAC_XCODE_SETTINGS += only_active_arch
} else {
# Be more specific about which architecture we're targeting
contains(QT_ARCH, arm.*): \
VALID_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS
else: \
VALID_ARCHS = $$QMAKE_IOS_SIMULATOR_ARCHS
single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ACTIVE_ARCHS), $(EXPORT_ACTIVE_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
QMAKE_EXTRA_VARIABLES += VALID_ARCHS ACTIVE_ARCHS ARCH_ARGS
arch_flags = $(EXPORT_ARCH_ARGS)
QMAKE_CFLAGS += $$arch_flags QMAKE_CFLAGS += $$arch_flags
QMAKE_CXXFLAGS += $$arch_flags QMAKE_CXXFLAGS += $$arch_flags
QMAKE_OBJECTIVE_CFLAGS += $$arch_flags QMAKE_OBJECTIVE_CFLAGS += $$arch_flags
QMAKE_LFLAGS += $$arch_flags QMAKE_LFLAGS += $$arch_flags
} }
unset(actual_archs)
load(default_post) load(default_post)

View File

@ -32,17 +32,19 @@ equals(TEMPLATE, app):contains(QT, gui(-private)?) {
# called 'qt_main' now. # called 'qt_main' now.
macx-xcode { macx-xcode {
objects_dir = "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}/${CURRENT_ARCH}" objects_dir = "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}"
archs = "${ARCHS}"
} else { } else {
objects_dir = $$OBJECTS_DIR objects_dir = $$OBJECTS_DIR
isEmpty(objects_dir): \ isEmpty(objects_dir): \
objects_dir = . objects_dir = .
archs = "$$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS"
} }
!isEmpty(QMAKE_PRE_LINK): \ !isEmpty(QMAKE_PRE_LINK): \
QMAKE_PRE_LINK += ";" QMAKE_PRE_LINK += ";"
QMAKE_PRE_LINK += $$QMAKESPEC/rename_main.sh $${objects_dir} QMAKE_PRE_LINK += $$QMAKESPEC/rename_main.sh $${objects_dir} \"$${archs}\"
} }
} }

View File

@ -9,4 +9,8 @@ isEmpty(QT_ARCH) {
QT_ARCH = arm QT_ARCH = arm
else: \ # Simulator else: \ # Simulator
QT_ARCH = i386 QT_ARCH = i386
# Prevent the arch/config tests from building as multi-arch binaries,
# as we only want the lowest common denominator features.
CONFIG += single_arch
} }

View File

@ -0,0 +1,4 @@
load(sdk)
lessThan(QMAKE_MAC_SDK_VERSION, "8.0"): \
error("Current $$QMAKE_MAC_SDK SDK version ($$QMAKE_MAC_SDK_VERSION) is too old. Please upgrade Xcode.")

View File

@ -15,8 +15,8 @@ DEFINES += DARWIN_NO_CARBON QT_NO_PRINTER QT_NO_PRINTDIALOG
# Universal target (iPhone and iPad) # Universal target (iPhone and iPad)
QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2 QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2
QMAKE_IOS_DEVICE_ARCHS = armv7 QMAKE_IOS_DEVICE_ARCHS = armv7 arm64
QMAKE_IOS_SIMULATOR_ARCHS = i386 QMAKE_IOS_SIMULATOR_ARCHS = i386 x86_64
include(../common/ios.conf) include(../common/ios.conf)
include(../common/gcc-base-mac.conf) include(../common/gcc-base-mac.conf)

View File

@ -41,10 +41,14 @@
## ##
############################################################################# #############################################################################
if [ $# -eq 0 ]; then if [ $# -ne 2 ]; then
echo "usage: $0 <path to object files>" echo "$0: wrong number of arguments for internal tool used by iOS mkspec"
else else
for f in $(find $1 -name '*.o'); do arch_paths=""
for a in $2; do
arch_paths="$arch_paths $1/$a"
done
for f in $(find $arch_paths -name '*.o'); do
# Skip object files without the _main symbol # Skip object files without the _main symbol
nm $f 2>/dev/null | grep -q 'T _main$' || continue nm $f 2>/dev/null | grep -q 'T _main$' || continue

View File

@ -14,6 +14,8 @@
<string>@TYPEINFO@</string> <string>@TYPEINFO@</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>@LIBRARY@</string> <string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key> <key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict> </dict>

View File

@ -13,6 +13,7 @@ QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
QMAKE_INCDIR = /usr/local/include QMAKE_INCDIR = /usr/local/include
QMAKE_LIBDIR = /usr/local/lib QMAKE_LIBDIR = /usr/local/lib
QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
QMAKE_LFLAGS_THREAD = -pthread QMAKE_LFLAGS_THREAD = -pthread
QMAKE_LIBS = QMAKE_LIBS =
@ -28,6 +29,5 @@ QMAKE_RANLIB =
include(../../common/unix.conf) include(../../common/unix.conf)
include(../../common/gcc-base-unix.conf) include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/clang.conf) include(../../common/clang.conf)
load(qt_config) load(qt_config)

View File

@ -1029,6 +1029,21 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if (!project->isEmpty("QMAKE_PRE_LINK")) { if (!project->isEmpty("QMAKE_PRE_LINK")) {
QString phase_key = keyFor("QMAKE_PBX_PRELINK_BUILDPHASE"); QString phase_key = keyFor("QMAKE_PBX_PRELINK_BUILDPHASE");
project->values("QMAKE_PBX_BUILDPHASES").append(phase_key); project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
ProStringList inputPaths;
ProStringList outputPaths;
const ProStringList &archs = project->values("QMAKE_XCODE_ARCHS");
if (!archs.isEmpty()) {
for (int i = 0; i < archs.size(); ++i) {
const ProString &arch = archs.at(i);
inputPaths << "$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/" + arch + "/";
outputPaths << "$(LINK_FILE_LIST_$(CURRENT_VARIANT)_" + arch + ")";
}
} else {
inputPaths << "$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/$(CURRENT_ARCH)/";
outputPaths << "$(LINK_FILE_LIST_$(CURRENT_VARIANT)_$(CURRENT_ARCH))";
}
t << "\t\t" << phase_key << " = {\n" t << "\t\t" << phase_key << " = {\n"
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("files", ProStringList(), SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("files", ProStringList(), SettingsAsList, 4) << ";\n"
@ -1036,8 +1051,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
// resolved dependenices, so we have to ensure that this phase is run after the // resolved dependenices, so we have to ensure that this phase is run after the
// compilation phase, and before the link phase. Making the phase depend on the // compilation phase, and before the link phase. Making the phase depend on the
// object file directory, and "write" to the list of files to link achieves that. // object file directory, and "write" to the list of files to link achieves that.
<< "\t\t\t" << writeSettings("inputPaths", ProStringList("$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/$(CURRENT_ARCH)/"), SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("inputPaths", inputPaths, SettingsAsList, 4) << ";\n"
<< "\t\t\t" << writeSettings("outputPaths", ProStringList("$(LINK_FILE_LIST_$(CURRENT_VARIANT)_$(CURRENT_ARCH))"), SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("outputPaths", outputPaths, SettingsAsList, 4) << ";\n"
<< "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("name", "Qt Prelink") << ";\n" << "\t\t\t" << writeSettings("name", "Qt Prelink") << ";\n"
@ -1107,9 +1122,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("shellScript", fixForOutput("cp -r $BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME " + escapeFilePath(destDir))) << ";\n" << "\t\t\t" << writeSettings("shellScript", fixForOutput("cp -r $BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME " + escapeFilePath(destDir))) << ";\n"
<< "\t\t};\n"; << "\t\t};\n";
} }
bool copyBundleResources = project->isActiveConfig("app_bundle") && project->first("TEMPLATE") == "app";
ProStringList bundle_resources_files;
// Copy Bundle Data // Copy Bundle Data
if (!project->isEmpty("QMAKE_BUNDLE_DATA")) { if (!project->isEmpty("QMAKE_BUNDLE_DATA")) {
ProStringList bundle_file_refs; ProStringList bundle_file_refs;
bool ios = project->isActiveConfig("ios");
//all bundle data //all bundle data
const ProStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA"); const ProStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA");
@ -1137,21 +1155,27 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t};\n"; << "\t\t};\n";
} }
QString phase_key = keyFor("QMAKE_PBX_BUNDLE_COPY." + bundle_data[i]); if (copyBundleResources && ((ios && path.isEmpty())
if (!project->isEmpty(ProKey(bundle_data[i] + ".version"))) { || (!ios && path == QLatin1String("Contents/Resources")))) {
//### foreach (const ProString &s, bundle_files)
} bundle_resources_files << s;
} else {
QString phase_key = keyFor("QMAKE_PBX_BUNDLE_COPY." + bundle_data[i]);
if (!project->isEmpty(ProKey(bundle_data[i] + ".version"))) {
//###
}
project->values("QMAKE_PBX_BUILDPHASES").append(phase_key); project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
t << "\t\t" << phase_key << " = {\n" t << "\t\t" << phase_key << " = {\n"
<< "\t\t\t" << writeSettings("name", "Copy '" + bundle_data[i] + "' Files to Bundle") << ";\n" << "\t\t\t" << writeSettings("name", "Copy '" + bundle_data[i] + "' Files to Bundle") << ";\n"
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("dstPath", escapeFilePath(path)) << ";\n" << "\t\t\t" << writeSettings("dstPath", escapeFilePath(path)) << ";\n"
<< "\t\t\t" << writeSettings("dstSubfolderSpec", "1", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("dstSubfolderSpec", "1", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("files", bundle_files, SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("isa", "PBXCopyFilesBuildPhase", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("isa", "PBXCopyFilesBuildPhase", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("files", bundle_files, SettingsAsList, 4) << ";\n"
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
<< "\t\t};\n"; << "\t\t};\n";
}
} }
QString bundle_data_key = keyFor("QMAKE_PBX_BUNDLE_DATA"); QString bundle_data_key = keyFor("QMAKE_PBX_BUNDLE_DATA");
@ -1166,8 +1190,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
// Copy bundle resources. Optimizes resources, and puts them into the Resources // Copy bundle resources. Optimizes resources, and puts them into the Resources
// subdirectory on OSX, but doesn't support paths. // subdirectory on OSX, but doesn't support paths.
if (project->isActiveConfig("app_bundle") && project->first("TEMPLATE") == "app") { if (copyBundleResources) {
ProStringList bundle_resources_files;
if (!project->isEmpty("ICON")) { if (!project->isEmpty("ICON")) {
ProString icon = project->first("ICON"); ProString icon = project->first("ICON");
if (icon.length() >= 2 && (icon.at(0) == '"' || icon.at(0) == '\'') && icon.endsWith(icon.at(0))) if (icon.length() >= 2 && (icon.at(0) == '"' || icon.at(0) == '\'') && icon.endsWith(icon.at(0)))

View File

@ -814,22 +814,26 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
} }
commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "; QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" ";
QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
if (bundlePrefix.isEmpty())
bundlePrefix = "com.yourcompany";
if (bundlePrefix.endsWith("."))
bundlePrefix.chop(1);
QString bundleIdentifier = bundlePrefix + "." + var("QMAKE_BUNDLE");
if (bundleIdentifier.endsWith(".app"))
bundleIdentifier.chop(4);
if (bundleIdentifier.endsWith(".framework"))
bundleIdentifier.chop(10);
commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" ";
if (isApp) { if (isApp) {
QString icon = fileFixify(var("ICON")); QString icon = fileFixify(var("ICON"));
QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
if (bundlePrefix.isEmpty())
bundlePrefix = "com.yourcompany";
if (bundlePrefix.endsWith("."))
bundlePrefix.chop(1);
QString bundleIdentifier = bundlePrefix + "." + var("QMAKE_BUNDLE");
if (bundleIdentifier.endsWith(".app"))
bundleIdentifier.chop(4);
t << "@$(DEL_FILE) " << info_plist_out << "\n\t" t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
<< "@sed "; << "@sed ";
foreach (const ProString &arg, commonSedArgs) foreach (const ProString &arg, commonSedArgs)
t << arg; t << arg;
t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" " t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" "
<< "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" "
<< "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" " << "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" "
<< "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "

View File

@ -46,6 +46,7 @@ QT_BEGIN_NAMESPACE
const char _CLCompile[] = "ClCompile"; const char _CLCompile[] = "ClCompile";
const char _ItemGroup[] = "ItemGroup"; const char _ItemGroup[] = "ItemGroup";
const char _Link[] = "Link"; const char _Link[] = "Link";
const char _Lib[] = "Lib";
const char _ManifestTool[] = "ManifestTool"; const char _ManifestTool[] = "ManifestTool";
const char _Midl[] = "Midl"; const char _Midl[] = "Midl";
const char _ResourceCompile[] = "ResourceCompile"; const char _ResourceCompile[] = "ResourceCompile";
@ -757,8 +758,11 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
// ClCompile // ClCompile
write(xml, config.compiler); write(xml, config.compiler);
// Link // Librarian / Linker
write(xml, config.linker); if (config.ConfigurationType == typeStaticLibrary)
write(xml, config.librarian);
else
write(xml, config.linker);
// Midl // Midl
write(xml, config.idl); write(xml, config.idl);
@ -1686,7 +1690,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCCustomBuildTool &tool)
void VCXProjectWriter::write(XmlOutput &xml, const VCLibrarianTool &tool) void VCXProjectWriter::write(XmlOutput &xml, const VCLibrarianTool &tool)
{ {
xml xml
<< tag(_Link) << tag(_Lib)
<< attrTagX(_AdditionalDependencies, tool.AdditionalDependencies, ";") << attrTagX(_AdditionalDependencies, tool.AdditionalDependencies, ";")
<< attrTagX(_AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories, ";") << attrTagX(_AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories, ";")
<< attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ")
@ -1706,7 +1710,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCLibrarianTool &tool)
//unused << attrTagS(_TargetMachine, tool.TargetMachine) //unused << attrTagS(_TargetMachine, tool.TargetMachine)
//unused << attrTagT(_TreatLibWarningAsErrors, tool.TreatLibWarningAsErrors) //unused << attrTagT(_TreatLibWarningAsErrors, tool.TreatLibWarningAsErrors)
//unused << attrTagT(_Verbose, tool.Verbose) //unused << attrTagT(_Verbose, tool.Verbose)
<< closetag(_Link); << closetag(_Lib);
} }
void VCXProjectWriter::write(XmlOutput &xml, const VCResourceCompilerTool &tool) void VCXProjectWriter::write(XmlOutput &xml, const VCResourceCompilerTool &tool)
@ -1911,10 +1915,10 @@ bool VCXProjectWriter::outputFileConfig(OutputFilterData *d, XmlOutput &xml, Xml
} }
// Actual XML output ---------------------------------- // Actual XML output ----------------------------------
if (hasCustomBuildStep || filter.useCompilerTool if (hasCustomBuildStep || filter.useCustomBuildTool || filter.useCompilerTool
|| !d->inBuild || filter.Name.startsWith("Deployment Files")) { || !d->inBuild || filter.Name.startsWith("Deployment Files")) {
if (hasCustomBuildStep) if (hasCustomBuildStep || filter.useCustomBuildTool)
{ {
if (!fileAdded) { if (!fileAdded) {
fileAdded = true; fileAdded = true;

View File

@ -416,8 +416,8 @@ QStringList ProStringList::toQStringList() const
{ {
QStringList ret; QStringList ret;
ret.reserve(size()); ret.reserve(size());
foreach (const ProString &str, *this) for (int i = 0; i < size(); i++) // foreach causes MSVC2010 ICE
ret << str.toQString(); ret << at(i).toQString();
return ret; return ret;
} }

View File

@ -140,7 +140,7 @@ for (ft, features) {
"$${LITERAL_HASH} define QT_NO_$$ft" \ "$${LITERAL_HASH} define QT_NO_$$ft" \
"$${LITERAL_HASH}endif" "$${LITERAL_HASH}endif"
FEATURES_PRI += \ FEATURES_PRI += \
"contains(QT_DISABLED_FEATURES, "^($$lower($$join($$list($$replace(features.$${ft}.depends, _, -)), "|")))$"): \\" \ "contains(QT_DISABLED_FEATURES, "$$lower($$join($$list($$replace(features.$${ft}.depends, _, -)), "|"))"): \\" \
" QT_DISABLED_FEATURES += $$lower($$replace(ft, _, -))" " QT_DISABLED_FEATURES += $$lower($$replace(ft, _, -))"
} }
} }
@ -168,7 +168,8 @@ for (def, QT_NO_DEFINES) {
} }
no_features = $$unique(no_features) no_features = $$unique(no_features)
# Can't simply add these to QT_CONFIG, as e.g., contains(QT_CONFIG, accessibility) matches no-accessibililty. # Don't simply add these to QT_CONFIG, as then one might expect them to be there without load(qfeatures).
# And we don't want to do that automatically, as the dynamic dependency resolution is somewhat expensive.
FEATURES_PRI = \ FEATURES_PRI = \
"$${LITERAL_HASH} Features disabled by configure:" \ "$${LITERAL_HASH} Features disabled by configure:" \
"QT_DISABLED_FEATURES =$$lower($$join($$list($$replace(no_features, _, -)), " ", " "))" \ "QT_DISABLED_FEATURES =$$lower($$join($$list($$replace(no_features, _, -)), " ", " "))" \

View File

@ -21,10 +21,12 @@ Mozilla Corporation
Turbulenz Turbulenz
Klarälvdalens Datakonsult AB Klarälvdalens Datakonsult AB
Microsoft Open Technologies, Inc. Microsoft Open Technologies, Inc.
NVIDIA Corporation
Jacek Caban Jacek Caban
Mark Callow Mark Callow
Ginn Chen Ginn Chen
Tibor den Ouden
James Hauxwell James Hauxwell
Sam Hocevar Sam Hocevar
Pierre Leveille Pierre Leveille

View File

@ -78,7 +78,12 @@ Turbulenz
Ulrik Persson (ddefrostt) Ulrik Persson (ddefrostt)
Mark Banner (standard8mbp) Mark Banner (standard8mbp)
David Kilzer David Kilzer
Jacek Caban
Tibor den Ouden
Microsoft Open Technologies, Inc. Microsoft Open Technologies, Inc.
Cooper Partin Cooper Partin
Austin Kinross Austin Kinross
NVIDIA Corporation
Olli Etuaho

View File

@ -238,7 +238,7 @@ EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
#ifndef EGL_VERSION_1_5 #ifndef EGL_VERSION_1_5
#define EGL_VERSION_1_5 1 #define EGL_VERSION_1_5 1
typedef void *EGLSync; typedef void *EGLSync;
typedef khronos_intptr_t EGLAttrib; typedef intptr_t EGLAttrib;
typedef khronos_utime_nanoseconds_t EGLTime; typedef khronos_utime_nanoseconds_t EGLTime;
#define EGL_CONTEXT_MAJOR_VERSION 0x3098 #define EGL_CONTEXT_MAJOR_VERSION 0x3098
#define EGL_CONTEXT_MINOR_VERSION 0x30FB #define EGL_CONTEXT_MINOR_VERSION 0x30FB

View File

@ -59,7 +59,7 @@ extern "C" {
#ifndef EGL_KHR_cl_event2 #ifndef EGL_KHR_cl_event2
#define EGL_KHR_cl_event2 1 #define EGL_KHR_cl_event2 1
typedef void *EGLSyncKHR; typedef void *EGLSyncKHR;
typedef khronos_intptr_t EGLAttribKHR; typedef intptr_t EGLAttribKHR;
typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list);
#ifdef EGL_EGLEXT_PROTOTYPES #ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list);
@ -442,20 +442,22 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu
#define EGL_ANGLE_platform_angle 1 #define EGL_ANGLE_platform_angle 1
#define EGL_PLATFORM_ANGLE_ANGLE 0x3201 #define EGL_PLATFORM_ANGLE_ANGLE 0x3201
#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3202 #define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3202
#define EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE 0x3203 #define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE 0x3203
#define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE 0x3204
#define EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE 0x3205
#endif /* EGL_ANGLE_platform_angle */ #endif /* EGL_ANGLE_platform_angle */
#ifndef EGL_ANGLE_platform_angle_d3d #ifndef EGL_ANGLE_platform_angle_d3d
#define EGL_ANGLE_platform_angle_d3d 1 #define EGL_ANGLE_platform_angle_d3d 1
#define EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE 0x3204 #define EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE 0x3206
#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3205 #define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3207
#define EGL_PLATFORM_ANGLE_TYPE_D3D11_WARP_ANGLE 0x3206 #define EGL_PLATFORM_ANGLE_USE_WARP_ANGLE 0x3208
#endif /* EGL_ANGLE_platform_angle_d3d */ #endif /* EGL_ANGLE_platform_angle_d3d */
#ifndef EGL_ANGLE_platform_angle_opengl #ifndef EGL_ANGLE_platform_angle_opengl
#define EGL_ANGLE_platform_angle_opengl 1 #define EGL_ANGLE_platform_angle_opengl 1
#define EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE 0x3207 #define EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE 0x3209
#define EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE 0x3208 #define EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE 0x320A
#endif /* EGL_ANGLE_platform_angle_opengl */ #endif /* EGL_ANGLE_platform_angle_opengl */
#ifndef EGL_ARM_pixmap_multisample_discard #ifndef EGL_ARM_pixmap_multisample_discard

View File

@ -67,23 +67,22 @@
* implementations. * implementations.
*/ */
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) /* Windows Runtime */ #if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
struct IUnknown;
typedef IUnknown *EGLNativeDisplayType;
typedef void *EGLNativePixmapType;
typedef IUnknown *EGLNativeWindowType;
#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
#ifndef WIN32_LEAN_AND_MEAN #ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1 #define WIN32_LEAN_AND_MEAN 1
#endif #endif
#include <windows.h> #include <windows.h>
typedef HDC EGLNativeDisplayType;
typedef HBITMAP EGLNativePixmapType; typedef HBITMAP EGLNativePixmapType;
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) /* Windows Store */
#include <inspectable.h>
typedef IInspectable* EGLNativeDisplayType;
typedef IInspectable* EGLNativeWindowType;
#else
typedef HDC EGLNativeDisplayType;
typedef HWND EGLNativeWindowType; typedef HWND EGLNativeWindowType;
#endif
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ #elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */

View File

@ -27,6 +27,10 @@
#include "KHR/khrplatform.h" #include "KHR/khrplatform.h"
#include <map>
#include <string>
#include <vector>
// //
// This is the platform independent interface between an OGL driver // This is the platform independent interface between an OGL driver
// and the shading language compiler. // and the shading language compiler.
@ -42,18 +46,17 @@ typedef unsigned int GLenum;
// Note: make sure to increment ANGLE_SH_VERSION when changing ShaderVars.h // Note: make sure to increment ANGLE_SH_VERSION when changing ShaderVars.h
#include "ShaderVars.h" #include "ShaderVars.h"
#ifdef __cplusplus
extern "C" {
#endif
// Version number for shader translation API. // Version number for shader translation API.
// It is incremented every time the API changes. // It is incremented every time the API changes.
#define ANGLE_SH_VERSION 130 #define ANGLE_SH_VERSION 132
typedef enum { typedef enum {
SH_GLES2_SPEC = 0x8B40, SH_GLES2_SPEC = 0x8B40,
SH_WEBGL_SPEC = 0x8B41, SH_WEBGL_SPEC = 0x8B41,
SH_GLES3_SPEC = 0x8B86,
SH_WEBGL2_SPEC = 0x8B87,
// The CSS Shaders spec is a subset of the WebGL spec. // The CSS Shaders spec is a subset of the WebGL spec.
// //
// In both CSS vertex and fragment shaders, ANGLE: // In both CSS vertex and fragment shaders, ANGLE:
@ -85,31 +88,6 @@ typedef enum {
SH_HLSL11_OUTPUT = 0x8B48 SH_HLSL11_OUTPUT = 0x8B48
} ShShaderOutput; } ShShaderOutput;
typedef enum {
SH_PRECISION_HIGHP = 0x5001,
SH_PRECISION_MEDIUMP = 0x5002,
SH_PRECISION_LOWP = 0x5003,
SH_PRECISION_UNDEFINED = 0
} ShPrecisionType;
typedef enum {
SH_INFO_LOG_LENGTH = 0x8B84,
SH_OBJECT_CODE_LENGTH = 0x8B88, // GL_SHADER_SOURCE_LENGTH
SH_ACTIVE_UNIFORMS = 0x8B86,
SH_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87,
SH_ACTIVE_ATTRIBUTES = 0x8B89,
SH_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A,
SH_VARYINGS = 0x8BBB,
SH_VARYING_MAX_LENGTH = 0x8BBC,
SH_MAPPED_NAME_MAX_LENGTH = 0x6000,
SH_NAME_MAX_LENGTH = 0x6001,
SH_HASHED_NAME_MAX_LENGTH = 0x6002,
SH_HASHED_NAMES_COUNT = 0x6003,
SH_SHADER_VERSION = 0x6004,
SH_RESOURCES_STRING_LENGTH = 0x6005,
SH_OUTPUT_TYPE = 0x6006
} ShShaderInfo;
// Compile options. // Compile options.
typedef enum { typedef enum {
SH_VALIDATE = 0, SH_VALIDATE = 0,
@ -208,14 +186,14 @@ typedef enum {
// //
// Driver must call this first, once, before doing any other // Driver must call this first, once, before doing any other
// compiler operations. // compiler operations.
// If the function succeeds, the return value is nonzero, else zero. // If the function succeeds, the return value is true, else false.
// //
COMPILER_EXPORT int ShInitialize(); COMPILER_EXPORT bool ShInitialize();
// //
// Driver should call this at shutdown. // Driver should call this at shutdown.
// If the function succeeds, the return value is nonzero, else zero. // If the function succeeds, the return value is true, else false.
// //
COMPILER_EXPORT int ShFinalize(); COMPILER_EXPORT bool ShFinalize();
// The 64 bits hash function. The first parameter is the input string; the // The 64 bits hash function. The first parameter is the input string; the
// second parameter is the string length. // second parameter is the string length.
@ -246,6 +224,12 @@ typedef struct
int EXT_frag_depth; int EXT_frag_depth;
int EXT_shader_texture_lod; int EXT_shader_texture_lod;
// Set to 1 to enable replacing GL_EXT_draw_buffers #extension directives
// with GL_NV_draw_buffers in ESSL output. This flag can be used to emulate
// EXT_draw_buffers by using it in combination with GLES3.0 glDrawBuffers
// function. This applies to Tegra K1 devices.
int NV_draw_buffers;
// Set to 1 if highp precision is supported in the fragment language. // Set to 1 if highp precision is supported in the fragment language.
// Default is 0. // Default is 0.
int FragmentPrecisionHigh; int FragmentPrecisionHigh;
@ -274,8 +258,10 @@ typedef struct
// //
// Initialize built-in resources with minimum expected values. // Initialize built-in resources with minimum expected values.
// Parameters:
// resources: The object to initialize. Will be comparable with memcmp.
// //
COMPILER_EXPORT void ShInitBuiltInResources(ShBuiltInResources* resources); COMPILER_EXPORT void ShInitBuiltInResources(ShBuiltInResources *resources);
// //
// ShHandle held by but opaque to the driver. It is allocated, // ShHandle held by but opaque to the driver. It is allocated,
@ -284,18 +270,15 @@ COMPILER_EXPORT void ShInitBuiltInResources(ShBuiltInResources* resources);
// //
// If handle creation fails, 0 will be returned. // If handle creation fails, 0 will be returned.
// //
typedef void* ShHandle; typedef void *ShHandle;
// //
// Returns the a concatenated list of the items in ShBuiltInResources as a string. // Returns the a concatenated list of the items in ShBuiltInResources as a
// null-terminated string.
// This function must be updated whenever ShBuiltInResources is changed. // This function must be updated whenever ShBuiltInResources is changed.
// Parameters: // Parameters:
// handle: Specifies the handle of the compiler to be used. // handle: Specifies the handle of the compiler to be used.
// outStringLen: Specifies the size of the buffer, in number of characters. The size COMPILER_EXPORT const std::string &ShGetBuiltInResourcesString(const ShHandle handle);
// of the buffer required to store the resources string can be obtained
// by calling ShGetInfo with SH_RESOURCES_STRING_LENGTH.
// outStr: Returns a null-terminated string representing all the built-in resources.
COMPILER_EXPORT void ShGetBuiltInResourcesString(const ShHandle handle, size_t outStringLen, char *outStr);
// //
// Driver calls these to create and destroy compiler objects. // Driver calls these to create and destroy compiler objects.
@ -313,12 +296,12 @@ COMPILER_EXPORT ShHandle ShConstructCompiler(
sh::GLenum type, sh::GLenum type,
ShShaderSpec spec, ShShaderSpec spec,
ShShaderOutput output, ShShaderOutput output,
const ShBuiltInResources* resources); const ShBuiltInResources *resources);
COMPILER_EXPORT void ShDestruct(ShHandle handle); COMPILER_EXPORT void ShDestruct(ShHandle handle);
// //
// Compiles the given shader source. // Compiles the given shader source.
// If the function succeeds, the return value is nonzero, else zero. // If the function succeeds, the return value is true, else false.
// Parameters: // Parameters:
// handle: Specifies the handle of compiler to be used. // handle: Specifies the handle of compiler to be used.
// shaderStrings: Specifies an array of pointers to null-terminated strings // shaderStrings: Specifies an array of pointers to null-terminated strings
@ -340,123 +323,36 @@ COMPILER_EXPORT void ShDestruct(ShHandle handle);
// SH_VARIABLES: Extracts attributes, uniforms, and varyings. // SH_VARIABLES: Extracts attributes, uniforms, and varyings.
// Can be queried by calling ShGetVariableInfo(). // Can be queried by calling ShGetVariableInfo().
// //
COMPILER_EXPORT int ShCompile( COMPILER_EXPORT bool ShCompile(
const ShHandle handle, const ShHandle handle,
const char* const shaderStrings[], const char * const shaderStrings[],
size_t numStrings, size_t numStrings,
int compileOptions int compileOptions);
);
// Returns a parameter from a compiled shader. // Return the version of the shader language.
COMPILER_EXPORT int ShGetShaderVersion(const ShHandle handle);
// Return the currently set language output type.
COMPILER_EXPORT ShShaderOutput ShGetShaderOutputType(
const ShHandle handle);
// Returns null-terminated information log for a compiled shader.
// Parameters: // Parameters:
// handle: Specifies the compiler // handle: Specifies the compiler
// pname: Specifies the parameter to query. COMPILER_EXPORT const std::string &ShGetInfoLog(const ShHandle handle);
// The following parameters are defined:
// SH_INFO_LOG_LENGTH: the number of characters in the information log
// including the null termination character.
// SH_OBJECT_CODE_LENGTH: the number of characters in the object code
// including the null termination character.
// SH_ACTIVE_ATTRIBUTES: the number of active attribute variables.
// SH_ACTIVE_ATTRIBUTE_MAX_LENGTH: the length of the longest active attribute
// variable name including the null
// termination character.
// SH_ACTIVE_UNIFORMS: the number of active uniform variables.
// SH_ACTIVE_UNIFORM_MAX_LENGTH: the length of the longest active uniform
// variable name including the null
// termination character.
// SH_VARYINGS: the number of varying variables.
// SH_VARYING_MAX_LENGTH: the length of the longest varying variable name
// including the null termination character.
// SH_MAPPED_NAME_MAX_LENGTH: the length of the mapped variable name including
// the null termination character.
// SH_NAME_MAX_LENGTH: the max length of a user-defined name including the
// null termination character.
// SH_HASHED_NAME_MAX_LENGTH: the max length of a hashed name including the
// null termination character.
// SH_HASHED_NAMES_COUNT: the number of hashed names from the latest compile.
// SH_SHADER_VERSION: the version of the shader language
// SH_OUTPUT_TYPE: the currently set language output type
//
// params: Requested parameter
COMPILER_EXPORT void ShGetInfo(const ShHandle handle,
ShShaderInfo pname,
size_t* params);
// Returns nul-terminated information log for a compiled shader.
// Parameters:
// handle: Specifies the compiler
// infoLog: Specifies an array of characters that is used to return
// the information log. It is assumed that infoLog has enough memory
// to accomodate the information log. The size of the buffer required
// to store the returned information log can be obtained by calling
// ShGetInfo with SH_INFO_LOG_LENGTH.
COMPILER_EXPORT void ShGetInfoLog(const ShHandle handle, char* infoLog);
// Returns null-terminated object code for a compiled shader. // Returns null-terminated object code for a compiled shader.
// Parameters: // Parameters:
// handle: Specifies the compiler // handle: Specifies the compiler
// infoLog: Specifies an array of characters that is used to return COMPILER_EXPORT const std::string &ShGetObjectCode(const ShHandle handle);
// the object code. It is assumed that infoLog has enough memory to
// accomodate the object code. The size of the buffer required to
// store the returned object code can be obtained by calling
// ShGetInfo with SH_OBJECT_CODE_LENGTH.
COMPILER_EXPORT void ShGetObjectCode(const ShHandle handle, char* objCode);
// Returns information about a shader variable. // Returns a (original_name, hash) map containing all the user defined
// names in the shader, including variable names, function names, struct
// names, and struct field names.
// Parameters: // Parameters:
// handle: Specifies the compiler // handle: Specifies the compiler
// variableType: Specifies the variable type; options include COMPILER_EXPORT const std::map<std::string, std::string> *ShGetNameHashingMap(
// SH_ACTIVE_ATTRIBUTES, SH_ACTIVE_UNIFORMS, SH_VARYINGS. const ShHandle handle);
// index: Specifies the index of the variable to be queried.
// length: Returns the number of characters actually written in the string
// indicated by name (excluding the null terminator) if a value other
// than NULL is passed.
// size: Returns the size of the variable.
// type: Returns the data type of the variable.
// precision: Returns the precision of the variable.
// staticUse: Returns 1 if the variable is accessed in a statement after
// pre-processing, whether or not run-time flow of control will
// cause that statement to be executed.
// Returns 0 otherwise.
// name: Returns a null terminated string containing the name of the
// variable. It is assumed that name has enough memory to accormodate
// the variable name. The size of the buffer required to store the
// variable name can be obtained by calling ShGetInfo with
// SH_ACTIVE_ATTRIBUTE_MAX_LENGTH, SH_ACTIVE_UNIFORM_MAX_LENGTH,
// SH_VARYING_MAX_LENGTH.
// mappedName: Returns a null terminated string containing the mapped name of
// the variable, It is assumed that mappedName has enough memory
// (SH_MAPPED_NAME_MAX_LENGTH), or NULL if don't care about the
// mapped name. If the name is not mapped, then name and mappedName
// are the same.
COMPILER_EXPORT void ShGetVariableInfo(const ShHandle handle,
ShShaderInfo variableType,
int index,
size_t* length,
int* size,
sh::GLenum* type,
ShPrecisionType* precision,
int* staticUse,
char* name,
char* mappedName);
// Returns information about a name hashing entry from the latest compile.
// Parameters:
// handle: Specifies the compiler
// index: Specifies the index of the name hashing entry to be queried.
// name: Returns a null terminated string containing the user defined name.
// It is assumed that name has enough memory to accomodate the name.
// The size of the buffer required to store the user defined name can
// be obtained by calling ShGetInfo with SH_NAME_MAX_LENGTH.
// hashedName: Returns a null terminated string containing the hashed name of
// the uniform variable, It is assumed that hashedName has enough
// memory to accomodate the name. The size of the buffer required
// to store the name can be obtained by calling ShGetInfo with
// SH_HASHED_NAME_MAX_LENGTH.
COMPILER_EXPORT void ShGetNameHashingEntry(const ShHandle handle,
int index,
char* name,
char* hashedName);
// Shader variable inspection. // Shader variable inspection.
// Returns a pointer to a list of variables of the designated type. // Returns a pointer to a list of variables of the designated type.
@ -476,17 +372,17 @@ typedef struct
int size; int size;
} ShVariableInfo; } ShVariableInfo;
// Returns 1 if the passed in variables pack in maxVectors following // Returns true if the passed in variables pack in maxVectors following
// the packing rules from the GLSL 1.017 spec, Appendix A, section 7. // the packing rules from the GLSL 1.017 spec, Appendix A, section 7.
// Returns 0 otherwise. Also look at the SH_ENFORCE_PACKING_RESTRICTIONS // Returns false otherwise. Also look at the SH_ENFORCE_PACKING_RESTRICTIONS
// flag above. // flag above.
// Parameters: // Parameters:
// maxVectors: the available rows of registers. // maxVectors: the available rows of registers.
// varInfoArray: an array of variable info (types and sizes). // varInfoArray: an array of variable info (types and sizes).
// varInfoArraySize: the size of the variable array. // varInfoArraySize: the size of the variable array.
COMPILER_EXPORT int ShCheckVariablesWithinPackingLimits( COMPILER_EXPORT bool ShCheckVariablesWithinPackingLimits(
int maxVectors, int maxVectors,
ShVariableInfo* varInfoArray, ShVariableInfo *varInfoArray,
size_t varInfoArraySize); size_t varInfoArraySize);
// Gives the compiler-assigned register for an interface block. // Gives the compiler-assigned register for an interface block.
@ -497,7 +393,7 @@ COMPILER_EXPORT int ShCheckVariablesWithinPackingLimits(
// interfaceBlockName: Specifies the interface block // interfaceBlockName: Specifies the interface block
// indexOut: output variable that stores the assigned register // indexOut: output variable that stores the assigned register
COMPILER_EXPORT bool ShGetInterfaceBlockRegister(const ShHandle handle, COMPILER_EXPORT bool ShGetInterfaceBlockRegister(const ShHandle handle,
const char *interfaceBlockName, const std::string &interfaceBlockName,
unsigned int *indexOut); unsigned int *indexOut);
// Gives the compiler-assigned register for uniforms in the default // Gives the compiler-assigned register for uniforms in the default
@ -509,11 +405,7 @@ COMPILER_EXPORT bool ShGetInterfaceBlockRegister(const ShHandle handle,
// interfaceBlockName: Specifies the uniform // interfaceBlockName: Specifies the uniform
// indexOut: output variable that stores the assigned register // indexOut: output variable that stores the assigned register
COMPILER_EXPORT bool ShGetUniformRegister(const ShHandle handle, COMPILER_EXPORT bool ShGetUniformRegister(const ShHandle handle,
const char *uniformName, const std::string &uniformName,
unsigned int *indexOut); unsigned int *indexOut);
#ifdef __cplusplus
}
#endif
#endif // _COMPILER_INTERFACE_INCLUDED_ #endif // _COMPILER_INTERFACE_INCLUDED_

View File

@ -52,6 +52,21 @@ struct COMPILER_EXPORT ShaderVariable
unsigned int elementCount() const { return std::max(1u, arraySize); } unsigned int elementCount() const { return std::max(1u, arraySize); }
bool isStruct() const { return !fields.empty(); } bool isStruct() const { return !fields.empty(); }
// All of the shader's variables are described using nested data
// structures. This is needed in order to disambiguate similar looking
// types, such as two structs containing the same fields, but in
// different orders. "findInfoByMappedName" provides an easy query for
// users to dive into the data structure and fetch the unique variable
// instance corresponding to a dereferencing chain of the top-level
// variable.
// Given a mapped name like 'a[0].b.c[0]', return the ShaderVariable
// that defines 'c' in |leafVar|, and the original name 'A[0].B.C[0]'
// in |originalName|, based on the assumption that |this| defines 'a'.
// If no match is found, return false.
bool findInfoByMappedName(const std::string &mappedFullName,
const ShaderVariable **leafVar,
std::string* originalFullName) const;
GLenum type; GLenum type;
GLenum precision; GLenum precision;
std::string name; std::string name;
@ -60,6 +75,16 @@ struct COMPILER_EXPORT ShaderVariable
bool staticUse; bool staticUse;
std::vector<ShaderVariable> fields; std::vector<ShaderVariable> fields;
std::string structName; std::string structName;
protected:
bool isSameVariableAtLinkTime(const ShaderVariable &other,
bool matchPrecision) const;
bool operator==(const ShaderVariable &other) const;
bool operator!=(const ShaderVariable &other) const
{
return !operator==(other);
}
}; };
struct COMPILER_EXPORT Uniform : public ShaderVariable struct COMPILER_EXPORT Uniform : public ShaderVariable
@ -68,6 +93,16 @@ struct COMPILER_EXPORT Uniform : public ShaderVariable
~Uniform(); ~Uniform();
Uniform(const Uniform &other); Uniform(const Uniform &other);
Uniform &operator=(const Uniform &other); Uniform &operator=(const Uniform &other);
bool operator==(const Uniform &other) const;
bool operator!=(const Uniform &other) const
{
return !operator==(other);
}
// Decide whether two uniforms are the same at shader link time,
// assuming one from vertex shader and the other from fragment shader.
// See GLSL ES Spec 3.00.3, sec 4.3.5.
bool isSameUniformAtLinkTime(const Uniform &other) const;
}; };
struct COMPILER_EXPORT Attribute : public ShaderVariable struct COMPILER_EXPORT Attribute : public ShaderVariable
@ -76,6 +111,11 @@ struct COMPILER_EXPORT Attribute : public ShaderVariable
~Attribute(); ~Attribute();
Attribute(const Attribute &other); Attribute(const Attribute &other);
Attribute &operator=(const Attribute &other); Attribute &operator=(const Attribute &other);
bool operator==(const Attribute &other) const;
bool operator!=(const Attribute &other) const
{
return !operator==(other);
}
int location; int location;
}; };
@ -86,6 +126,18 @@ struct COMPILER_EXPORT InterfaceBlockField : public ShaderVariable
~InterfaceBlockField(); ~InterfaceBlockField();
InterfaceBlockField(const InterfaceBlockField &other); InterfaceBlockField(const InterfaceBlockField &other);
InterfaceBlockField &operator=(const InterfaceBlockField &other); InterfaceBlockField &operator=(const InterfaceBlockField &other);
bool operator==(const InterfaceBlockField &other) const;
bool operator!=(const InterfaceBlockField &other) const
{
return !operator==(other);
}
// Decide whether two InterfaceBlock fields are the same at shader
// link time, assuming one from vertex shader and the other from
// fragment shader.
// See GLSL ES Spec 3.00.3, sec 4.3.7.
bool isSameInterfaceBlockFieldAtLinkTime(
const InterfaceBlockField &other) const;
bool isRowMajorLayout; bool isRowMajorLayout;
}; };
@ -94,8 +146,18 @@ struct COMPILER_EXPORT Varying : public ShaderVariable
{ {
Varying(); Varying();
~Varying(); ~Varying();
Varying(const Varying &other); Varying(const Varying &otherg);
Varying &operator=(const Varying &other); Varying &operator=(const Varying &other);
bool operator==(const Varying &other) const;
bool operator!=(const Varying &other) const
{
return !operator==(other);
}
// Decide whether two varyings are the same at shader link time,
// assuming one from vertex shader and the other from fragment shader.
// See GLSL ES Spec 3.00.3, sec 4.3.9.
bool isSameVaryingAtLinkTime(const Varying &other) const;
InterpolationType interpolation; InterpolationType interpolation;
bool isInvariant; bool isInvariant;

View File

@ -0,0 +1,37 @@
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// angle_windowsstore.h:
#ifndef ANGLE_WINDOWSSTORE_H_
#define ANGLE_WINDOWSSTORE_H_
// The following properties can be set on the CoreApplication to support additional
// ANGLE configuration options.
//
// The Visual Studio sample templates provided with this version of ANGLE have examples
// of how to set these property values.
//
// Property: EGLNativeWindowTypeProperty
// Type: IInspectable
// Description: Set this property to specify the window type to use for creating a surface.
// If this property is missing, surface creation will fail.
//
const wchar_t EGLNativeWindowTypeProperty[] = L"EGLNativeWindowTypeProperty";
//
// Property: EGLRenderSurfaceSizeProperty
// Type: Size
// Description: Set this property to specify a preferred size in pixels of the render surface.
// The render surface size width and height must be greater than 0.
// If this property is set, then the render surface size is fixed.
// If this property is missing, a default behavior will be provided.
// The default behavior uses the window size if a CoreWindow is specified or
// the size of the SwapChainPanel control if one is specified.
//
const wchar_t EGLRenderSurfaceSizeProperty[] = L"EGLRenderSurfaceSizeProperty";
#endif // ANGLE_WINDOWSSTORE_H_

View File

@ -7,6 +7,6 @@
// This is a default commit hash header, when git is not available. // This is a default commit hash header, when git is not available.
// //
#define ANGLE_COMMIT_HASH "abce76206141" #define ANGLE_COMMIT_HASH "30d6c255d238"
#define ANGLE_COMMIT_HASH_SIZE 12 #define ANGLE_COMMIT_HASH_SIZE 12
#define ANGLE_COMMIT_DATE "2014-09-23 19:37:05 +0000" #define ANGLE_COMMIT_DATE "2014-11-13 17:37:03 +0000"

View File

@ -0,0 +1,82 @@
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// NativeWindow.h: Defines NativeWindow, a class for managing and
// performing operations on an EGLNativeWindowType.
// It is used for HWND (Desktop Windows) and IInspectable objects
//(Windows Store Applications).
#ifndef COMMON_NATIVEWINDOW_H_
#define COMMON_NATIVEWINDOW_H_
#include <EGL/eglplatform.h>
#include "common/debug.h"
#include "common/platform.h"
// DXGISwapChain and DXGIFactory are typedef'd to specific required
// types. The HWND NativeWindow implementation requires IDXGISwapChain
// and IDXGIFactory and the Windows Store NativeWindow
// implementation requires IDXGISwapChain1 and IDXGIFactory2.
#if defined(ANGLE_ENABLE_WINDOWS_STORE)
typedef IDXGISwapChain1 DXGISwapChain;
typedef IDXGIFactory2 DXGIFactory;
#include <wrl.h>
#include <wrl/wrappers/corewrappers.h>
#include <windows.applicationmodel.core.h>
#include <memory>
namespace rx
{
class InspectableNativeWindow;
}
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
#else
typedef IDXGISwapChain DXGISwapChain;
typedef IDXGIFactory DXGIFactory;
#endif
namespace rx
{
class NativeWindow
{
public:
explicit NativeWindow(EGLNativeWindowType window, EGLNativeDisplayType display);
bool initialize();
bool getClientRect(LPRECT rect);
bool isIconic();
# if defined(ANGLE_ENABLE_D3D11)
typedef ID3D11Device Device;
#else
typedef IDirect3DDevice9 Device;
#endif
HRESULT createSwapChain(Device* device, DXGIFactory* factory,
DXGI_FORMAT format, UINT width, UINT height,
DXGISwapChain** swapChain);
inline EGLNativeWindowType getNativeWindow() const { return mWindow; }
inline EGLNativeDisplayType getNativeDisplay() const { return mDisplay; }
private:
EGLNativeWindowType mWindow;
EGLNativeDisplayType mDisplay;
#if defined(ANGLE_ENABLE_WINDOWS_STORE)
std::shared_ptr<InspectableNativeWindow> mImpl;
#endif
};
bool IsValidEGLNativeWindowType(EGLNativeWindowType window);
}
#endif // COMMON_NATIVEWINDOW_H_

View File

@ -5,26 +5,33 @@
// //
#include "common/angleutils.h" #include "common/angleutils.h"
#include "debug.h"
#include <stdio.h>
#include <vector> #include <vector>
size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector<char>& outBuffer)
{
// Attempt to just print to the current buffer
int len = vsnprintf(&(outBuffer.front()), outBuffer.size(), fmt, vararg);
if (len < 0 || static_cast<size_t>(len) >= outBuffer.size())
{
// Buffer was not large enough, calculate the required size and resize the buffer
len = vsnprintf(NULL, 0, fmt, vararg);
outBuffer.resize(len + 1);
// Print again
len = vsnprintf(&(outBuffer.front()), outBuffer.size(), fmt, vararg);
}
ASSERT(len >= 0);
return static_cast<size_t>(len);
}
std::string FormatString(const char *fmt, va_list vararg) std::string FormatString(const char *fmt, va_list vararg)
{ {
static std::vector<char> buffer(512); static std::vector<char> buffer(512);
// Attempt to just print to the current buffer size_t len = FormatStringIntoVector(fmt, vararg, buffer);
int len = vsnprintf(&buffer[0], buffer.size(), fmt, vararg); return std::string(&buffer[0], len);
if (len < 0 || static_cast<size_t>(len) >= buffer.size())
{
// Buffer was not large enough, calculate the required size and resize the buffer
len = vsnprintf(NULL, 0, fmt, vararg);
buffer.resize(len + 1);
// Print again
vsnprintf(&buffer[0], buffer.size(), fmt, vararg);
}
return std::string(buffer.data(), len);
} }
std::string FormatString(const char *fmt, ...) std::string FormatString(const char *fmt, ...)

View File

@ -17,6 +17,7 @@
#include <set> #include <set>
#include <sstream> #include <sstream>
#include <cstdarg> #include <cstdarg>
#include <vector>
// A macro to disallow the copy constructor and operator= functions // A macro to disallow the copy constructor and operator= functions
// This must be used in the private: declarations for a class // This must be used in the private: declarations for a class
@ -95,6 +96,13 @@ inline void StructZero(T *obj)
memset(obj, 0, sizeof(T)); memset(obj, 0, sizeof(T));
} }
template <typename T>
inline bool IsMaskFlagSet(T mask, T flag)
{
// Handles multibit flags as well
return (mask & flag) == flag;
}
inline const char* MakeStaticString(const std::string &str) inline const char* MakeStaticString(const std::string &str)
{ {
static std::set<std::string> strings; static std::set<std::string> strings;
@ -132,9 +140,12 @@ inline std::string Str(int i)
return strstr.str(); return strstr.str();
} }
size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector<char>& buffer);
std::string FormatString(const char *fmt, va_list vararg); std::string FormatString(const char *fmt, va_list vararg);
std::string FormatString(const char *fmt, ...); std::string FormatString(const char *fmt, ...);
// snprintf is not defined with MSVC prior to to msvc14
#if defined(_MSC_VER) && _MSC_VER < 1900 #if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf _snprintf #define snprintf _snprintf
#endif #endif

View File

@ -17,41 +17,211 @@
namespace gl namespace gl
{ {
#if defined(ANGLE_ENABLE_PERF) #if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
typedef void (WINAPI *PerfOutputFunction)(D3DCOLOR, LPCWSTR); // Wraps the D3D9/D3D11 debug annotation functions.
#else class DebugAnnotationWrapper
typedef void (*PerfOutputFunction)(unsigned int, const wchar_t*);
#endif
static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const char *format, va_list vararg)
{ {
#if defined(ANGLE_ENABLE_PERF) || defined(ANGLE_ENABLE_TRACE) public:
std::string formattedMessage = FormatString(format, vararg); DebugAnnotationWrapper() { };
virtual ~DebugAnnotationWrapper() { };
virtual void beginEvent(const std::wstring &eventName) = 0;
virtual void endEvent() = 0;
virtual void setMarker(const std::wstring &markerName) = 0;
virtual bool getStatus() = 0;
};
#if defined(ANGLE_ENABLE_D3D9)
class D3D9DebugAnnotationWrapper : public DebugAnnotationWrapper
{
public:
void beginEvent(const std::wstring &eventName)
{
D3DPERF_BeginEvent(0, eventName.c_str());
}
void endEvent()
{
D3DPERF_EndEvent();
}
void setMarker(const std::wstring &markerName)
{
D3DPERF_SetMarker(0, markerName.c_str());
}
bool getStatus()
{
return !!D3DPERF_GetStatus();
}
};
#endif // ANGLE_ENABLE_D3D9
#if defined(ANGLE_ENABLE_D3D11)
class D3D11DebugAnnotationWrapper : public DebugAnnotationWrapper
{
public:
D3D11DebugAnnotationWrapper()
: mInitialized(false),
mD3d11Module(NULL),
mUserDefinedAnnotation(NULL)
{
// D3D11 devices can't be created during DllMain.
// We defer device creation until the object is actually used.
}
~D3D11DebugAnnotationWrapper()
{
if (mInitialized)
{
SafeRelease(mUserDefinedAnnotation);
FreeLibrary(mD3d11Module);
}
}
virtual void beginEvent(const std::wstring &eventName)
{
initializeDevice();
mUserDefinedAnnotation->BeginEvent(eventName.c_str());
}
virtual void endEvent()
{
initializeDevice();
mUserDefinedAnnotation->EndEvent();
}
virtual void setMarker(const std::wstring &markerName)
{
initializeDevice();
mUserDefinedAnnotation->SetMarker(markerName.c_str());
}
virtual bool getStatus()
{
// ID3DUserDefinedAnnotation::GetStatus doesn't work with the Graphics Diagnostics tools in Visual Studio 2013.
#if defined(_DEBUG) && defined(ANGLE_ENABLE_WINDOWS_STORE)
// In the Windows Store, we can use IDXGraphicsAnalysis. The call to GetDebugInterface1 only succeeds if the app is under capture.
// This should only be called in DEBUG mode.
// If an app links against DXGIGetDebugInterface1 in release mode then it will fail Windows Store ingestion checks.
IDXGraphicsAnalysis* graphicsAnalysis;
DXGIGetDebugInterface1(0, IID_PPV_ARGS(&graphicsAnalysis));
bool underCapture = (graphicsAnalysis != NULL);
SafeRelease(graphicsAnalysis);
return underCapture;
#endif #endif
#if defined(ANGLE_ENABLE_PERF) // Otherwise, we have to return true here.
return true;
}
protected:
void initializeDevice()
{
if (!mInitialized)
{
#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
mD3d11Module = LoadLibrary(TEXT("d3d11.dll"));
ASSERT(mD3d11Module);
PFN_D3D11_CREATE_DEVICE D3D11CreateDevice = (PFN_D3D11_CREATE_DEVICE)GetProcAddress(mD3d11Module, "D3D11CreateDevice");
ASSERT(D3D11CreateDevice != NULL);
#endif // !ANGLE_ENABLE_WINDOWS_STORE
ID3D11Device* device = NULL;
ID3D11DeviceContext* context = NULL;
HRESULT hr = E_FAIL;
// Create a D3D_DRIVER_TYPE_NULL device, which is much cheaper than other types of device.
hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_NULL, NULL, 0, NULL, 0, D3D11_SDK_VERSION, &device, NULL, &context);
ASSERT(SUCCEEDED(hr));
hr = context->QueryInterface(__uuidof(mUserDefinedAnnotation), reinterpret_cast<void**>(&mUserDefinedAnnotation));
ASSERT(SUCCEEDED(hr) && mUserDefinedAnnotation != NULL);
SafeRelease(device);
SafeRelease(context);
mInitialized = true;
}
}
bool mInitialized;
HMODULE mD3d11Module;
ID3DUserDefinedAnnotation* mUserDefinedAnnotation;
};
#endif // ANGLE_ENABLE_D3D11
static DebugAnnotationWrapper* g_DebugAnnotationWrapper = NULL;
void InitializeDebugAnnotations()
{
#if defined(ANGLE_ENABLE_D3D9)
g_DebugAnnotationWrapper = new D3D9DebugAnnotationWrapper();
#elif defined(ANGLE_ENABLE_D3D11)
// If the project uses D3D9 then we can use the D3D9 debug annotations, even with the D3D11 renderer.
// However, if D3D9 is unavailable (e.g. in Windows Store), then we use D3D11 debug annotations.
// The D3D11 debug annotations are methods on ID3DUserDefinedAnnotation, which is implemented by the DeviceContext.
// This doesn't have to be the same DeviceContext that the renderer uses, though.
g_DebugAnnotationWrapper = new D3D11DebugAnnotationWrapper();
#endif
}
void UninitializeDebugAnnotations()
{
if (g_DebugAnnotationWrapper != NULL)
{
SafeDelete(g_DebugAnnotationWrapper);
}
}
#endif // ANGLE_ENABLE_DEBUG_ANNOTATIONS
enum DebugTraceOutputType
{
DebugTraceOutputTypeNone,
DebugTraceOutputTypeSetMarker,
DebugTraceOutputTypeBeginEvent
};
static void output(bool traceInDebugOnly, DebugTraceOutputType outputType, const char *format, va_list vararg)
{
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
static std::vector<char> buffer(512);
if (perfActive()) if (perfActive())
{ {
// The perf function only accepts wide strings, widen the ascii message size_t len = FormatStringIntoVector(format, vararg, buffer);
static std::wstring wideMessage; std::wstring formattedWideMessage(buffer.begin(), buffer.begin() + len);
if (wideMessage.capacity() < formattedMessage.length())
switch (outputType)
{ {
wideMessage.reserve(formattedMessage.size()); case DebugTraceOutputTypeNone:
break;
case DebugTraceOutputTypeBeginEvent:
g_DebugAnnotationWrapper->beginEvent(formattedWideMessage);
break;
case DebugTraceOutputTypeSetMarker:
g_DebugAnnotationWrapper->setMarker(formattedWideMessage);
break;
} }
wideMessage.assign(formattedMessage.begin(), formattedMessage.end());
perfFunc(0, wideMessage.c_str());
} }
#endif // ANGLE_ENABLE_PERF #endif // ANGLE_ENABLE_DEBUG_ANNOTATIONS
#if defined(ANGLE_ENABLE_TRACE) #if defined(ANGLE_ENABLE_DEBUG_TRACE)
#if defined(NDEBUG) #if defined(NDEBUG)
if (traceFileDebugOnly) if (traceInDebugOnly)
{ {
return; return;
} }
#endif // NDEBUG #endif // NDEBUG
std::string formattedMessage = FormatString(format, vararg);
static std::ofstream file(TRACE_OUTPUT_FILE, std::ofstream::app); static std::ofstream file(TRACE_OUTPUT_FILE, std::ofstream::app);
if (file) if (file)
@ -60,25 +230,29 @@ static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const c
file.flush(); file.flush();
} }
#endif // ANGLE_ENABLE_TRACE #if defined(ANGLE_ENABLE_DEBUG_TRACE_TO_DEBUGGER)
OutputDebugStringA(formattedMessage.c_str());
#endif // ANGLE_ENABLE_DEBUG_TRACE_TO_DEBUGGER
#endif // ANGLE_ENABLE_DEBUG_TRACE
} }
void trace(bool traceFileDebugOnly, const char *format, ...) void trace(bool traceInDebugOnly, const char *format, ...)
{ {
va_list vararg; va_list vararg;
va_start(vararg, format); va_start(vararg, format);
#if defined(ANGLE_ENABLE_PERF) #if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
output(traceFileDebugOnly, D3DPERF_SetMarker, format, vararg); output(traceInDebugOnly, DebugTraceOutputTypeSetMarker, format, vararg);
#else #else
output(traceFileDebugOnly, NULL, format, vararg); output(traceInDebugOnly, DebugTraceOutputTypeNone, format, vararg);
#endif #endif
va_end(vararg); va_end(vararg);
} }
bool perfActive() bool perfActive()
{ {
#if defined(ANGLE_ENABLE_PERF) #if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
static bool active = D3DPERF_GetStatus() != 0; static bool active = g_DebugAnnotationWrapper->getStatus();
return active; return active;
#else #else
return false; return false;
@ -87,26 +261,28 @@ bool perfActive()
ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...) ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...)
{ {
#if defined(ANGLE_ENABLE_PERF) #if !defined(ANGLE_ENABLE_DEBUG_TRACE)
#if !defined(ANGLE_ENABLE_TRACE)
if (!perfActive()) if (!perfActive())
{ {
return; return;
} }
#endif // !ANGLE_ENABLE_TRACE #endif // !ANGLE_ENABLE_DEBUG_TRACE
va_list vararg; va_list vararg;
va_start(vararg, format); va_start(vararg, format);
output(true, reinterpret_cast<PerfOutputFunction>(D3DPERF_BeginEvent), format, vararg); #if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
output(true, DebugTraceOutputTypeBeginEvent, format, vararg);
#else
output(true, DebugTraceOutputTypeNone, format, vararg);
#endif // ANGLE_ENABLE_DEBUG_ANNOTATIONS
va_end(vararg); va_end(vararg);
#endif // ANGLE_ENABLE_PERF
} }
ScopedPerfEventHelper::~ScopedPerfEventHelper() ScopedPerfEventHelper::~ScopedPerfEventHelper()
{ {
#if defined(ANGLE_ENABLE_PERF) #if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
if (perfActive()) if (perfActive())
{ {
D3DPERF_EndEvent(); g_DebugAnnotationWrapper->endEvent();
} }
#endif #endif
} }

View File

@ -20,8 +20,8 @@
namespace gl namespace gl
{ {
// Outputs text to the debugging log // Outputs text to the debugging log, or the debugging window
void trace(bool traceFileDebugOnly, const char *format, ...); void trace(bool traceInDebugOnly, const char *format, ...);
// Returns whether D3DPERF is active. // Returns whether D3DPERF is active.
bool perfActive(); bool perfActive();
@ -36,31 +36,34 @@ namespace gl
private: private:
DISALLOW_COPY_AND_ASSIGN(ScopedPerfEventHelper); DISALLOW_COPY_AND_ASSIGN(ScopedPerfEventHelper);
}; };
void InitializeDebugAnnotations();
void UninitializeDebugAnnotations();
} }
// A macro to output a trace of a function call and its arguments to the debugging log // A macro to output a trace of a function call and its arguments to the debugging log
#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) #if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
#define TRACE(message, ...) gl::trace(true, "trace: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) #define TRACE(message, ...) gl::trace(true, "trace: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else #else
#define TRACE(message, ...) (void(0)) #define TRACE(message, ...) (void(0))
#endif #endif
// A macro to output a function call and its arguments to the debugging log, to denote an item in need of fixing. // A macro to output a function call and its arguments to the debugging log, to denote an item in need of fixing.
#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) #if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
#define FIXME(message, ...) gl::trace(false, "fixme: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) #define FIXME(message, ...) gl::trace(false, "fixme: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else #else
#define FIXME(message, ...) (void(0)) #define FIXME(message, ...) (void(0))
#endif #endif
// A macro to output a function call and its arguments to the debugging log, in case of error. // A macro to output a function call and its arguments to the debugging log, in case of error.
#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) #if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
#define ERR(message, ...) gl::trace(false, "err: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) #define ERR(message, ...) gl::trace(false, "err: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else #else
#define ERR(message, ...) (void(0)) #define ERR(message, ...) (void(0))
#endif #endif
// A macro to log a performance event around a scope. // A macro to log a performance event around a scope.
#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) #if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
#if defined(_MSC_VER) #if defined(_MSC_VER)
#define EVENT(message, ...) gl::ScopedPerfEventHelper scopedPerfEventHelper ## __LINE__("%s" message "\n", __FUNCTION__, __VA_ARGS__); #define EVENT(message, ...) gl::ScopedPerfEventHelper scopedPerfEventHelper ## __LINE__("%s" message "\n", __FUNCTION__, __VA_ARGS__);
#else #else
@ -83,7 +86,7 @@ namespace gl
#define UNUSED_ASSERTION_VARIABLE(variable) ((void)variable) #define UNUSED_ASSERTION_VARIABLE(variable) ((void)variable)
#endif #endif
#ifndef ANGLE_ENABLE_TRACE #ifndef ANGLE_ENABLE_DEBUG_TRACE
#define UNUSED_TRACE_VARIABLE(variable) ((void)variable) #define UNUSED_TRACE_VARIABLE(variable) ((void)variable)
#else #else
#define UNUSED_TRACE_VARIABLE(variable) #define UNUSED_TRACE_VARIABLE(variable)
@ -128,7 +131,7 @@ namespace gl
#endif #endif
// A macro functioning as a compile-time assert to validate constant conditions // A macro functioning as a compile-time assert to validate constant conditions
#if defined(_MSC_VER) && _MSC_VER >= 1600 #if (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__GNUC__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3))
#define META_ASSERT_MSG(condition, msg) static_assert(condition, msg) #define META_ASSERT_MSG(condition, msg) static_assert(condition, msg)
#else #else
#define META_ASSERT_CONCAT(a, b) a ## b #define META_ASSERT_CONCAT(a, b) a ## b

View File

@ -0,0 +1,35 @@
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#define ANGLE_DISABLED 0
#define ANGLE_ENABLED 1
// Feature defaults
// Direct3D9EX
// The "Debug This Pixel..." feature in PIX often fails when using the
// D3D9Ex interfaces. In order to get debug pixel to work on a Vista/Win 7
// machine, define "ANGLE_D3D9EX=0" in your project file.
#if !defined(ANGLE_D3D9EX)
#define ANGLE_D3D9EX ANGLE_ENABLED
#endif
// Vsync
// ENABLED allows Vsync to be configured at runtime
// DISABLED disallows Vsync
#if !defined(ANGLE_VSYNC)
#define ANGLE_VSYNC ANGLE_ENABLED
#endif
// Program binary loading
#if !defined(ANGLE_PROGRAM_BINARY_LOAD)
#define ANGLE_PROGRAM_BINARY_LOAD ANGLE_ENABLED
#endif
// Shader debug info
#if !defined(ANGLE_SHADER_DEBUG_INFO)
#define ANGLE_SHADER_DEBUG_INFO ANGLE_DISABLED
#endif

View File

@ -109,7 +109,7 @@ inline unsigned int unorm(float x)
inline bool supportsSSE2() inline bool supportsSSE2()
{ {
#ifdef ANGLE_PLATFORM_WINDOWS #if defined(ANGLE_PLATFORM_WINDOWS) && !defined(_M_ARM)
static bool checked = false; static bool checked = false;
static bool supports = false; static bool supports = false;
@ -118,7 +118,6 @@ inline bool supportsSSE2()
return supports; return supports;
} }
#if defined(_M_IX86) || defined(_M_AMD64) // ARM doesn't provide __cpuid()
int info[4]; int info[4];
__cpuid(info, 0); __cpuid(info, 0);
@ -128,7 +127,6 @@ inline bool supportsSSE2()
supports = (info[3] >> 26) & 1; supports = (info[3] >> 26) & 1;
} }
#endif
checked = true; checked = true;

View File

@ -11,9 +11,6 @@
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
# define ANGLE_PLATFORM_WINDOWS 1 # define ANGLE_PLATFORM_WINDOWS 1
# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
# define ANGLE_PLATFORM_WINRT 1
# endif
#elif defined(__APPLE__) #elif defined(__APPLE__)
# define ANGLE_PLATFORM_APPLE 1 # define ANGLE_PLATFORM_APPLE 1
# define ANGLE_PLATFORM_POSIX 1 # define ANGLE_PLATFORM_POSIX 1
@ -37,6 +34,9 @@
#endif #endif
#ifdef ANGLE_PLATFORM_WINDOWS #ifdef ANGLE_PLATFORM_WINDOWS
# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
# define ANGLE_ENABLE_WINDOWS_STORE 1
# endif
# ifndef STRICT # ifndef STRICT
# define STRICT 1 # define STRICT 1
# endif # endif
@ -50,8 +50,9 @@
# include <windows.h> # include <windows.h>
# include <intrin.h> # include <intrin.h>
# if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_PERF) # if defined(ANGLE_ENABLE_D3D9)
# include <d3d9.h> # include <d3d9.h>
# include <dxgi.h>
# if !defined(COMPILER_IMPLEMENTATION) # if !defined(COMPILER_IMPLEMENTATION)
# include <d3dcompiler.h> # include <d3dcompiler.h>
# endif # endif
@ -62,13 +63,26 @@
# include <d3d10.h> # include <d3d10.h>
# include <d3d11.h> # include <d3d11.h>
# include <dxgi.h> # include <dxgi.h>
# if _MSC_VER >= 1700 # if defined(_MSC_VER) && (_MSC_VER >= 1700)
# include <d3d11_1.h>
# include <dxgi1_2.h> # include <dxgi1_2.h>
# endif # endif
# if !defined(COMPILER_IMPLEMENTATION) # if !defined(COMPILER_IMPLEMENTATION)
# include <d3dcompiler.h> # include <d3dcompiler.h>
# endif # endif
# if defined(__MINGW32__) # endif
# if defined(ANGLE_ENABLE_WINDOWS_STORE)
# include <dxgi1_3.h>
# if defined(_DEBUG)
# if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
# include <DXProgrammableCapture.h>
# endif
# include <dxgidebug.h>
# endif
# endif
# if defined(__MINGW32__) // Missing defines on MinGW
typedef enum D3D11_MAP_FLAG typedef enum D3D11_MAP_FLAG
{ {
D3D11_MAP_FLAG_DO_NOT_WAIT = 0x100000L D3D11_MAP_FLAG_DO_NOT_WAIT = 0x100000L
@ -78,8 +92,68 @@ typedef struct D3D11_QUERY_DATA_SO_STATISTICS
UINT64 NumPrimitivesWritten; UINT64 NumPrimitivesWritten;
UINT64 PrimitivesStorageNeeded; UINT64 PrimitivesStorageNeeded;
} D3D11_QUERY_DATA_SO_STATISTICS; } D3D11_QUERY_DATA_SO_STATISTICS;
# endif typedef HRESULT (WINAPI *PFN_D3D11_CREATE_DEVICE)(
# endif IDXGIAdapter *, D3D_DRIVER_TYPE, HMODULE, UINT, CONST D3D_FEATURE_LEVEL *,
UINT FeatureLevels, UINT, ID3D11Device **, D3D_FEATURE_LEVEL *, ID3D11DeviceContext **);
#define D3D11_MESSAGE_CATEGORY UINT
#define D3D11_MESSAGE_SEVERITY UINT
#define D3D11_MESSAGE_ID UINT
struct D3D11_MESSAGE;
typedef struct D3D11_INFO_QUEUE_FILTER_DESC
{
UINT NumCategories;
D3D11_MESSAGE_CATEGORY *pCategoryList;
UINT NumSeverities;
D3D11_MESSAGE_SEVERITY *pSeverityList;
UINT NumIDs;
D3D11_MESSAGE_ID *pIDList;
} D3D11_INFO_QUEUE_FILTER_DESC;
typedef struct D3D11_INFO_QUEUE_FILTER
{
D3D11_INFO_QUEUE_FILTER_DESC AllowList;
D3D11_INFO_QUEUE_FILTER_DESC DenyList;
} D3D11_INFO_QUEUE_FILTER;
static const IID IID_ID3D11InfoQueue = { 0x6543dbb6, 0x1b48, 0x42f5, 0xab, 0x82, 0xe9, 0x7e, 0xc7, 0x43, 0x26, 0xf6 };
MIDL_INTERFACE("6543dbb6-1b48-42f5-ab82-e97ec74326f6") ID3D11InfoQueue : public IUnknown
{
public:
virtual HRESULT __stdcall SetMessageCountLimit(UINT64) = 0;
virtual void __stdcall ClearStoredMessages() = 0;
virtual HRESULT __stdcall GetMessage(UINT64, D3D11_MESSAGE *, SIZE_T *) = 0;
virtual UINT64 __stdcall GetNumMessagesAllowedByStorageFilter() = 0;
virtual UINT64 __stdcall GetNumMessagesDeniedByStorageFilter() = 0;
virtual UINT64 __stdcall GetNumStoredMessages() = 0;
virtual UINT64 __stdcall GetNumStoredMessagesAllowedByRetrievalFilter() = 0;
virtual UINT64 __stdcall GetNumMessagesDiscardedByMessageCountLimit() = 0;
virtual UINT64 __stdcall GetMessageCountLimit() = 0;
virtual HRESULT __stdcall AddStorageFilterEntries(D3D11_INFO_QUEUE_FILTER *) = 0;
virtual HRESULT __stdcall GetStorageFilter(D3D11_INFO_QUEUE_FILTER *, SIZE_T *) = 0;
virtual void __stdcall ClearStorageFilter() = 0;
virtual HRESULT __stdcall PushEmptyStorageFilter() = 0;
virtual HRESULT __stdcall PushCopyOfStorageFilter() = 0;
virtual HRESULT __stdcall PushStorageFilter(D3D11_INFO_QUEUE_FILTER *) = 0;
virtual void __stdcall PopStorageFilter() = 0;
virtual UINT __stdcall GetStorageFilterStackSize() = 0;
virtual HRESULT __stdcall AddRetrievalFilterEntries(D3D11_INFO_QUEUE_FILTER *) = 0;
virtual HRESULT __stdcall GetRetrievalFilter(D3D11_INFO_QUEUE_FILTER *, SIZE_T *) = 0;
virtual void __stdcall ClearRetrievalFilter() = 0;
virtual HRESULT __stdcall PushEmptyRetrievalFilter() = 0;
virtual HRESULT __stdcall PushCopyOfRetrievalFilter() = 0;
virtual HRESULT __stdcall PushRetrievalFilter(D3D11_INFO_QUEUE_FILTER *) = 0;
virtual void __stdcall PopRetrievalFilter() = 0;
virtual UINT __stdcall GetRetrievalFilterStackSize() = 0;
virtual HRESULT __stdcall AddMessage(D3D11_MESSAGE_CATEGORY, D3D11_MESSAGE_SEVERITY, D3D11_MESSAGE_ID, LPCSTR) = 0;
virtual HRESULT __stdcall AddApplicationMessage(D3D11_MESSAGE_SEVERITY, LPCSTR) = 0;
virtual HRESULT __stdcall SetBreakOnCategory(D3D11_MESSAGE_CATEGORY, BOOL) = 0;
virtual HRESULT __stdcall SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY, BOOL) = 0;
virtual HRESULT __stdcall SetBreakOnID(D3D11_MESSAGE_ID, BOOL) = 0;
virtual BOOL __stdcall GetBreakOnCategory(D3D11_MESSAGE_CATEGORY) = 0;
virtual BOOL __stdcall GetBreakOnSeverity(D3D11_MESSAGE_SEVERITY) = 0;
virtual BOOL __stdcall GetBreakOnID(D3D11_MESSAGE_ID) = 0;
virtual void __stdcall SetMuteDebugOutput(BOOL) = 0;
virtual BOOL __stdcall GetMuteDebugOutput() = 0;
};
#endif // __MINGW32__
# undef near # undef near
# undef far # undef far

View File

@ -10,29 +10,50 @@
#include <assert.h> #include <assert.h>
#if defined(ANGLE_PLATFORM_WINRT) #ifdef ANGLE_ENABLE_WINDOWS_STORE
#include <vector> #include <vector>
std::vector<void *> *tls = nullptr; #include <set>
std::vector<TLSIndex> *freeIndices = nullptr; #include <map>
#include <mutex>
#include <wrl/client.h>
#include <wrl/async.h>
#include <Windows.System.Threading.h>
using namespace std;
using namespace Windows::Foundation;
using namespace ABI::Windows::System::Threading;
// Thread local storage for Windows Store support
typedef vector<void*> ThreadLocalData;
static __declspec(thread) ThreadLocalData* currentThreadData = nullptr;
static set<ThreadLocalData*> allThreadData;
static DWORD nextTlsIndex = 0;
static vector<DWORD> freeTlsIndices;
#endif #endif
TLSIndex CreateTLSIndex() TLSIndex CreateTLSIndex()
{ {
TLSIndex index; TLSIndex index;
#if defined(ANGLE_PLATFORM_WINRT) #ifdef ANGLE_PLATFORM_WINDOWS
if (!tls) #ifdef ANGLE_ENABLE_WINDOWS_STORE
tls = new std::vector<void *>; if (!freeTlsIndices.empty())
if (freeIndices && !freeIndices->empty()) { {
index = freeIndices->back(); DWORD result = freeTlsIndices.back();
freeIndices->pop_back(); freeTlsIndices.pop_back();
return index; index = result;
} else {
tls->push_back(nullptr);
return tls->size() - 1;
} }
#elif defined(ANGLE_PLATFORM_WINDOWS) else
{
index = nextTlsIndex++;
}
#else
index = TlsAlloc(); index = TlsAlloc();
#endif
#elif defined(ANGLE_PLATFORM_POSIX) #elif defined(ANGLE_PLATFORM_POSIX)
// Create global pool key // Create global pool key
if ((pthread_key_create(&index, NULL)) != 0) if ((pthread_key_create(&index, NULL)) != 0)
@ -53,13 +74,23 @@ bool DestroyTLSIndex(TLSIndex index)
return false; return false;
} }
#if defined(ANGLE_PLATFORM_WINRT) #ifdef ANGLE_PLATFORM_WINDOWS
if (!freeIndices) #ifdef ANGLE_ENABLE_WINDOWS_STORE
freeIndices = new std::vector<TLSIndex>; assert(index < nextTlsIndex);
freeIndices->push_back(index); assert(find(freeTlsIndices.begin(), freeTlsIndices.end(), index) == freeTlsIndices.end());
freeTlsIndices.push_back(index);
for (auto threadData : allThreadData)
{
if (threadData->size() > index)
{
threadData->at(index) = nullptr;
}
}
return true; return true;
#elif ANGLE_PLATFORM_WINDOWS #else
return (TlsFree(index) == TRUE); return (TlsFree(index) == TRUE);
#endif
#elif defined(ANGLE_PLATFORM_POSIX) #elif defined(ANGLE_PLATFORM_POSIX)
return (pthread_key_delete(index) == 0); return (pthread_key_delete(index) == 0);
#endif #endif
@ -73,11 +104,25 @@ bool SetTLSValue(TLSIndex index, void *value)
return false; return false;
} }
#if defined(ANGLE_PLATFORM_WINRT) #ifdef ANGLE_PLATFORM_WINDOWS
tls->at(index) = value; #ifdef ANGLE_ENABLE_WINDOWS_STORE
ThreadLocalData* threadData = currentThreadData;
if (!threadData)
{
threadData = new ThreadLocalData(index + 1, nullptr);
allThreadData.insert(threadData);
currentThreadData = threadData;
}
else if (threadData->size() <= index)
{
threadData->resize(index + 1, nullptr);
}
threadData->at(index) = value;
return true; return true;
#elif defined(ANGLE_PLATFORM_WINDOWS) #else
return (TlsSetValue(index, value) == TRUE); return (TlsSetValue(index, value) == TRUE);
#endif
#elif defined(ANGLE_PLATFORM_POSIX) #elif defined(ANGLE_PLATFORM_POSIX)
return (pthread_setspecific(index, value) == 0); return (pthread_setspecific(index, value) == 0);
#endif #endif
@ -85,18 +130,26 @@ bool SetTLSValue(TLSIndex index, void *value)
void *GetTLSValue(TLSIndex index) void *GetTLSValue(TLSIndex index)
{ {
#if !defined(ANGLE_PLATFORM_WINRT) // Valid on WinRT, as Alloc handles the index creation
assert(index != TLS_INVALID_INDEX && "GetTLSValue(): Invalid TLS Index"); assert(index != TLS_INVALID_INDEX && "GetTLSValue(): Invalid TLS Index");
#endif
if (index == TLS_INVALID_INDEX) if (index == TLS_INVALID_INDEX)
{ {
return NULL; return NULL;
} }
#if defined(ANGLE_PLATFORM_WINRT) #ifdef ANGLE_PLATFORM_WINDOWS
return tls->at(index); #ifdef ANGLE_ENABLE_WINDOWS_STORE
#elif defined(ANGLE_PLATFORM_WINDOWS) ThreadLocalData* threadData = currentThreadData;
if (threadData && threadData->size() > index)
{
return threadData->at(index);
}
else
{
return nullptr;
}
#else
return TlsGetValue(index); return TlsGetValue(index);
#endif
#elif defined(ANGLE_PLATFORM_POSIX) #elif defined(ANGLE_PLATFORM_POSIX)
return pthread_getspecific(index); return pthread_getspecific(index);
#endif #endif

Some files were not shown because too many files have changed in this diff Show More