Fix Mac Builds (#4844)
This commit is contained in:
parent
e3552fc0ae
commit
8c539351e3
8 changed files with 26 additions and 25 deletions
5
.github/workflows/desktop-build.yml
vendored
5
.github/workflows/desktop-build.yml
vendored
|
@ -201,7 +201,7 @@ jobs:
|
||||||
- target: Debug # tests only
|
- target: Debug # tests only
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
xcode: 14.2
|
xcode: 14.2
|
||||||
qt_version: 6.*
|
qt_version: 6.5
|
||||||
qt_modules: "qtmultimedia qtwebsockets"
|
qt_modules: "qtmultimedia qtwebsockets"
|
||||||
type: Debug
|
type: Debug
|
||||||
do_tests: 1
|
do_tests: 1
|
||||||
|
@ -251,7 +251,8 @@ jobs:
|
||||||
install_qt: ${{matrix.qt_version}}
|
install_qt: ${{matrix.qt_version}}
|
||||||
run: |
|
run: |
|
||||||
brew update
|
brew update
|
||||||
brew install protobuf
|
brew install protobuf@21
|
||||||
|
brew link --force protobuf@21
|
||||||
if [[ $install_qt == homebrew ]]; then
|
if [[ $install_qt == homebrew ]]; then
|
||||||
brew install qt --force-bottle
|
brew install qt --force-bottle
|
||||||
else # for some reason the tests fail with the action installed qt?
|
else # for some reason the tests fail with the action installed qt?
|
||||||
|
|
|
@ -179,7 +179,7 @@ else()
|
||||||
# other: osx/llvm, bsd/llvm
|
# other: osx/llvm, bsd/llvm
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
||||||
if(WARNING_AS_ERROR)
|
if(WARNING_AS_ERROR)
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra -Werror")
|
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra -Werror -Wno-unused-parameter")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra")
|
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -21,18 +21,18 @@ public:
|
||||||
{
|
{
|
||||||
Type = typeCardDrag
|
Type = typeCardDrag
|
||||||
};
|
};
|
||||||
int type() const
|
int type() const override
|
||||||
{
|
{
|
||||||
return Type;
|
return Type;
|
||||||
}
|
}
|
||||||
AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag = 0);
|
AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag = 0);
|
||||||
~AbstractCardDragItem();
|
~AbstractCardDragItem();
|
||||||
QRectF boundingRect() const
|
QRectF boundingRect() const override
|
||||||
{
|
{
|
||||||
return QRectF(0, 0, CARD_WIDTH, CARD_HEIGHT);
|
return QRectF(0, 0, CARD_WIDTH, CARD_HEIGHT);
|
||||||
}
|
}
|
||||||
QPainterPath shape() const override;
|
QPainterPath shape() const override;
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||||
AbstractCardItem *getItem() const
|
AbstractCardItem *getItem() const
|
||||||
{
|
{
|
||||||
return item;
|
return item;
|
||||||
|
@ -45,7 +45,7 @@ public:
|
||||||
virtual void updatePosition(const QPointF &cursorScenePos) = 0;
|
virtual void updatePosition(const QPointF &cursorScenePos) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
{
|
{
|
||||||
Type = typeCard
|
Type = typeCard
|
||||||
};
|
};
|
||||||
int type() const
|
int type() const override
|
||||||
{
|
{
|
||||||
return Type;
|
return Type;
|
||||||
}
|
}
|
||||||
|
@ -53,11 +53,11 @@ public:
|
||||||
int _id = -1,
|
int _id = -1,
|
||||||
QGraphicsItem *parent = nullptr);
|
QGraphicsItem *parent = nullptr);
|
||||||
~AbstractCardItem();
|
~AbstractCardItem();
|
||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const override;
|
||||||
QPainterPath shape() const override;
|
QPainterPath shape() const override;
|
||||||
QSizeF getTranslatedSize(QPainter *painter) const;
|
QSizeF getTranslatedSize(QPainter *painter) const;
|
||||||
void paintPicture(QPainter *painter, const QSizeF &translatedSize, int angle);
|
void paintPicture(QPainter *painter, const QSizeF &translatedSize, int angle);
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||||
CardInfoPtr getInfo() const
|
CardInfoPtr getInfo() const
|
||||||
{
|
{
|
||||||
return info;
|
return info;
|
||||||
|
@ -104,9 +104,9 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void transformPainter(QPainter *painter, const QSizeF &translatedSize, int angle);
|
void transformPainter(QPainter *painter, const QSizeF &translatedSize, int angle);
|
||||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
|
||||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
|
||||||
QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
|
QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) override;
|
||||||
void cacheBgColor();
|
void cacheBgColor();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,18 +18,18 @@ public:
|
||||||
bool _isShufflable,
|
bool _isShufflable,
|
||||||
bool _contentsKnown,
|
bool _contentsKnown,
|
||||||
QGraphicsItem *parent = nullptr);
|
QGraphicsItem *parent = nullptr);
|
||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const override;
|
||||||
QPainterPath shape() const override;
|
QPainterPath shape() const override;
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||||
void reorganizeCards();
|
void reorganizeCards() override;
|
||||||
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint);
|
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
|
||||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
|
||||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
|
||||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
|
||||||
void addCardImpl(CardItem *card, int x, int y);
|
void addCardImpl(CardItem *card, int x, int y) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -42,7 +42,7 @@ void ReleaseChannel::checkForUpdates()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Different release channel checking functions for different operating systems
|
// Different release channel checking functions for different operating systems
|
||||||
#if defined(Q_OS_OSX)
|
#if defined(Q_OS_MACOS)
|
||||||
bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
|
bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
|
||||||
{
|
{
|
||||||
static QRegularExpression version_regex("macOS-(\\d+)\\.(\\d+)");
|
static QRegularExpression version_regex("macOS-(\\d+)\\.(\\d+)");
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef ROOM_MESSAGE_TYPE_H
|
#ifndef ROOM_MESSAGE_TYPE_H
|
||||||
#define ROOM_MESSAGE_TYPE_H
|
#define ROOM_MESSAGE_TYPE_H
|
||||||
|
|
||||||
#ifdef Q_OS_OSX
|
#ifdef Q_OS_MACOS
|
||||||
// avoid collision from Mac OS X's ConditionalMacros.h
|
// avoid collision from Mac OS X's ConditionalMacros.h
|
||||||
// https://github.com/protocolbuffers/protobuf/issues/119
|
// https://github.com/protocolbuffers/protobuf/issues/119
|
||||||
#undef TYPE_BOOL
|
#undef TYPE_BOOL
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef USER_LEVEL_H
|
#ifndef USER_LEVEL_H
|
||||||
#define USER_LEVEL_H
|
#define USER_LEVEL_H
|
||||||
|
|
||||||
#ifdef Q_OS_OSX
|
#ifdef Q_OS_MACOS
|
||||||
// avoid collision from Mac OS X's ConditionalMacros.h
|
// avoid collision from Mac OS X's ConditionalMacros.h
|
||||||
// https://github.com/protocolbuffers/protobuf/issues/119
|
// https://github.com/protocolbuffers/protobuf/issues/119
|
||||||
#undef TYPE_BOOL
|
#undef TYPE_BOOL
|
||||||
|
|
Loading…
Reference in a new issue