Add ability to disable precompiled headers with CMake (#2727)

This commit is contained in:
pajlada 2021-05-08 15:57:00 +02:00 committed by GitHub
parent 6f6ccb8c2f
commit 2f49b23875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
68 changed files with 164 additions and 5 deletions

View file

@ -14,6 +14,7 @@ option(BUILD_TESTS "Build the tests for Chatterino" OFF)
option(USE_SYSTEM_PAJLADA_SETTINGS "Use system pajlada settings library" OFF)
option(USE_SYSTEM_LIBCOMMUNI "Use system communi library" OFF)
option(USE_SYSTEM_QT5KEYCHAIN "Use system Qt5Keychain library" OFF)
option(USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
option(USE_CONAN "Use conan" OFF)

View file

@ -36,6 +36,8 @@
#include "widgets/Window.hpp"
#include "widgets/splits/Split.hpp"
#include <QDesktopServices>
namespace chatterino {
static std::atomic<bool> isAppInitialized{false};

View file

@ -2,8 +2,11 @@
#include "singletons/NativeMessaging.hpp"
#include <QJsonDocument>
#include <QJsonObject>
#include <QStringList>
#include <QTimer>
#include <fstream>
#include <iostream>
#include <memory>

View file

@ -476,7 +476,9 @@ source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${SOURCE_FILES})
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
add_sanitizers(${PROJECT_NAME})
target_precompile_headers(${PROJECT_NAME} PRIVATE PrecompiledHeader.hpp)
if (USE_PRECOMPILED_HEADERS)
target_precompile_headers(${PROJECT_NAME} PRIVATE PrecompiledHeader.hpp)
endif ()
# Enable autogeneration of Qts MOC/RCC/UIC
set_target_properties(${PROJECT_NAME}

View file

@ -1,5 +1,7 @@
#pragma once
#include <memory>
// This file contains common forward declarations.
namespace chatterino {

View file

@ -1,9 +1,5 @@
#include "Args.hpp"
#include <QApplication>
#include <QCommandLineParser>
#include <QDebug>
#include <QStringList>
#include "common/QLogging.hpp"
#include "singletons/Paths.hpp"
#include "singletons/WindowManager.hpp"
@ -11,6 +7,12 @@
#include "util/CombinePath.hpp"
#include "widgets/Window.hpp"
#include <QApplication>
#include <QCommandLineParser>
#include <QDebug>
#include <QStringList>
#include <QUuid>
namespace chatterino {
Args::Args(const QApplication &app)

View file

@ -7,6 +7,8 @@
#include "lrucache/lrucache.hpp"
#include <QRgb>
namespace chatterino {
class ChannelChatters

View file

@ -6,6 +6,9 @@
#include "util/CombinePath.hpp"
#include "util/Overloaded.hpp"
#include <QJsonDocument>
#include <QJsonObject>
#ifdef CMAKE_BUILD
# include "qt5keychain/keychain.h"
#else

View file

@ -1,6 +1,8 @@
#pragma once
#include <QObject>
#include <QString>
#include <functional>
namespace chatterino {

View file

@ -1,5 +1,6 @@
#pragma once
#include <initializer_list>
#include <type_traits>
namespace chatterino {

View file

@ -3,6 +3,7 @@
#include <QFile>
#include <QMap>
#include <QRegularExpression>
#include <QSet>
#include <QString>
#include <QStringRef>
#include <QTextStream>

View file

@ -3,6 +3,7 @@
#include "common/SignalVector.hpp"
#include <QAbstractTableModel>
#include <QMimeData>
#include <QStandardItem>
#include <boost/optional.hpp>

View file

@ -3,6 +3,10 @@
#include "common/QLogging.hpp"
#include "widgets/Window.hpp"
#include <QFile>
#include <QJsonArray>
#include <QJsonDocument>
namespace chatterino {
namespace {

View file

@ -1,6 +1,10 @@
#pragma once
#include <QJsonObject>
#include <QList>
#include <QRect>
#include <QString>
#include <QUuid>
#include <optional>
#include <variant>

View file

@ -6,6 +6,8 @@
#include "util/RapidjsonHelpers.hpp"
#include <memory>
namespace chatterino {
class Image;

View file

@ -1,6 +1,7 @@
#pragma once
#include <QElapsedTimer>
#include <QString>
#include <boost/noncopyable.hpp>
namespace chatterino {

View file

@ -10,6 +10,9 @@
#include "singletons/WindowManager.hpp"
#include "util/StreamerMode.hpp"
#include <QFileInfo>
#include <QMediaPlayer>
namespace chatterino {
namespace {

View file

@ -5,6 +5,7 @@
#include <IrcMessage>
#include <QColor>
#include <QUrl>
namespace chatterino {

View file

@ -3,6 +3,8 @@
#include "common/NetworkRequest.hpp"
#include "messages/Link.hpp"
#include <boost/noncopyable.hpp>
#include <functional>
namespace chatterino {

View file

@ -10,6 +10,8 @@
#include <shared_mutex>
#include <vector>
#include <QColor>
namespace chatterino {
struct Emote;

View file

@ -11,6 +11,8 @@
#include <QSaveFile>
#include <QtConcurrent>
#include <unordered_set>
namespace chatterino {
namespace {

View file

@ -1,5 +1,6 @@
#pragma once
#include <QString>
#include "common/Outcome.hpp"
namespace chatterino {

View file

@ -11,6 +11,8 @@
#include "singletons/Settings.hpp"
#include "util/QObjectRef.hpp"
#include <QMetaEnum>
namespace chatterino {
IrcServer::IrcServer(const IrcServerData &data)

View file

@ -4,6 +4,8 @@
#include "messages/Image.hpp"
#include "messages/ImageSet.hpp"
#include <rapidjson/document.h>
#define TWITCH_CHANNEL_POINT_REWARD_URL(x) \
QString("https://static-cdn.jtvnw.net/custom-reward-images/default-%1") \
.arg(x)

View file

@ -1,5 +1,8 @@
#include "TwitchBadges.hpp"
#include <QBuffer>
#include <QIcon>
#include <QImageReader>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>

View file

@ -1,5 +1,6 @@
#pragma once
#include <QMap>
#include <QString>
#include <boost/optional.hpp>
#include <unordered_map>
@ -11,6 +12,8 @@
#include "pajlada/signals/signal.hpp"
#include <memory>
#include <queue>
#include <shared_mutex>
namespace chatterino {

View file

@ -8,6 +8,8 @@
#include "common/Aliases.hpp"
#include "common/UniqueAccess.hpp"
#include <memory>
#define TWITCH_EMOTE_TEMPLATE \
"https://static-cdn.jtvnw.net/emoticons/v1/{id}/{scale}"

View file

@ -17,6 +17,8 @@
#include "providers/twitch/TwitchHelpers.hpp"
#include "util/PostToThread.hpp"
#include <QMetaEnum>
// using namespace Communi;
using namespace std::chrono_literals;

View file

@ -3,6 +3,8 @@
#include "common/Outcome.hpp"
#include "common/QLogging.hpp"
#include <QJsonDocument>
namespace chatterino {
static Helix *instance = nullptr;

View file

@ -3,6 +3,8 @@
#include "Application.hpp"
#include "common/Singleton.hpp"
#include <pajlada/settings/setting.hpp>
namespace chatterino {
enum class Platform : uint8_t;

View file

@ -1,6 +1,8 @@
#include "util/Clipboard.hpp"
#include <QApplication>
#include <QClipboard>
namespace chatterino {
void crossPlatformCopy(const QString &text)

View file

@ -1,5 +1,7 @@
#pragma once
#include <QString>
namespace chatterino {
class DisplayBadge
{

View file

@ -1,5 +1,6 @@
#pragma once
#include <IrcMessage>
#include <QString>
namespace chatterino {

View file

@ -1,6 +1,7 @@
#pragma once
#include <QStandardItem>
#include <QUrl>
namespace chatterino {

View file

@ -19,6 +19,8 @@
# pragma comment(lib, "Wtsapi32.lib")
#endif
#include <QProcess>
namespace chatterino {
constexpr int cooldownInS = 10;

View file

@ -1,5 +1,7 @@
#pragma once
#include <QStringList>
namespace chatterino {
enum StreamerModeSetting { Disabled = 0, Enabled = 1, DetectObs = 2 };

View file

@ -1,6 +1,7 @@
#include "util/Twitch.hpp"
#include <QDesktopServices>
#include <QUrl>
namespace chatterino {

View file

@ -1,5 +1,7 @@
#include "widgets/BasePopup.hpp"
#include <QKeyEvent>
namespace chatterino {
BasePopup::BasePopup(FlagsEnum<Flags> _flags, QWidget *parent)

View file

@ -12,6 +12,8 @@
# include <Windows.h>
#endif
#include <QPainter>
namespace chatterino {
TooltipWidget *TooltipWidget::instance()

View file

@ -4,6 +4,9 @@
#include "providers/twitch/TwitchBadges.hpp"
#include <QDialogButtonBox>
#include <QVBoxLayout>
namespace chatterino {
BadgePickerDialog::BadgePickerDialog(QList<DisplayBadge> badges,

View file

@ -2,7 +2,9 @@
#include "util/DisplayBadge.hpp"
#include <QComboBox>
#include <QDialog>
#include <boost/optional.hpp>
namespace chatterino {

View file

@ -2,6 +2,9 @@
#include "controllers/filters/parser/FilterParser.hpp"
#include <QLabel>
#include <QPushButton>
namespace chatterino {
namespace {

View file

@ -1,5 +1,11 @@
#pragma once
#include <QComboBox>
#include <QDialog>
#include <QHBoxLayout>
#include <QLineEdit>
#include <QVBoxLayout>
namespace chatterino {
class ChannelFilterEditorDialog : public QDialog
{

View file

@ -3,6 +3,9 @@
#include "providers/colors/ColorProvider.hpp"
#include "singletons/Theme.hpp"
#include <QDialogButtonBox>
#include <QLineEdit>
namespace chatterino {
ColorPickerDialog::ColorPickerDialog(const QColor &initial, QWidget *parent)

View file

@ -9,6 +9,8 @@
#include <array>
#include <QLabel>
namespace chatterino {
/**

View file

@ -5,6 +5,8 @@
#include "providers/irc/Irc2.hpp"
#include "widgets/BaseWindow.hpp"
#include <QDialog>
namespace Ui {
class IrcConnectionEditor;
}

View file

@ -8,6 +8,8 @@
#include <QDesktopWidget>
#include <QScreen>
#include <QVBoxLayout>
namespace chatterino {
NotificationPopup::NotificationPopup()

View file

@ -20,6 +20,9 @@
#include "providers/irc/Irc2.hpp"
#include "widgets/helper/EditableModelView.hpp"
#include <QHeaderView>
#include <QPushButton>
#define TAB_TWITCH 0
#define TAB_IRC 1

View file

@ -9,6 +9,8 @@
#include <QLabel>
#include <QRadioButton>
#include <QLineEdit>
namespace chatterino {
class Notebook;

View file

@ -2,6 +2,11 @@
#include "singletons/Settings.hpp"
#include <QCheckBox>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
namespace chatterino {
SelectChannelFiltersDialog::SelectChannelFiltersDialog(

View file

@ -10,6 +10,8 @@
#include <pajlada/settings/setting.hpp>
#include "widgets/helper/SettingsDialogTab.hpp"
#include <QFrame>
class QLineEdit;
namespace chatterino {

View file

@ -8,6 +8,8 @@
#include <functional>
#include <QLineEdit>
namespace chatterino {
class GenericListView;

View file

@ -1,5 +1,7 @@
#pragma once
#include <QPushButton>
namespace chatterino {
class ColorButton : public QPushButton

View file

@ -9,6 +9,8 @@
#include <QTableView>
#include <QVBoxLayout>
#include <QLabel>
namespace chatterino {
EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable)

View file

@ -10,6 +10,8 @@
#include <QPainterPath>
#include <QRadialGradient>
#include <QMimeData>
#define nuuls nullptr
namespace chatterino {

View file

@ -14,6 +14,9 @@
#include <QApplication>
#include <QDebug>
#include <QDialogButtonBox>
#include <QLabel>
#include <QLineEdit>
#include <QLinearGradient>
#include <QMimeData>
#include <QPainter>

View file

@ -38,6 +38,9 @@
****************************************************************************/
#include "widgets/helper/QColorPicker.hpp"
#include <QMouseEvent>
#include <QPainter>
#include <qdrawutil.h>
/*

View file

@ -38,6 +38,7 @@
****************************************************************************/
#pragma once
#include <QFrame>
#include <QSpinBox>
namespace chatterino {

View file

@ -1,5 +1,9 @@
#pragma once
#include <memory>
#include <QColor>
namespace chatterino {
class ScrollbarHighlight

View file

@ -2,6 +2,8 @@
#include "BaseTheme.hpp"
#include <QPainterPath>
namespace chatterino {
TitleBarButton::TitleBarButton()

View file

@ -1,5 +1,10 @@
#pragma once
#include <QIcon>
#include <QPainter>
#include <QRect>
#include <QVariant>
namespace chatterino {
class GenericListItem

View file

@ -1,5 +1,8 @@
#include "widgets/listview/GenericListItem.hpp"
#include <QAbstractListModel>
#include <QWidget>
namespace chatterino {
class GenericListModel : public QAbstractListModel

View file

@ -2,6 +2,8 @@
#include "singletons/Theme.hpp"
#include "widgets/listview/GenericListModel.hpp"
#include <QKeyEvent>
namespace chatterino {
GenericListView::GenericListView()

View file

@ -10,6 +10,8 @@
#include <QTableView>
#include <QHeaderView>
#define FILTERS_DOCUMENTATION "https://wiki.chatterino.com/Filters/"
namespace chatterino {

View file

@ -18,6 +18,9 @@
#include "widgets/helper/Line.hpp"
#include "widgets/settingspages/GeneralPageView.hpp"
#include <QDesktopServices>
#include <QFileDialog>
#define CHROME_EXTENSION_LINK \
"https://chrome.google.com/webstore/detail/chatterino-native-host/" \
"glknmaideaikkmemifbfkhnomoknepka"

View file

@ -7,6 +7,11 @@
#include "singletons/WindowManager.hpp"
#include "widgets/helper/SignalLabel.hpp"
#include <QCheckBox>
#include <QComboBox>
#include <QPushButton>
#include <QSpinBox>
class QScrollArea;
namespace chatterino {

View file

@ -8,6 +8,10 @@
#include "singletons/Settings.hpp"
#include <QLabel>
#include <QPainter>
#include <QPushButton>
#define SETTINGS_PAGE_WIDGET_BOILERPLATE(type, parent) \
class type : public parent \
{ \

View file

@ -10,6 +10,8 @@
#include <pajlada/signals/signalholder.hpp>
#include <vector>
#include <QElapsedTimer>
namespace chatterino {
class Button;