From 438b219eb2dc13a6bbda38c9fea52c307f70bf7e Mon Sep 17 00:00:00 2001 From: Sacha Date: Tue, 3 Jun 2014 09:26:24 +1000 Subject: [PATCH] Qt: Support Android armv6. Compiles and runs fine with gcc4.8. Creates 16MB APK but less than 10MB with Ministro. --- Qt/Core.pro | 2 +- Qt/Native.pro | 4 ++-- Qt/PPSSPP.pro | 15 +++++++++++---- Qt/Settings.pri | 10 ++++++++-- native | 2 +- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Qt/Core.pro b/Qt/Core.pro index 4300756fa7..32a78a7d34 100755 --- a/Qt/Core.pro +++ b/Qt/Core.pro @@ -70,7 +70,7 @@ SOURCES += $$P/Core/*.cpp \ # Core $$P/ext/xxhash.c \ # xxHash $$P/ext/xbrz/*.cpp # XBRZ -!x86:!symbian: SOURCES += $$P/GPU/Common/TextureDecoderNEON.cpp +armv7: SOURCES += $$P/GPU/Common/TextureDecoderNEON.cpp arm: SOURCES += $$P/GPU/GLES/VertexDecoderArm.cpp else:SOURCES += $$P/GPU/GLES/VertexDecoderX86.cpp diff --git a/Qt/Native.pro b/Qt/Native.pro index 67b7c02654..789caceebf 100755 --- a/Qt/Native.pro +++ b/Qt/Native.pro @@ -64,7 +64,7 @@ HEADERS += $$P/native/ext/libzip/*.h # Libpng SOURCES += $$P/native/ext/libpng17/*.c HEADERS += $$P/native/ext/libpng17/*.h -arm:!symbian: SOURCES += $$P/native/ext/libpng17/arm/*.c +armv7: SOURCES += $$P/native/ext/libpng17/arm/*.c INCLUDEPATH += $$P/native/ext @@ -110,7 +110,7 @@ SOURCES += $$P/native/audio/*.cpp \ x86 { SOURCES += $$files($$P/native/math/fast/fast_matrix_sse.c) } -arm:!symbian { +armv7 { SOURCES += $$files($$P/native/math/fast/fast_matrix_neon.S) } diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index 70ffcb9fe1..a94487c127 100755 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -19,9 +19,10 @@ linux:lessThan(QT_MAJOR_VERSION,5):!packagesExist(QtMultimedia) { } else: QT += multimedia -greaterThan(QT_MAJOR_VERSION,4): QT += widgets - -!maemo5:mobile_platform { +greaterThan(QT_MAJOR_VERSION,4) { + QT += widgets + mobile_platform: QT += sensors +} else:!maemo5:mobile_platform { CONFIG += mobility MOBILITY += sensors symbian: MOBILITY += systeminfo feedback @@ -39,6 +40,7 @@ macx: QMAKE_LIBDIR += $$P/ffmpeg/macosx/x86_64/lib/ ios: QMAKE_LIBDIR += $$P/ffmpeg/ios/universal/lib/ qnx: QMAKE_LIBDIR += $$P/ffmpeg/blackberry/armv7/lib/ symbian:QMAKE_LIBDIR += $$P/ffmpeg/symbian/armv6/lib/ +android:QMAKE_LIBDIR += $$P/ffmpeg/android/armv6/lib/ contains(DEFINES, USE_FFMPEG): LIBS += -lavformat -lavcodec -lavutil -lswresample -lswscale @@ -52,7 +54,7 @@ win32 { contains(QMAKE_TARGET.arch, x86_64): LIBS += $$files($$P/dx9sdk/Lib/x64/*.lib) else: LIBS += $$files($$P/dx9sdk/Lib/x86/*.lib) } -linux { +linux:!android { LIBS += -ldl -lrt -lz PRE_TARGETDEPS += $$CONFIG_DIR/libCommon.a $$CONFIG_DIR/libCore.a $$CONFIG_DIR/libNative.a packagesExist(sdl) { @@ -68,6 +70,7 @@ symbian: LIBS += -lremconcoreapi -lremconinterfacebase contains(QT_CONFIG, system-zlib) { unix: LIBS += -lz } +android: LIBS += -lEGL # Main SOURCES += $$P/native/base/QtMain.cpp @@ -90,6 +93,8 @@ SOURCES += $$P/UI/*Screen.cpp \ $$P/UI/ui_atlas_lowmem.cpp \ $$P/android/jni/TestRunner.cpp +arm:android: SOURCES += $$P/android/jni/ArmEmitterTest.cpp + HEADERS += $$P/UI/*.h INCLUDEPATH += $$P $$P/Common $$P/native $$P/native/ext @@ -143,3 +148,5 @@ maemo { CONFIG += qt-boostable } +ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android + diff --git a/Qt/Settings.pri b/Qt/Settings.pri index 67949f2df1..537e5d0d78 100644 --- a/Qt/Settings.pri +++ b/Qt/Settings.pri @@ -1,7 +1,8 @@ VERSION = 0.9.8 DEFINES += USING_QT_UI USE_FFMPEG -unix:!qnx:!symbian:!mac: CONFIG += linux +unix:!qnx:!symbian:!android:!mac: CONFIG += linux maemo5|contains(MEEGO_EDITION,harmattan): CONFIG += maemo +arm:!symbian:!android: CONFIG += armv7 # Global specific win32:CONFIG(release, debug|release): CONFIG_DIR = $$join(OUT_PWD,,,/release) @@ -50,7 +51,7 @@ else { # Assume ARM gleslib = $$lower($$QMAKE_LIBS_OPENGL) gleslib = $$find(gleslib, "gles") -maemo|!count(gleslib,0) { +android|maemo|!count(gleslib,0) { DEFINES += USING_GLES2 DEFINES += MOBILE_DEVICE } @@ -91,3 +92,8 @@ symbian { INCLUDEPATH += $$EPOCROOT/epoc32/include/stdapis INCLUDEPATH += $$P/ffmpeg/symbian/armv6/include } +android { + DEFINES += ANDROID + INCLUDEPATH += $$P/native/ext/libzip + INCLUDEPATH += $$P/ffmpeg/android/armv6/include +} diff --git a/native b/native index 205423637f..dfe8664419 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 205423637fd4ffc00beef769acc3d904c7fbd202 +Subproject commit dfe866441987d3c2c01e721b0749a373360801be