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_PAJLADA_SETTINGS "Use system pajlada settings library" OFF)
option(USE_SYSTEM_LIBCOMMUNI "Use system communi library" OFF) option(USE_SYSTEM_LIBCOMMUNI "Use system communi library" OFF)
option(USE_SYSTEM_QT5KEYCHAIN "Use system Qt5Keychain 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) option(USE_CONAN "Use conan" OFF)

View file

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

View file

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

View file

@ -476,7 +476,9 @@ source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${SOURCE_FILES})
add_executable(${PROJECT_NAME} ${SOURCE_FILES}) add_executable(${PROJECT_NAME} ${SOURCE_FILES})
add_sanitizers(${PROJECT_NAME}) 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 # Enable autogeneration of Qts MOC/RCC/UIC
set_target_properties(${PROJECT_NAME} set_target_properties(${PROJECT_NAME}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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