mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-10 02:53:06 +00:00
Qt: Modularise the settings file in to platforms with Arch / OS detection.
This commit is contained in:
parent
0795f793b7
commit
d1fffede2c
@ -19,36 +19,9 @@ greaterThan(QT_MAJOR_VERSION,4) {
|
||||
symbian: MOBILITY += systeminfo feedback
|
||||
}
|
||||
|
||||
# PPSSPP Libs
|
||||
QMAKE_LIBDIR += $$CONFIG_DIR
|
||||
symbian: LIBS += -lCore.lib -lGPU.lib -lCommon.lib -lNative.lib
|
||||
else: LIBS += -lCore -lGPU -lCommon -lNative
|
||||
|
||||
# FFMPEG Path
|
||||
win32: QMAKE_LIBDIR += $$P/ffmpeg/Windows/$${QMAKE_TARGET.arch}/lib/
|
||||
linux {
|
||||
arm: QMAKE_LIBDIR += $$P/ffmpeg/linux/armv7/lib/
|
||||
else:QMAKE_LIBDIR += $$P/ffmpeg/linux/$${QMAKE_TARGET.arch}/lib/
|
||||
}
|
||||
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/armv7/lib/
|
||||
|
||||
contains(DEFINES, USE_FFMPEG): LIBS += -lavformat -lavcodec -lavutil -lswresample -lswscale
|
||||
|
||||
# External (platform-dependant) libs
|
||||
|
||||
win32 {
|
||||
#Use a fixed base-address under windows
|
||||
QMAKE_LFLAGS += /FIXED /BASE:"0x00400000" /DYNAMICBASE:NO
|
||||
LIBS += -lwinmm -lws2_32 -lShell32 -lAdvapi32
|
||||
contains(QMAKE_TARGET.arch, x86_64): LIBS += $$files($$P/dx9sdk/Lib/x64/*.lib)
|
||||
else: LIBS += $$files($$P/dx9sdk/Lib/x86/*.lib)
|
||||
}
|
||||
|
||||
macx|linux {
|
||||
macx|equals(PLATFORM_NAME, "linux") {
|
||||
PRE_TARGETDEPS += $$CONFIG_DIR/libCommon.a $$CONFIG_DIR/libCore.a $$CONFIG_DIR/libGPU.a $$CONFIG_DIR/libNative.a
|
||||
CONFIG += link_pkgconfig
|
||||
packagesExist(sdl) {
|
||||
@ -63,18 +36,13 @@ macx|linux {
|
||||
}
|
||||
}
|
||||
|
||||
linux:!android: LIBS += -ldl -lrt
|
||||
macx: LIBS += -liconv
|
||||
qnx: LIBS += -lscreen
|
||||
symbian: LIBS += -lremconcoreapi -lremconinterfacebase
|
||||
linux:arm|android: LIBS += -lEGL
|
||||
unix:contains(QT_CONFIG, system-zlib) {
|
||||
LIBS += -lz
|
||||
}
|
||||
|
||||
# Qt Multimedia (if SDL is not found)
|
||||
!contains(DEFINES, QT_HAS_SDL) {
|
||||
linux:lessThan(QT_MAJOR_VERSION,5):!exists($$[QT_INSTALL_HEADERS]/QtMultimedia) {
|
||||
lessThan(QT_MAJOR_VERSION,5):!exists($$[QT_INSTALL_HEADERS]/QtMultimedia) {
|
||||
# Fallback to mobility audio
|
||||
CONFIG += mobility
|
||||
MOBILITY += multimedia
|
||||
@ -112,7 +80,7 @@ INCLUDEPATH += $$P $$P/Common $$P/native $$P/native/ext
|
||||
mobile_platform: RESOURCES += $$P/Qt/assets.qrc
|
||||
else {
|
||||
# TODO: Rewrite Debugger with same backend as Windows version
|
||||
# Don't use .ui forms. Use Qt5 + C++11 features to minimise code
|
||||
# Do not use .ui forms. Use Qt5 + C++11 features to minimise code
|
||||
SOURCES += $$P/Qt/*.cpp $$P/Qt/Debugger/*.cpp
|
||||
HEADERS += $$P/Qt/*.h $$P/Qt/Debugger/*.h
|
||||
FORMS += $$P/Qt/Debugger/*.ui
|
||||
@ -136,45 +104,11 @@ else {
|
||||
lang.name = $$LREL_TOOL ${QMAKE_FILE_IN}
|
||||
lang.input = TRANSLATIONS
|
||||
lang.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm
|
||||
|
||||
lang.commands = $$LREL_TOOL ${QMAKE_FILE_IN}
|
||||
lang.CONFIG = no_link
|
||||
QMAKE_EXTRA_COMPILERS += lang
|
||||
PRE_TARGETDEPS += compiler_lang_make_all
|
||||
}
|
||||
|
||||
# Packaging
|
||||
win32: ICON = $$P/Windows/ppsspp.rc
|
||||
|
||||
symbian {
|
||||
TARGET.UID3 = 0xE0095B1D
|
||||
DEPLOYMENT.display_name = PPSSPP
|
||||
vendor_deploy.pkg_prerules = "%{\"Qtness\"}" ":\"Qtness\""
|
||||
ICON = $$P/assets/icon.svg
|
||||
|
||||
DEPLOYMENT += vendor_deploy
|
||||
MMP_RULES += "DEBUGGABLE"
|
||||
|
||||
# 268 MB maximum
|
||||
TARGET.EPOCHEAPSIZE = 0x40000 0x10000000
|
||||
TARGET.EPOCSTACKSIZE = 0x10000
|
||||
}
|
||||
|
||||
linux {
|
||||
icon.files = $$P/assets/icon-114.png
|
||||
icon.path = /usr/share/icons/hicolor/114x114/apps
|
||||
INSTALLS += icon
|
||||
}
|
||||
|
||||
maemo {
|
||||
target.path = /opt/PPSSPP/bin
|
||||
desktopfile.files = PPSSPP.desktop
|
||||
desktopfile.path = /usr/share/applications
|
||||
INSTALLS += target desktopfile
|
||||
# Booster
|
||||
QMAKE_CXXFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
QMAKE_LFLAGS += -pie -rdynamic
|
||||
CONFIG += qt-boostable
|
||||
}
|
||||
|
||||
ANDROID_PACKAGE_SOURCE_DIR = $$P/android
|
||||
|
||||
|
37
Qt/Platform/ArchDetection.pri
Normal file
37
Qt/Platform/ArchDetection.pri
Normal file
@ -0,0 +1,37 @@
|
||||
PLATFORM_ARCH="generic"
|
||||
|
||||
contains(QT_ARCH, ".*86.*")|contains(QMAKE_TARGET.arch, ".*86.*") {
|
||||
!win32-msvc*: QMAKE_ALLFLAGS += -msse2
|
||||
else: QMAKE_ALLFLAGS += /arch:SSE2
|
||||
CONFIG += i86
|
||||
|
||||
contains(QT_ARCH, x86_64)|contains(QMAKE_TARGET.arch, x86_64): PLATFORM_ARCH = x86_64
|
||||
else: PLATFORM_ARCH = x86
|
||||
|
||||
# Fix 32-bit/64-bit defines
|
||||
equals(PLATFORM_ARCH, x86_64): DEFINES += _M_X64
|
||||
else: DEFINES += _M_IX86
|
||||
} else:contains(QT_ARCH, ".*arm.*")|contains(QMAKE_TARGET.arch, ".*arm.*") {
|
||||
DEFINES += ARM
|
||||
CONFIG += arm
|
||||
# Will need to see how QT_ARCH and QMAKE_TARGET.arch are populated for various ARM platforms.
|
||||
symbian: PLATFORM_ARCH="armv6"
|
||||
else {
|
||||
PLATFORM_ARCH="armv7"
|
||||
CONFIG += armv7
|
||||
QMAKE_CFLAGS_RELEASE ~= s/-mfpu.*/
|
||||
QMAKE_CFLAGS_DEBUG ~= s/-mfpu.*/
|
||||
QMAKE_ALLFLAGS_DEBUG += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize
|
||||
QMAKE_ALLFLAGS_RELEASE += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize
|
||||
}
|
||||
# TODO: armv8?
|
||||
} else {
|
||||
# Generic
|
||||
warning("You are using an untested arch. Only x86 and ARM CPUs are supported")
|
||||
DEFINES += GENERIC_ARCH
|
||||
CONFIG += generic
|
||||
}
|
||||
|
||||
|
||||
# Odd one out
|
||||
ios: PLATFORM_ARCH="universal"
|
19
Qt/Platform/OSDetection.pri
Normal file
19
Qt/Platform/OSDetection.pri
Normal file
@ -0,0 +1,19 @@
|
||||
# This file is to add features deemed necessary that don't exist in qmake.conf
|
||||
# There is no linux setting in qmake.conf
|
||||
|
||||
# For our purposes, maemo5 and meego perform the same.
|
||||
maemo5|contains(MEEGO_EDITION,harmattan): CONFIG += maemo
|
||||
|
||||
# All supported platforms that require tweaks
|
||||
PLATFORM_NAME="generic"
|
||||
win32: PLATFORM_NAME="Windows"
|
||||
unix: PLATFORM_NAME="linux"
|
||||
qnx: PLATFORM_NAME="blackberry"
|
||||
mac: PLATFORM_NAME="macosx"
|
||||
ios: PLATFORM_NAME="ios"
|
||||
maemo: PLATFORM_NAME="maemo"
|
||||
symbian: PLATFORM_NAME="symbian"
|
||||
android: PLATFORM_NAME="android"
|
||||
|
||||
!equals(PLATFORM_NAME, "generic"): include($$PLATFORM_NAME".pri")
|
||||
|
15
Qt/Platform/Windows.pri
Normal file
15
Qt/Platform/Windows.pri
Normal file
@ -0,0 +1,15 @@
|
||||
PRECOMPILED_HEADER = $$P/Windows/stdafx.h
|
||||
PRECOMPILED_SOURCE = $$P/Windows/stdafx.cpp
|
||||
INCLUDEPATH += $$P
|
||||
|
||||
equals(TARGET, PPSSPPQt) {
|
||||
# Executable
|
||||
# Use a fixed base-address under windows
|
||||
QMAKE_LFLAGS += /FIXED /BASE:"0x00400000" /DYNAMICBASE:NO
|
||||
LIBS += -lwinmm -lws2_32 -lShell32 -lAdvapi32
|
||||
contains(QMAKE_TARGET.arch, x86_64): LIBS += $$files($$P/dx9sdk/Lib/x64/*.lib)
|
||||
else: LIBS += $$files($$P/dx9sdk/Lib/x86/*.lib)
|
||||
|
||||
# Packaging
|
||||
ICON = $$P/Windows/ppsspp.rc
|
||||
}
|
7
Qt/Platform/android.pri
Normal file
7
Qt/Platform/android.pri
Normal file
@ -0,0 +1,7 @@
|
||||
DEFINES += ANDROID
|
||||
INCLUDEPATH += $$P/native/ext/libzip
|
||||
|
||||
equals(TARGET, PPSSPPQt) {
|
||||
# Packaging
|
||||
ANDROID_PACKAGE_SOURCE_DIR = $$P/android
|
||||
}
|
7
Qt/Platform/blackberry.pri
Normal file
7
Qt/Platform/blackberry.pri
Normal file
@ -0,0 +1,7 @@
|
||||
# Use a mkspec that allows g++
|
||||
DEFINES += BLACKBERRY "_QNX_SOURCE=1" "_C99=1"
|
||||
|
||||
equals(TARGET, PPSSPPQt) {
|
||||
# Executable
|
||||
LIBS += -lscreen -liconv
|
||||
}
|
1
Qt/Platform/ios.pri
Normal file
1
Qt/Platform/ios.pri
Normal file
@ -0,0 +1 @@
|
||||
DEFINES += IOS
|
11
Qt/Platform/linux.pri
Normal file
11
Qt/Platform/linux.pri
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
equals(TARGET, PPSSPPQt) {
|
||||
# Executable
|
||||
LIBS += -ldl -lrt
|
||||
|
||||
# Packaging
|
||||
icon.files = $$P/assets/icon-114.png
|
||||
icon.path = /usr/share/icons/hicolor/114x114/apps
|
||||
INSTALLS += icon
|
||||
}
|
6
Qt/Platform/macosx.pri
Normal file
6
Qt/Platform/macosx.pri
Normal file
@ -0,0 +1,6 @@
|
||||
QMAKE_MAC_SDK=macosx10.9
|
||||
|
||||
equals(TARGET, PPSSPPQt) {
|
||||
# Executable
|
||||
LIBS += -liconv
|
||||
}
|
14
Qt/Platform/maemo.pri
Normal file
14
Qt/Platform/maemo.pri
Normal file
@ -0,0 +1,14 @@
|
||||
DEFINES += MAEMO __GL_EXPORTS
|
||||
contains(MEEGO_EDITION,harmattan): DEFINES += "_SYS_UCONTEXT_H=1"
|
||||
|
||||
equals(TARGET, PPSSPPQt) {
|
||||
# Packaging
|
||||
target.path = /opt/PPSSPP/bin
|
||||
desktopfile.files = PPSSPP.desktop
|
||||
desktopfile.path = /usr/share/applications
|
||||
INSTALLS += target desktopfile
|
||||
# Booster
|
||||
QMAKE_CXXFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
QMAKE_LFLAGS += -pie -rdynamic
|
||||
CONFIG += qt-boostable
|
||||
}
|
21
Qt/Platform/symbian.pri
Normal file
21
Qt/Platform/symbian.pri
Normal file
@ -0,0 +1,21 @@
|
||||
INCLUDEPATH += $$EPOCROOT/epoc32/include/stdapis
|
||||
DEFINES += "BOOST_COMPILER_CONFIG=\"$$EPOCROOT/epoc32/include/stdapis/boost/mpl/aux_/config/gcc.hpp\"" SYMBIAN_OGLES_DLL_EXPORTS
|
||||
QMAKE_CXXFLAGS += -marm -Wno-parentheses -Wno-comment -Wno-unused-local-typedefs
|
||||
|
||||
contains(TARGET, PPSSPPQt) {
|
||||
# Executable
|
||||
LIBS += -lremconcoreapi -lremconinterfacebase
|
||||
|
||||
# Packaging
|
||||
TARGET.UID3 = 0xE0095B1D
|
||||
DEPLOYMENT.display_name = PPSSPP
|
||||
vendor_deploy.pkg_prerules = "%{\"Qtness\"}" ":\"Qtness\""
|
||||
ICON = $$P/assets/icon.svg
|
||||
|
||||
DEPLOYMENT += vendor_deploy
|
||||
MMP_RULES += "DEBUGGABLE"
|
||||
|
||||
# 268 MB maximum
|
||||
TARGET.EPOCHEAPSIZE = 0x40000 0x10000000
|
||||
TARGET.EPOCSTACKSIZE = 0x10000
|
||||
}
|
@ -1,7 +1,5 @@
|
||||
VERSION = 0.9.8
|
||||
DEFINES += USING_QT_UI USE_FFMPEG
|
||||
unix:!qnx:!symbian:!mac: CONFIG += linux
|
||||
maemo5|contains(MEEGO_EDITION,harmattan): CONFIG += maemo
|
||||
|
||||
# Global specific
|
||||
win32:CONFIG(release, debug|release): CONFIG_DIR = $$join(OUT_PWD,,,/release)
|
||||
@ -10,9 +8,28 @@ else:CONFIG_DIR=$$OUT_PWD
|
||||
OBJECTS_DIR = $$CONFIG_DIR/.obj/$$TARGET
|
||||
MOC_DIR = $$CONFIG_DIR/.moc/$$TARGET
|
||||
UI_DIR = $$CONFIG_DIR/.ui/$$TARGET
|
||||
QMAKE_CLEAN += -r $$MOC_DIR $$UI_DIR $$OBJECTS_DIR $$TARGET
|
||||
P = $$_PRO_FILE_PWD_/..
|
||||
INCLUDEPATH += $$P/ext/zlib $$P/Common
|
||||
|
||||
equals(TARGET, PPSSPPQt) {
|
||||
# PPSSPP Libs need to go first
|
||||
QMAKE_LIBDIR += $$CONFIG_DIR $$P/ffmpeg/$${PLATFORM_NAME}/$${PLATFORM_ARCH}/lib/
|
||||
equals(PLATFORM_NAME, "linux"):arm|android: LIBS += -lEGL
|
||||
symbian: LIBS += -lCore.lib -lGPU.lib -lCommon.lib -lNative.lib
|
||||
else: LIBS += -lCore -lGPU -lCommon -lNative
|
||||
|
||||
contains(DEFINES, USE_FFMPEG): LIBS += -lavformat -lavcodec -lavutil -lswresample -lswscale
|
||||
}
|
||||
|
||||
# Work out arch name
|
||||
include(Platform/ArchDetection.pri)
|
||||
# Work out platform name
|
||||
include(Platform/OSDetection.pri)
|
||||
# OS dependent paths
|
||||
INCLUDEPATH += $$P/ffmpeg/$${PLATFORM_NAME}/$${PLATFORM_ARCH}/include
|
||||
|
||||
# Work out the git version in a way that works on every QMake
|
||||
symbian {
|
||||
exists($$P/.git): GIT_VERSION = $$system(git describe --always)
|
||||
isEmpty(GIT_VERSION): GIT_VERSION = $$VERSION
|
||||
@ -23,6 +40,7 @@ symbian {
|
||||
}
|
||||
DEFINES += PPSSPP_GIT_VERSION=\"$$GIT_VERSION\"
|
||||
|
||||
# Optimisations
|
||||
win32-msvc* {
|
||||
DEFINES += _MBCS GLEW_STATIC _CRT_SECURE_NO_WARNINGS "_VARIADIC_MAX=10"
|
||||
contains(DEFINES, UNICODE): DEFINES += _UNICODE
|
||||
@ -36,83 +54,16 @@ win32-msvc* {
|
||||
QMAKE_CXXFLAGS_RELEASE ~= s/-O.*/
|
||||
QMAKE_ALLFLAGS_RELEASE += -O3 -ffast-math
|
||||
}
|
||||
# Arch specific
|
||||
|
||||
contains(QT_ARCH, ".*86.*")|contains(QMAKE_TARGET.arch, ".*86.*") {
|
||||
!win32-msvc*: QMAKE_ALLFLAGS += -msse2
|
||||
else: QMAKE_ALLFLAGS += /arch:SSE2
|
||||
} else { # Assume ARM
|
||||
DEFINES += ARM
|
||||
CONFIG += arm
|
||||
}
|
||||
arm:!symbian {
|
||||
CONFIG += armv7
|
||||
QMAKE_CFLAGS_RELEASE ~= s/-mfpu.*/
|
||||
QMAKE_CFLAGS_DEBUG ~= s/-mfpu.*/
|
||||
QMAKE_ALLFLAGS_DEBUG += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize
|
||||
QMAKE_ALLFLAGS_RELEASE += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize
|
||||
}
|
||||
|
||||
contains(QT_CONFIG, opengles.) {
|
||||
DEFINES += USING_GLES2
|
||||
# How else do we know if the environment prefers windows?
|
||||
!linux|android|maemo {
|
||||
!equals(PLATFORM_NAME, "linux")|android|maemo {
|
||||
DEFINES += MOBILE_DEVICE
|
||||
CONFIG += mobile_platform
|
||||
}
|
||||
}
|
||||
|
||||
# Platform specific
|
||||
contains(MEEGO_EDITION,harmattan): DEFINES += "_SYS_UCONTEXT_H=1"
|
||||
maemo: DEFINES += MAEMO
|
||||
|
||||
win32 {
|
||||
PRECOMPILED_HEADER = $$P/Windows/stdafx.h
|
||||
PRECOMPILED_SOURCE = $$P/Windows/stdafx.cpp
|
||||
INCLUDEPATH += $$P $$P/ffmpeg/Windows/$${QMAKE_TARGET.arch}/include
|
||||
}
|
||||
macx {
|
||||
QMAKE_MAC_SDK=macosx10.9
|
||||
INCLUDEPATH += $$P/ffmpeg/macosx/x86_64/include
|
||||
}
|
||||
ios {
|
||||
DEFINES += IOS
|
||||
INCLUDEPATH += $$P/ffmpeg/ios/universal/include
|
||||
}
|
||||
android {
|
||||
DEFINES += ANDROID
|
||||
INCLUDEPATH += $$P/ffmpeg/android/armv7/include $$P/native/ext/libzip
|
||||
}
|
||||
|
||||
linux:!android {
|
||||
arm: INCLUDEPATH += $$P/ffmpeg/linux/armv7/include
|
||||
else {
|
||||
contains(QT_ARCH, x86_64) QMAKE_TARGET.arch = x86_64
|
||||
else: QMAKE_TARGET.arch = x86
|
||||
INCLUDEPATH += $$P/ffmpeg/linux/$${QMAKE_TARGET.arch}/include
|
||||
}
|
||||
}
|
||||
# Fix 32-bit/64-bit defines
|
||||
!arm {
|
||||
contains(QMAKE_TARGET.arch, x86_64): DEFINES += _M_X64
|
||||
else: DEFINES += _M_IX86
|
||||
}
|
||||
|
||||
qnx {
|
||||
# Use mkspec: unsupported/qws/qnx-armv7-g++
|
||||
DEFINES += BLACKBERRY "_QNX_SOURCE=1" "_C99=1"
|
||||
INCLUDEPATH += $$P/ffmpeg/blackberry/armv7/include
|
||||
}
|
||||
symbian {
|
||||
DEFINES += "BOOST_COMPILER_CONFIG=\"$$EPOCROOT/epoc32/include/stdapis/boost/mpl/aux_/config/gcc.hpp\"" SYMBIAN_OGLES_DLL_EXPORTS
|
||||
QMAKE_CXXFLAGS += -marm -Wno-parentheses -Wno-comment -Wno-unused-local-typedefs
|
||||
INCLUDEPATH += $$EPOCROOT/epoc32/include/stdapis
|
||||
INCLUDEPATH += $$P/ffmpeg/symbian/armv6/include
|
||||
}
|
||||
maemo {
|
||||
DEFINES += __GL_EXPORTS
|
||||
}
|
||||
|
||||
# Handle flags for both C and C++
|
||||
QMAKE_CFLAGS += $$QMAKE_ALLFLAGS
|
||||
QMAKE_CXXFLAGS += $$QMAKE_ALLFLAGS
|
||||
|
Loading…
x
Reference in New Issue
Block a user