summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-05-04 16:19:15 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-05-24 12:36:32 +0000
commit9ebe146feec91756280d03b08deaa2b17044cf48 (patch)
tree030b1d6ab0e78746c905c101e6ab3d3555626472
parentf15c0b695aa851086fac04387ed336401e7a562f (diff)
build qt-png as a proper helper library
it ends up in QtGui via two different routes (freetype and the png handler), and we really don't want to have two copies of it in there. Change-Id: I40760bcb6c615b90ed9f402450bb657c77884613 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/3rdparty/freetype/freetype.pro9
-rw-r--r--src/3rdparty/libpng.pri21
-rw-r--r--src/3rdparty/libpng/libpng.pro30
-rw-r--r--src/3rdparty/png_dependency.pri3
-rw-r--r--src/src.pro9
5 files changed, 43 insertions, 29 deletions
diff --git a/src/3rdparty/freetype/freetype.pro b/src/3rdparty/freetype/freetype.pro
index e85ed1699b..41ca469576 100644
--- a/src/3rdparty/freetype/freetype.pro
+++ b/src/3rdparty/freetype/freetype.pro
@@ -68,12 +68,7 @@ DEFINES += FT2_BUILD_LIBRARY
DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB
include(../zlib_dependency.pri)
-contains(QT_CONFIG, system-png) {
- DEFINES += FT_CONFIG_OPTION_USE_PNG
- include($$PWD/../png_dependency.pri)
-} else:!contains(QT_CONFIG, no-png):!win32 {
- DEFINES += FT_CONFIG_OPTION_USE_PNG
- include($$PWD/../libpng.pri)
-}
+DEFINES += FT_CONFIG_OPTION_USE_PNG
+include($$PWD/../png_dependency.pri)
DEFINES += TT_CONFIG_OPTION_SUBPIXEL_HINTING
diff --git a/src/3rdparty/libpng.pri b/src/3rdparty/libpng.pri
deleted file mode 100644
index a5fe32f867..0000000000
--- a/src/3rdparty/libpng.pri
+++ /dev/null
@@ -1,21 +0,0 @@
-DEFINES += PNG_ARM_NEON_OPT=0
-INCLUDEPATH += $$PWD/libpng
-SOURCES += $$PWD/libpng/png.c \
- $$PWD/libpng/pngerror.c \
- $$PWD/libpng/pngget.c \
- $$PWD/libpng/pngmem.c \
- $$PWD/libpng/pngpread.c \
- $$PWD/libpng/pngread.c \
- $$PWD/libpng/pngrio.c \
- $$PWD/libpng/pngrtran.c \
- $$PWD/libpng/pngrutil.c \
- $$PWD/libpng/pngset.c \
- $$PWD/libpng/pngtrans.c \
- $$PWD/libpng/pngwio.c \
- $$PWD/libpng/pngwrite.c \
- $$PWD/libpng/pngwtran.c \
- $$PWD/libpng/pngwutil.c
-
-TR_EXCLUDE += $$PWD/*
-
-include($$PWD/zlib_dependency.pri)
diff --git a/src/3rdparty/libpng/libpng.pro b/src/3rdparty/libpng/libpng.pro
new file mode 100644
index 0000000000..7d51c30cb4
--- /dev/null
+++ b/src/3rdparty/libpng/libpng.pro
@@ -0,0 +1,30 @@
+TARGET = qtpng
+
+CONFIG += \
+ static \
+ hide_symbols \
+ exceptions_off rtti_off warn_off
+
+load(qt_helper_lib)
+
+DEFINES += PNG_ARM_NEON_OPT=0
+SOURCES += \
+ png.c \
+ pngerror.c \
+ pngget.c \
+ pngmem.c \
+ pngpread.c \
+ pngread.c \
+ pngrio.c \
+ pngrtran.c \
+ pngrutil.c \
+ pngset.c \
+ pngtrans.c \
+ pngwio.c \
+ pngwrite.c \
+ pngwtran.c \
+ pngwutil.c
+
+TR_EXCLUDE += $$PWD/*
+
+include(../zlib_dependency.pri)
diff --git a/src/3rdparty/png_dependency.pri b/src/3rdparty/png_dependency.pri
index 78da861f77..eb32432b49 100644
--- a/src/3rdparty/png_dependency.pri
+++ b/src/3rdparty/png_dependency.pri
@@ -2,5 +2,6 @@ contains(QT_CONFIG, system-png) {
unix|mingw: LIBS_PRIVATE += -lpng
else: LIBS += libpng.lib
} else: contains(QT_CONFIG, png) {
- include($$PWD/libpng.pri)
+ INCLUDEPATH += $$PWD/libpng
+ LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtpng$$qtPlatformTargetSuffix()
}
diff --git a/src/src.pro b/src/src.pro
index 71347dc009..585767361e 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -88,6 +88,9 @@ src_3rdparty_harfbuzzng.subdir = $$PWD/3rdparty/harfbuzz-ng
src_3rdparty_harfbuzzng.target = sub-3rdparty-harfbuzzng
src_3rdparty_harfbuzzng.depends = src_corelib # for the Qt atomics
+src_3rdparty_libpng.subdir = $$PWD/3rdparty/libpng
+src_3rdparty_libpng.target = sub-3rdparty-libpng
+
src_3rdparty_freetype.subdir = $$PWD/3rdparty/freetype
src_3rdparty_freetype.target = sub-3rdparty-freetype
@@ -132,6 +135,7 @@ src_android.subdir = $$PWD/android
contains(QT_CONFIG, zlib)|cross_compile {
SUBDIRS += src_qtzlib
contains(QT_CONFIG, zlib) {
+ src_3rdparty_libpng.depends += src_corelib
src_3rdparty_freetype.depends += src_corelib
}
}
@@ -163,6 +167,11 @@ contains(QT_CONFIG, concurrent):SUBDIRS += src_concurrent
SUBDIRS += src_angle
src_gui.depends += src_angle
}
+ contains(QT_CONFIG, png) {
+ SUBDIRS += src_3rdparty_libpng
+ src_3rdparty_freetype.depends += src_3rdparty_libpng
+ src_plugins.depends += src_3rdparty_libpng
+ }
contains(QT_CONFIG, freetype) {
SUBDIRS += src_3rdparty_freetype
src_platformsupport.depends += src_3rdparty_freetype