Skip to content

Commit

Permalink
qmake: Added support for linking to system zstd on Linux
Browse files Browse the repository at this point in the history
Use it to enable Zstandard support in the snap release.

Closes mapeditor#2850
  • Loading branch information
bjorn committed Jun 30, 2020
1 parent 7970753 commit 73c01dd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,24 @@ parts:
qt-version: qt5
options:
- PREFIX=/usr
- SYSTEM_ZSTD=yes
- CONFIG+=release
override-pull: |
snapcraftctl pull
snapcraftctl set-version "$(git describe | cut -c 2-)"
source: .
build-packages:
- pkg-config
# FIXME: Python plugin compiles and loads, but can't find platform libraries
# - pkg-config
# - python-dev
- qttools5-dev-tools
- qtdeclarative5-dev
- zlib1g-dev
- libzstd-dev
stage-packages:
- libqt5quick5
# - libpython2.7
- libzstd1
after: [desktop-qt5]

desktop-qt5:
Expand Down
7 changes: 7 additions & 0 deletions src/libtiled/libtiled.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ win32 {
LIBS += -lz
}

# On Linux we support linking to system Zstandard install
linux:contains(SYSTEM_ZSTD, yes) {
CONFIG += link_pkgconfig
PKGCONFIG += libzstd
DEFINES += TILED_ZSTD_SUPPORT
}

DEFINES += QT_NO_CAST_FROM_ASCII \
QT_NO_CAST_TO_ASCII
DEFINES += TILED_LIBRARY
Expand Down
5 changes: 5 additions & 0 deletions src/tiled/tiled.pro
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ macx {
QMAKE_RPATHDIR =
}

# On Linux we support linking to system Zstandard install
linux:contains(SYSTEM_ZSTD, yes) {
DEFINES += TILED_ZSTD_SUPPORT
}

SOURCES += aboutdialog.cpp \
abstractobjecttool.cpp \
abstracttileselectiontool.cpp \
Expand Down
1 change: 1 addition & 0 deletions tiled.pri
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ isEmpty(PREFIX):PREFIX = /usr/local
isEmpty(LIBDIR):LIBDIR = $${PREFIX}/lib
isEmpty(RPATH):RPATH = yes
isEmpty(INSTALL_HEADERS):INSTALL_HEADERS = no
isEmpty(SYSTEM_ZSTD):SYSTEM_ZSTD = no

macx {
# Do a universal build when possible
Expand Down

0 comments on commit 73c01dd

Please sign in to comment.