This commit is contained in:
OBattler
2022-02-12 01:01:30 +01:00
9 changed files with 44 additions and 26 deletions

9
.ci/Jenkinsfile vendored
View File

@@ -24,6 +24,11 @@ def osArchs = [
'Linux': ['x86', 'x86_64', 'arm32', 'arm64'] 'Linux': ['x86', 'x86_64', 'arm32', 'arm64']
] ]
def osFlags = [
'Windows': '',
'Linux': '-D QT=ON'
]
def archNames = [ def archNames = [
'32': 'x86 (32-bit)', '32': 'x86 (32-bit)',
'x86': 'x86 (32-bit)', 'x86': 'x86 (32-bit)',
@@ -144,7 +149,7 @@ pipeline {
parameters { parameters {
string(name: 'BUILD_TYPE', string(name: 'BUILD_TYPE',
defaultValue: 'beta', /* !!! CHANGE HERE !!! for build type */ defaultValue: 'beta', /* !!! CHANGE HERE !!! for build type */
description: "Build type to pass on to CMake. Don't change this, you should instead change the default value on .ci/Jenkinsfile") description: "Build type to pass on to CMake. Should only be changed for one-off builds, otherwise change the default on .ci/Jenkinsfile")
} }
stages { stages {
@@ -229,7 +234,7 @@ pipeline {
/* Run build process. */ /* Run build process. */
def packageName = "${env.JOB_BASE_NAME}${dynarecSlugs[dynarec]}${presetSlugs[preset]}-$os-$arch-b${env.BUILD_NUMBER}" def packageName = "${env.JOB_BASE_NAME}${dynarecSlugs[dynarec]}${presetSlugs[preset]}-$os-$arch-b${env.BUILD_NUMBER}"
dir("${dynarecNames[dynarec]}/$os - ${archNames[arch]}") { dir("${dynarecNames[dynarec]}/$os - ${archNames[arch]}") {
runBuild("-b \"$packageName\" \"$arch\" ${presetFlags[preset]} ${dynarecFlags[dynarec]} -D QT=ON -D \"BUILD_TYPE=$BUILD_TYPE\" -D \"EMU_BUILD=build ${env.BUILD_NUMBER}\" -D \"EMU_BUILD_NUM=${env.BUILD_NUMBER}\"") runBuild("-b \"$packageName\" \"$arch\" ${presetFlags[preset]} ${dynarecFlags[dynarec]} ${osFlags[os]} -D \"BUILD_TYPE=$BUILD_TYPE\" -D \"EMU_BUILD=build ${env.BUILD_NUMBER}\" -D \"EMU_BUILD_NUM=${env.BUILD_NUMBER}\"")
} }
/* Archive resulting artifacts. */ /* Archive resulting artifacts. */

View File

@@ -176,6 +176,15 @@ fi
echo [-] Building [$package_name] for [$arch] with flags [$cmake_flags] echo [-] Building [$package_name] for [$arch] with flags [$cmake_flags]
# Determine CMake toolchain file for this architecture.
case $arch in
32 | x86) toolchain="flags-gcc-i686";;
64 | x86_64) toolchain="flags-gcc-x86_64";;
ARM32 | arm32) toolchain="flags-gcc-armv7";;
ARM64 | arm64) toolchain="flags-gcc-aarch64";;
*) toolchain="flags-gcc-$arch";;
esac
# Perform platform-specific setup. # Perform platform-specific setup.
strip_binary=strip strip_binary=strip
if is_windows if is_windows
@@ -200,6 +209,9 @@ then
exit 2 exit 2
fi fi
echo [-] Using MSYSTEM [$MSYSTEM] echo [-] Using MSYSTEM [$MSYSTEM]
# Point CMake to the toolchain file.
cmake_flags_extra="$cmake_flags_extra -D \"CMAKE_TOOLCHAIN_FILE=cmake/$toolchain.cmake\""
elif is_mac elif is_mac
then then
# macOS lacks nproc, but sysctl can do the same job. # macOS lacks nproc, but sysctl can do the same job.
@@ -214,7 +226,7 @@ else
esac esac
# Establish general dependencies. # Establish general dependencies.
pkgs="cmake pkg-config git tar xz-utils dpkg-dev rpm wayland-protocols" pkgs="cmake pkg-config git tar xz-utils wayland-protocols"
if [ "$(dpkg --print-architecture)" = "$arch_deb" ] if [ "$(dpkg --print-architecture)" = "$arch_deb" ]
then then
pkgs="$pkgs build-essential" pkgs="$pkgs build-essential"
@@ -271,6 +283,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(ENV{PKG_CONFIG_PATH} "") set(ENV{PKG_CONFIG_PATH} "")
set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/$libdir/pkgconfig:/usr/share/$libdir/pkgconfig") set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/$libdir/pkgconfig:/usr/share/$libdir/pkgconfig")
include("$(pwd)/cmake/$toolchain.cmake")
EOF EOF
cmake_flags_extra="$cmake_flags_extra -D CMAKE_TOOLCHAIN_FILE=toolchain.cmake" cmake_flags_extra="$cmake_flags_extra -D CMAKE_TOOLCHAIN_FILE=toolchain.cmake"
strip_binary="$arch_gnu-strip" strip_binary="$arch_gnu-strip"
@@ -296,11 +310,11 @@ find . \( -name Makefile -o -name CMakeCache.txt -o -name CMakeFiles \) -exec rm
# Add ARCH to skip the arch_detect process. # Add ARCH to skip the arch_detect process.
case $arch in case $arch in
32 | x86) cmake_flags_extra="$cmake_flags_extra -D ARCH=i386";; 32 | x86) cmake_flags_extra="$cmake_flags_extra -D ARCH=i386";;
64 | x86_64) cmake_flags_extra="$cmake_flags_extra -D ARCH=x86_64";; 64 | x86_64) cmake_flags_extra="$cmake_flags_extra -D ARCH=x86_64";;
ARM32 | arm32) cmake_flags_extra="$cmake_flags_extra -D ARCH=arm";; ARM32 | arm32) cmake_flags_extra="$cmake_flags_extra -D ARCH=arm";;
ARM64 | arm64) cmake_flags_extra="$cmake_flags_extra -D ARCH=arm64";; ARM64 | arm64) cmake_flags_extra="$cmake_flags_extra -D ARCH=arm64";;
*) cmake_flags_extra="$cmake_flags_extra -D \"ARCH=$arch\"";; *) cmake_flags_extra="$cmake_flags_extra -D \"ARCH=$arch\"";;
esac esac
# Add git hash. # Add git hash.

