summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-02-17 10:29:27 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-05-20 11:38:12 +0000
commit40e9ba00a05d3a0ef0aa401565d7129eaa476ee6 (patch)
treef39fff738a60600adfafce7f1032ae9dbbcfe24e
parenta1d412aec45e2232537795c5a1a8500daeb061d6 (diff)
downloadqtimageformats-40e9ba00a05d3a0ef0aa401565d7129eaa476ee6.tar.gz
Android: Build webp plugin
We need to include the cpufeatures module in the build for Android, and we need to make sure the neon files are compiled with neon flags turned on. Since these are .c files, we cannot use the regular simd.prf approach, which only supports .cpp, so the compiler is basically copy-pasted from simd.prf, but using QMAKE_CC instead of QMAKE_CXX. [ChangeLog][Android] Added support for webp image format. Change-Id: Id702b8202bee963d23beb02a7dc163756c8ca712 Task-number: QTBUG-38715 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
-rw-r--r--src/3rdparty/libwebp.pri35
-rw-r--r--src/plugins/imageformats/imageformats.pro2
2 files changed, 32 insertions, 5 deletions
diff --git a/src/3rdparty/libwebp.pri b/src/3rdparty/libwebp.pri
index 627ff95..865f0ff 100644
--- a/src/3rdparty/libwebp.pri
+++ b/src/3rdparty/libwebp.pri
@@ -24,14 +24,11 @@ SOURCES += \
$$PWD/libwebp/src/demux/demux.c \
$$PWD/libwebp/src/dsp/cpu.c \
$$PWD/libwebp/src/dsp/dec.c \
- $$PWD/libwebp/src/dsp/dec_neon.c \
$$PWD/libwebp/src/dsp/dec_sse2.c \
$$PWD/libwebp/src/dsp/enc.c \
- $$PWD/libwebp/src/dsp/enc_neon.c \
$$PWD/libwebp/src/dsp/enc_sse2.c \
$$PWD/libwebp/src/dsp/lossless.c \
$$PWD/libwebp/src/dsp/upsampling.c \
- $$PWD/libwebp/src/dsp/upsampling_neon.c \
$$PWD/libwebp/src/dsp/upsampling_sse2.c \
$$PWD/libwebp/src/dsp/yuv.c \
$$PWD/libwebp/src/dsp/alpha_processing.c \
@@ -41,7 +38,6 @@ SOURCES += \
$$PWD/libwebp/src/dsp/enc_avx2.c \
$$PWD/libwebp/src/dsp/enc_mips32.c \
$$PWD/libwebp/src/dsp/lossless_mips32.c \
- $$PWD/libwebp/src/dsp/lossless_neon.c \
$$PWD/libwebp/src/dsp/lossless_sse2.c \
$$PWD/libwebp/src/dsp/yuv_mips32.c \
$$PWD/libwebp/src/dsp/yuv_sse2.c \
@@ -80,3 +76,34 @@ SOURCES += \
$$PWD/libwebp/src/utils/rescaler.c \
$$PWD/libwebp/src/utils/thread.c \
$$PWD/libwebp/src/utils/utils.c
+
+android {
+ SOURCES += $$NDK_ROOT/sources/android/cpufeatures/cpu-features.c
+ INCLUDEPATH += $$NDK_ROOT/sources/android/cpufeatures
+}
+
+equals(QT_ARCH, arm) {
+ SOURCES_FOR_NEON += \
+ $$PWD/libwebp/src/dsp/dec_neon.c \
+ $$PWD/libwebp/src/dsp/enc_neon.c \
+ $$PWD/libwebp/src/dsp/upsampling_neon.c \
+ $$PWD/libwebp/src/dsp/lossless_neon.c
+
+ contains(QT_CPU_FEATURES, neon) {
+ # Default compiler settings include this feature, so just add to SOURCES
+ SOURCES += $$SOURCES_FOR_NEON
+ } else {
+ neon_comp.commands = $$QMAKE_CC -c $(CFLAGS)
+ neon_comp.commands += $$QMAKE_CFLAGS_NEON
+ neon_comp.commands += $(INCPATH) ${QMAKE_FILE_IN}
+ msvc: neon_comp.commands += -Fo${QMAKE_FILE_OUT}
+ else: neon_comp.commands += -o ${QMAKE_FILE_OUT}
+ neon_comp.dependency_type = TYPE_C
+ neon_comp.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+ neon_comp.input = SOURCES_FOR_NEON
+ neon_comp.variable_out = OBJECTS
+ neon_comp.name = compiling[neon] ${QMAKE_FILE_IN}
+ silent: neon_comp.commands = @echo compiling[neon] ${QMAKE_FILE_IN} && $$neon_comp.commands
+ QMAKE_EXTRA_COMPILERS += neon_comp
+ }
+}
diff --git a/src/plugins/imageformats/imageformats.pro b/src/plugins/imageformats/imageformats.pro
index 54b0622..b6e79d4 100644
--- a/src/plugins/imageformats/imageformats.pro
+++ b/src/plugins/imageformats/imageformats.pro
@@ -16,4 +16,4 @@ winrt {
tga
}
-winrt|android|ios: SUBDIRS -= webp
+winrt|ios: SUBDIRS -= webp