mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
Qt: Detect version in qmake instead.
This commit is contained in:
parent
e5e23f3ce1
commit
f6cc234393
@ -22,7 +22,9 @@
|
||||
|
||||
#include "CommonTypes.h"
|
||||
|
||||
#if !defined(USING_QT_UI)
|
||||
extern const char *PPSSPP_GIT_VERSION;
|
||||
#endif
|
||||
|
||||
const int MAX_CONFIG_VOLUME = 8;
|
||||
|
||||
|
@ -6,15 +6,6 @@ CONFIG += staticlib
|
||||
|
||||
include(Settings.pri)
|
||||
|
||||
version.target = $$P/git-version.cpp
|
||||
!contains(MEEGO_EDITION,harmattan):contains(QMAKE_HOST.os, "Windows") { version.commands = $$P/Windows/git-version-gen.cmd }
|
||||
else { version.commands = $$P/Qt/git-version-gen.sh $$P }
|
||||
version.depends = $$P/.git
|
||||
|
||||
QMAKE_EXTRA_TARGETS += version
|
||||
PRE_TARGETDEPS += $$P/git-version.cpp
|
||||
SOURCES += $$P/git-version.cpp
|
||||
|
||||
INCLUDEPATH += $$P/native $$P/Core/MIPS $$P/ $$P/ext/xbrz
|
||||
|
||||
arm {
|
||||
|
@ -1,5 +1,4 @@
|
||||
TARGET = PPSSPPQt
|
||||
VERSION = 0.9.5
|
||||
|
||||
# Main Qt modules
|
||||
QT += core gui opengl
|
||||
|
@ -1,5 +1,6 @@
|
||||
VERSION = 0.9.5
|
||||
DEFINES += USING_QT_UI USE_FFMPEG
|
||||
unix:!qnx:!symbian:!macx: CONFIG += linux
|
||||
unix:!qnx:!symbian:!mac: CONFIG += linux
|
||||
|
||||
# Global specific
|
||||
win32:CONFIG(release, debug|release): CONFIG_DIR = $$join(OUT_PWD,,,/release)
|
||||
@ -11,6 +12,10 @@ UI_DIR = $$CONFIG_DIR/.ui/$$TARGET
|
||||
P = $$_PRO_FILE_PWD_/..
|
||||
INCLUDEPATH += $$P/ext/zlib $$P/native/ext/glew $$P/Common
|
||||
|
||||
exists($$P/.git): GIT_VERSION = $$system(git describe --always)
|
||||
!isEmpty(GIT_VERSION): VERSION = $$GIT_VERSION
|
||||
DEFINES += PPSSPP_GIT_VERSION=\\\"$$VERSION\\\"
|
||||
|
||||
win32-msvc* {
|
||||
QMAKE_CXXFLAGS_RELEASE += /O2 /arch:SSE2 /fp:fast
|
||||
DEFINES += _MBCS GLEW_STATIC _CRT_SECURE_NO_WARNINGS
|
||||
|
@ -1,52 +0,0 @@
|
||||
#!/bin/bash
|
||||
## Copyright (c) 2012- PPSSPP Project.
|
||||
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation, version 2.0 or later versions.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License 2.0 for more details.
|
||||
|
||||
## A copy of the GPL 2.0 should have been included with the program.
|
||||
## If not, see http://www.gnu.org/licenses/
|
||||
|
||||
## Official git repository and contact information can be found at
|
||||
## https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
GIT_VERSION_FILE=$1/git-version.cpp
|
||||
|
||||
if [ -e "$GIT_VERSION_FILE" ]; then
|
||||
# Skip updating the file if PPSSPP_GIT_VERSION_NO_UPDATE is 1.
|
||||
results=$(grep '^#define PPSSPP_GIT_VERSION_NO_UPDATE 1' "$GIT_VERSION_FILE")
|
||||
if [ "$results" != "" ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
GIT_VERSION=$(git describe --always)
|
||||
if [ "$GIT_VERSION" == "" ]; then
|
||||
echo "Unable to update git-version.cpp, git not on path." 1>&2
|
||||
|
||||
echo "// This is a generated file." > "$GIT_VERSION_FILE"
|
||||
echo >> "$GIT_VERSION_FILE"
|
||||
echo 'const char *PPSSPP_GIT_VERSION = "unknown";' >> "$GIT_VERSION_FILE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Don't modify the file if it already has the current version.
|
||||
if [ -e "$GIT_VERSION_FILE" ]; then
|
||||
results=$(grep "$GIT_VERSION" "$GIT_VERSION_FILE")
|
||||
if [ "$results" != "" ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "// This is a generated file." > "$GIT_VERSION_FILE"
|
||||
echo >> "$GIT_VERSION_FILE"
|
||||
echo 'const char *PPSSPP_GIT_VERSION = "'"$GIT_VERSION"'";' >> "$GIT_VERSION_FILE"
|
||||
echo >> "$GIT_VERSION_FILE"
|
||||
echo "// If you don't want this file to update/recompile, change to 1." >> "$GIT_VERSION_FILE"
|
||||
echo "#define PPSSPP_GIT_VERSION_NO_UPDATE 0" >> "$GIT_VERSION_FILE"
|
Loading…
Reference in New Issue
Block a user