View File

@@ -9,15 +9,7 @@
{ {
"name": "flags-base", "name": "flags-base",
"cacheVariables": { "cacheVariables": {
"CMAKE_CONFIGURATION_TYPES": "Debug;Release;Optimized", "CMAKE_CONFIGURATION_TYPES": "Debug;Release;Optimized"
"CMAKE_C_FLAGS": "-msse2 -mfpmath=sse -fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing",
"CMAKE_CXX_FLAGS": "-msse2 -mfpmath=sse -fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing",
"CMAKE_C_FLAGS_RELEASE": "-g0 -O3",
"CMAKE_CXX_FLAGS_RELEASE": "-g0 -O3",
"CMAKE_C_FLAGS_DEBUG": "-ggdb -Og",
"CMAKE_CXX_FLAGS_DEBUG": "-ggdb -Og",
"CMAKE_C_FLAGS_OPTIMIZED": "-march=native -mtune=native -O3 -ffp-contract=fast -flto",
"CMAKE_CXX_FLAGS_OPTIMIZED": "-march=native -mtune=native -O3 -ffp-contract=fast -flto"
}, },
"hidden": true, "hidden": true,
"binaryDir": "build" "binaryDir": "build"

View File

@@ -14,7 +14,7 @@
# Copyright 2021 David Hrdlička. # Copyright 2021 David Hrdlička.
# #
string(APPEND CMAKE_C_FLAGS_INIT " -march=armv8-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}") string(APPEND CMAKE_C_FLAGS_INIT " -march=armv8-a ${CMAKE_C_FLAGS_INIT}")
string(APPEND CMAKE_CXX_FLAGS_INIT " -march=armv8-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}") string(APPEND CMAKE_CXX_FLAGS_INIT " -march=armv8-a ${CMAKE_CXX_FLAGS_INIT}")
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)

View File

@@ -14,7 +14,7 @@
# Copyright 2021 David Hrdlička. # Copyright 2021 David Hrdlička.
# #
string(APPEND CMAKE_C_FLAGS_INIT " -m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}") string(APPEND CMAKE_C_FLAGS_INIT " -m32 -march=i686 -msse2 -mfpmath=sse -mstackrealign ${CMAKE_C_FLAGS_INIT}")
string(APPEND CMAKE_CXX_FLAGS_INIT " -m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS_INIT}") string(APPEND CMAKE_CXX_FLAGS_INIT " -m32 -march=i686 -msse2 -mfpmath=sse -mstackrealign ${CMAKE_CXX_FLAGS_INIT}")
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)

