refs #213 Added precompiled header for MSVC in blackmisc, blackcore, blackgui.

This commit is contained in:
Mathew Sutcliffe
2017-02-17 18:14:27 +00:00
parent 01ccb4d023
commit e7f61dabea
10 changed files with 278 additions and 16 deletions

View File

@@ -4,7 +4,7 @@ QT += network dbus xml
TARGET = blackmisc
TEMPLATE = lib
CONFIG += blackconfig
CONFIG += blackconfig precompile_header
contains(BLACK_CONFIG, Static) {
CONFIG += staticlib
@@ -12,10 +12,8 @@ contains(BLACK_CONFIG, Static) {
INCLUDEPATH += ..
# DEPENDPATH += . .. // BlackMisc should be independent
# PRECOMPILED_HEADER = stdpch.h
precompile_header:!isEmpty(PRECOMPILED_HEADER) {
DEFINES += USING_PCH
}
PRECOMPILED_HEADER = pch/pch.h
DEFINES += LOG_IN_FILE BUILD_BLACKMISC_LIB
RESOURCES += blackmisc.qrc

View File

@@ -78,10 +78,22 @@ namespace BlackMisc
* \ingroup MetaClass
*/
template <quint64 F>
struct MetaFlags : public std::integral_constant<quint64, F>
struct MetaFlags /* : public std::integral_constant<quint64, F> */
{
//! Implicit conversion to std::false_type (if F is zero) or std::true_type (if F is non-zero).
constexpr operator std::integral_constant<bool, static_cast<bool>(F)>() const { return {}; }
#if defined(Q_CC_MSVC) && ! defined(Q_CC_CLANG) // gymnastics to workaround an MSVC 2017 precompiled header ICE
int m_dummy = 0;
#if _MSC_FULL_VER < 191000000
constexpr MetaFlags() {}
#endif
#endif
constexpr operator quint64() const { return F; } //!< Implicit conversion to integer.
constexpr quint64 operator ()() const { return F; } //!< Call operator.
constexpr static quint64 value = F; //!< Value.
using value_type = quint64; //!< Value type.
using type = MetaFlags; //!< Own type.
};
/*!

128
src/blackmisc/pch/pch.h Normal file
View File

@@ -0,0 +1,128 @@
/* Copyright (C) 2017
* swift Project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
/* ---------
* ! WARNING !
* ---------------------------------------------------------------------------------
* >>>> CHANGES IN ANY HEADERS INCLUDED HEREIN WILL TRIGGER A FULL REBUILD OF EVERYTHING! <<<<
* ---------------------------------------------------------------------------------
*/
#ifdef BLACKMISC_PCH_H
#error "Don't #include this file"
#else
#define BLACKMISC_PCH_H
#ifdef __cplusplus
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER < 191000000
#pragma warning(disable:4503)
#endif
#include "blackmisc/collection.h"
#include "blackmisc/compare.h"
#include "blackmisc/containerbase.h"
#include "blackmisc/dbus.h"
#include "blackmisc/dictionary.h"
#include "blackmisc/iterator.h"
#include "blackmisc/json.h"
#include "blackmisc/metaclass.h"
#include "blackmisc/range.h"
#include "blackmisc/sequence.h"
#include "blackmisc/valueobject.h"
#include "blackmisc/verify.h"
#include "blackmisc/worker.h"
#include <QByteArray>
#include <QChar>
#include <QCoreApplication>
#include <QDBusArgument>
#include <QDBusMetaType>
#include <QDate>
#include <QDateTime>
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QFlag>
#include <QFlags>
#include <QFutureWatcher>
#include <QGlobalStatic>
#include <QHash>
#include <QIODevice>
#include <QIcon>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonValueRef>
#include <QLatin1Char>
#include <QLatin1Literal>
#include <QLatin1String>
#include <QList>
#include <QLoggingCategory>
#include <QMap>
#include <QMessageLogContext>
#include <QMetaMethod>
#include <QMetaObject>
#include <QMetaType>
#include <QMutex>
#include <QMutexLocker>
#include <QObject>
#include <QPair>
#include <QPixmap>
#include <QReadLocker>
#include <QReadWriteLock>
#include <QScopedPointer>
#include <QSet>
#include <QSharedPointer>
#include <QString>
#include <QStringBuilder>
#include <QStringList>
#include <QStringRef>
#include <QThread>
#include <QTime>
#include <QTimer>
#include <QVariant>
#include <QVariantList>
#include <QVector>
#include <QWeakPointer>
#include <QWriteLocker>
#include <QtGlobal>
#include <algorithm>
#include <array>
#include <cctype>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <exception>
#include <functional>
#include <future>
#include <initializer_list>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <random>
#include <set>
#include <stdexcept>
#include <string>
#include <tuple>
#include <type_traits>
#include <typeindex>
#include <unordered_map>
#include <utility>
#include <vector>
#endif // __cplusplus
#endif // guard