View File

@@ -14,7 +14,7 @@
# Copyright 2021 David Hrdlička. # Copyright 2021 David Hrdlička.
# #
string(APPEND CMAKE_C_FLAGS_INIT " -m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}") string(APPEND CMAKE_C_FLAGS_INIT " -m64 -march=x86-64 -msse2 -mfpmath=sse -mstackrealign ${CMAKE_C_FLAGS_INIT}")
string(APPEND CMAKE_CXX_FLAGS_INIT " -m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS_INIT}") string(APPEND CMAKE_CXX_FLAGS_INIT " -m64 -march=x86-64 -msse2 -mfpmath=sse -mstackrealign ${CMAKE_CXX_FLAGS_INIT}")
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)

View File

@@ -14,8 +14,8 @@
# #
# Define our flags # Define our flags
string(APPEND CMAKE_C_FLAGS_INIT " -fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing") string(APPEND CMAKE_C_FLAGS_INIT " -fomit-frame-pointer -Wall -fno-strict-aliasing")
string(APPEND CMAKE_CXX_FLAGS_INIT " -fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing") string(APPEND CMAKE_CXX_FLAGS_INIT " -fomit-frame-pointer -Wall -fno-strict-aliasing")
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -g0 -O3") string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -g0 -O3")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -g0 -O3") string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -g0 -O3")
string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -ggdb -Og") string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -ggdb -Og")

View File

@@ -1602,7 +1602,7 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv)
if (ide->type == IDE_ATAPI) if (ide->type == IDE_ATAPI)
ide->sc->status = DRDY_STAT; ide->sc->status = DRDY_STAT;
else else
ide->atastat = BSY_STAT; ide->atastat = READY_STAT | BSY_STAT;
if (ide->type == IDE_ATAPI) if (ide->type == IDE_ATAPI)
ide->sc->callback = 100.0 * IDE_TIME; ide->sc->callback = 100.0 * IDE_TIME;

View File

@@ -26,6 +26,8 @@
#include <QTranslator> #include <QTranslator>
#include <QDirIterator> #include <QDirIterator>
#include <QLibraryInfo> #include <QLibraryInfo>
#include <QString>
#include <QFont>
#ifdef QT_STATIC #ifdef QT_STATIC
/* Static builds need plugin imports */ /* Static builds need plugin imports */
@@ -139,6 +141,11 @@ int main(int argc, char* argv[]) {
#endif #endif
QApplication app(argc, argv); QApplication app(argc, argv);
QLocale::setDefault(QLocale::C); QLocale::setDefault(QLocale::C);
#ifdef Q_OS_WINDOWS
auto font_name = QObject::tr("FONT_NAME");
auto font_size = QObject::tr("FONT_SIZE");
QApplication::setFont(QFont(font_name, font_size.toInt()));
#endif
qt_set_sequence_auto_mnemonic(false); qt_set_sequence_auto_mnemonic(false);
Q_INIT_RESOURCE(qt_resources); Q_INIT_RESOURCE(qt_resources);
Q_INIT_RESOURCE(qt_translations); Q_INIT_RESOURCE(qt_translations);