remove logic for old ccache versions, 32bit, comments

This commit is contained in:
tooomm 2026-07-07 18:07:27 +02:00
parent 544906042a
commit d90e5263e0
10 changed files with 47 additions and 55 deletions

View file

@ -136,7 +136,7 @@ cd "$BUILD_DIR"
# Set minimum CMake Version # Set minimum CMake Version
export CMAKE_POLICY_VERSION_MINIMUM=3.10 export CMAKE_POLICY_VERSION_MINIMUM=3.10
# Add cmake flags # Add CMake flags
flags=("-DCMAKE_BUILD_TYPE=$BUILDTYPE") flags=("-DCMAKE_BUILD_TYPE=$BUILDTYPE")
if [[ $MAKE_SERVER ]]; then if [[ $MAKE_SERVER ]]; then
flags+=("-DWITH_SERVER=1") flags+=("-DWITH_SERVER=1")
@ -150,7 +150,7 @@ fi
if [[ $USE_CCACHE ]]; then if [[ $USE_CCACHE ]]; then
flags+=("-DUSE_CCACHE=1") flags+=("-DUSE_CCACHE=1")
if [[ $CCACHE_SIZE ]]; then if [[ $CCACHE_SIZE ]]; then
# note, this setting persists after running the script # This setting persists after running the script
ccache --max-size "$CCACHE_SIZE" ccache --max-size "$CCACHE_SIZE"
fi fi
fi fi
@ -161,17 +161,11 @@ if [[ $USE_VCPKG ]]; then
flags+=("-DUSE_VCPKG=1") flags+=("-DUSE_VCPKG=1")
fi fi
# Add cmake --build flags # Add CMake --build flags
buildflags=(--config "$BUILDTYPE") buildflags=(--config "$BUILDTYPE")
function ccachestatsverbose() { function ccachestatsverbose() {
# note, verbose only works on newer ccache, discard the error ccache --show-stats --verbose
local got
if got="$(ccache --show-stats --verbose 2>/dev/null)"; then
echo "$got"
else
ccache --show-stats
fi
} }
# Compile # Compile
@ -184,9 +178,9 @@ if [[ $RUNNER_OS == macOS ]]; then
echo "could not find QTDIR!" echo "could not find QTDIR!"
exit 2 exit 2
fi fi
# the qtdir is located at Qt/[qtversion]/macos # QTDIR is located at Qt/<QtVersion>/macos
# we use find to get the first subfolder with the name "macos" # We use find to get the first subfolder with the name "macos"
# this works independent of the qt version as there should be only one version installed on the runner at a time # This works independent of the Qt version as there should be only one version installed on the runner at a time
export QTDIR export QTDIR
# Add QTDIR to CMAKE_PREFIX_PATH so CMake can find Qt6 # Add QTDIR to CMAKE_PREFIX_PATH so CMake can find Qt6
export CMAKE_PREFIX_PATH="$QTDIR:$CMAKE_PREFIX_PATH" export CMAKE_PREFIX_PATH="$QTDIR:$CMAKE_PREFIX_PATH"
@ -237,7 +231,7 @@ if [[ $RUNNER_OS == macOS ]]; then
if [[ $MAKE_PACKAGE ]]; then if [[ $MAKE_PACKAGE ]]; then
# Workaround https://github.com/actions/runner-images/issues/7522 # Workaround https://github.com/actions/runner-images/issues/7522
# have hdiutil repeat the command 10 times in hope of success # Have hdiutil repeat the command 10 times in hope of success
hdiutil_script="/tmp/hdiutil.sh" hdiutil_script="/tmp/hdiutil.sh"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
echo '#!/bin/bash echo '#!/bin/bash

View file

@ -47,7 +47,7 @@ if(USE_CCACHE)
endif() endif()
endif() endif()
if(WIN32 OR USE_VCPKG) if(WIN32 OR USE_VCPKG) # Windows (including 64bit) or USE_VCPKG set
# Use vcpkg toolchain on Windows (and on macOS in CI) # Use vcpkg toolchain on Windows (and on macOS in CI)
set(CMAKE_TOOLCHAIN_FILE set(CMAKE_TOOLCHAIN_FILE
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake

View file

@ -1,16 +1,15 @@
# Find the MS Visual Studio VC redistributable package # Find the MS Visual Studio VC redistributable package
if(WIN32) if(WIN32) # Windows (including 64bit)
set(VCREDISTRUNTIME_FOUND "NO") set(VCREDISTRUNTIME_FOUND "NO")
if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64-bit if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64-bit
set(REDIST_ARCH x64) set(REDIST_ARCH x64)
else()
set(REDIST_ARCH x86)
endif() endif()
# VS 2017 uses vcredist_ARCH.exe, VS 2022 uses vc_redist.ARCH.exe # <VS 2017 uses vcredist_ARCH.exe
set(REDIST_FILE_NAMES vcredist_${REDIST_ARCH}.exe vcredist.${REDIST_ARCH}.exe vc_redist.${REDIST_ARCH}.exe) # >=VS 2017 uses vc_redist.ARCH.exe
set(REDIST_FILE_NAMES vcredist_${REDIST_ARCH}.exe vc_redist.${REDIST_ARCH}.exe)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include(InstallRequiredSystemLibraries) include(InstallRequiredSystemLibraries)

View file

@ -1,12 +1,12 @@
# CMakeLists for cockatrice directory # CMakeLists for cockatrice directory
# #
# provides the cockatrice binary # Provides the cockatrice binary
project(Cockatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") project(Cockatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(cockatrice_SOURCES set(cockatrice_SOURCES
${VERSION_STRING_CPP} ${VERSION_STRING_CPP}
# sort by alphabetical order, so that there is no debate about where to add new sources to the list # Sort by alphabetical order, so that there is no debate about where to add new sources to the list
src/client/network/connection_controller/remote_connection_controller.cpp src/client/network/connection_controller/remote_connection_controller.cpp
src/client/network/update/client/update_downloader.cpp src/client/network/update/client/update_downloader.cpp
src/client/network/interfaces/deck_stats_interface.cpp src/client/network/interfaces/deck_stats_interface.cpp
@ -387,7 +387,7 @@ else()
file(GLOB cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts") file(GLOB cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts")
endif() endif()
if(WIN32) if(WIN32) # Windows (including 64bit)
set(cockatrice_SOURCES ${cockatrice_SOURCES} cockatrice.rc) set(cockatrice_SOURCES ${cockatrice_SOURCES} cockatrice.rc)
endif(WIN32) endif(WIN32)
@ -455,7 +455,7 @@ if(UNIX)
install(TARGETS cockatrice BUNDLE DESTINATION ./) install(TARGETS cockatrice BUNDLE DESTINATION ./)
else() else()
# Assume linux # Assume Linux
install(TARGETS cockatrice RUNTIME DESTINATION bin/) install(TARGETS cockatrice RUNTIME DESTINATION bin/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.png DESTINATION ${ICONDIR}/hicolor/48x48/apps) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.png DESTINATION ${ICONDIR}/hicolor/48x48/apps)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps)
@ -466,7 +466,7 @@ elseif(WIN32)
endif() endif()
if(APPLE) if(APPLE)
# these needs to be relative to CMAKE_INSTALL_PREFIX # These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir cockatrice.app/Contents/Plugins) set(plugin_dest_dir cockatrice.app/Contents/Plugins)
set(qtconf_dest_dir cockatrice.app/Contents/Resources) set(qtconf_dest_dir cockatrice.app/Contents/Resources)
@ -515,8 +515,8 @@ Data = Resources\")
) )
endif() endif()
if(WIN32) if(WIN32) # Windows (including 64bit)
# these needs to be relative to CMAKE_INSTALL_PREFIX # These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir Plugins) set(plugin_dest_dir Plugins)
set(qtconf_dest_dir .) set(qtconf_dest_dir .)

View file

@ -1,6 +1,6 @@
# CMakeLists for sounds directory # CMakeLists for sounds directory
# #
# add sounds subfolders # Add sounds subfolders
set(defsounds Default Legacy) set(defsounds Default Legacy)
@ -8,9 +8,9 @@ if(UNIX)
if(APPLE) if(APPLE)
install(DIRECTORY ${defsounds} DESTINATION Cockatrice.app/Contents/Resources/sounds/) install(DIRECTORY ${defsounds} DESTINATION Cockatrice.app/Contents/Resources/sounds/)
else() else()
# Assume linux # Assume Linux
install(DIRECTORY ${defsounds} DESTINATION share/cockatrice/sounds/) install(DIRECTORY ${defsounds} DESTINATION share/cockatrice/sounds/)
endif() endif()
elseif(WIN32) elseif(WIN32) # Windows (including 64bit)
install(DIRECTORY ${defsounds} DESTINATION sounds/) install(DIRECTORY ${defsounds} DESTINATION sounds/)
endif() endif()

View file

@ -59,7 +59,8 @@ bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
char arch[255]; char arch[255];
size_t len = sizeof(arch); size_t len = sizeof(arch);
if (sysctlbyname("machdep.cpu.brand_string", arch, &len, nullptr, 0) == 0) { if (sysctlbyname("machdep.cpu.brand_string", arch, &len, nullptr, 0) == 0) {
// Intel Mac is only supported on macOS 13 versions // We only publish one Intel build, targeting macOS 13 currently
// Newer macOS versions on Intel Macs should continue using it
if (QString::fromUtf8(arch).contains("Intel")) { if (QString::fromUtf8(arch).contains("Intel")) {
return 13; return 13;
} }

View file

@ -13,9 +13,7 @@
#include <QTextStream> #include <QTextStream>
#include <QVector> #include <QVector>
#if defined(Q_PROCESSOR_X86_32) #if defined(Q_PROCESSOR_X86_64)
#define BUILD_ARCHITECTURE "32-bit"
#elif defined(Q_PROCESSOR_X86_64)
#define BUILD_ARCHITECTURE "64-bit" #define BUILD_ARCHITECTURE "64-bit"
#elif defined(Q_PROCESSOR_ARM) #elif defined(Q_PROCESSOR_ARM)
#define BUILD_ARCHITECTURE "ARM" #define BUILD_ARCHITECTURE "ARM"

View file

@ -1,6 +1,6 @@
# CMakeLists for themes directory # CMakeLists for themes directory
# #
# add themes subfolders # Add themes subfolders
set(defthemes Default Fabric Fusion Leather Plasma VelvetMarble) set(defthemes Default Fabric Fusion Leather Plasma VelvetMarble)
@ -8,9 +8,9 @@ if(UNIX)
if(APPLE) if(APPLE)
install(DIRECTORY ${defthemes} DESTINATION Cockatrice.app/Contents/Resources/themes/) install(DIRECTORY ${defthemes} DESTINATION Cockatrice.app/Contents/Resources/themes/)
else() else()
# Assume linux # Assume Linux
install(DIRECTORY ${defthemes} DESTINATION share/cockatrice/themes/) install(DIRECTORY ${defthemes} DESTINATION share/cockatrice/themes/)
endif() endif()
elseif(WIN32) elseif(WIN32) # Windows (including 64bit)
install(DIRECTORY ${defthemes} DESTINATION themes/) install(DIRECTORY ${defthemes} DESTINATION themes/)
endif() endif()

View file

@ -47,7 +47,7 @@ else()
file(GLOB oracle_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts") file(GLOB oracle_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts")
endif(UPDATE_TRANSLATIONS) endif(UPDATE_TRANSLATIONS)
if(WIN32) if(WIN32) # Windows (including 64bit)
set(oracle_SOURCES ${oracle_SOURCES} oracle.rc) set(oracle_SOURCES ${oracle_SOURCES} oracle.rc)
endif(WIN32) endif(WIN32)
@ -151,12 +151,12 @@ if(UNIX)
install(TARGETS oracle BUNDLE DESTINATION ./) install(TARGETS oracle BUNDLE DESTINATION ./)
else() else()
# Assume linux # Assume Linux
install(TARGETS oracle RUNTIME DESTINATION bin/) install(TARGETS oracle RUNTIME DESTINATION bin/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/oracle.png DESTINATION ${ICONDIR}/hicolor/48x48/apps) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/oracle.png DESTINATION ${ICONDIR}/hicolor/48x48/apps)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/oracle.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/oracle.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps)
endif() endif()
elseif(WIN32) elseif(WIN32) # Windows (including 64bit)
install(TARGETS oracle RUNTIME DESTINATION ./) install(TARGETS oracle RUNTIME DESTINATION ./)
endif() endif()
@ -168,7 +168,7 @@ endif(NOT WIN32 AND NOT APPLE)
# Qt plugin handling # Qt plugin handling
# ------------------------ # ------------------------
if(APPLE) if(APPLE)
# these needs to be relative to CMAKE_INSTALL_PREFIX # These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir oracle.app/Contents/Plugins) set(plugin_dest_dir oracle.app/Contents/Plugins)
set(qtconf_dest_dir oracle.app/Contents/Resources) set(qtconf_dest_dir oracle.app/Contents/Resources)
@ -207,8 +207,8 @@ Translations = Resources/translations\")
) )
endif() endif()
if(WIN32) if(WIN32) # Windows (including 64bit)
# these needs to be relative to CMAKE_INSTALL_PREFIX # These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir Plugins) set(plugin_dest_dir Plugins)
set(qtconf_dest_dir .) set(qtconf_dest_dir .)
list(APPEND libSearchDirs ${QT_LIBRARY_DIR}) list(APPEND libSearchDirs ${QT_LIBRARY_DIR})
@ -265,7 +265,7 @@ endif()
# Qt translations # Qt translations
# ------------------------ # ------------------------
if(Qt6_FOUND AND Qt6LinguistTools_FOUND) if(Qt6_FOUND AND Qt6LinguistTools_FOUND)
#Qt6 Translations happen after the executable is built up # Qt6 Translations happen after the executable is built up
if(UPDATE_TRANSLATIONS) if(UPDATE_TRANSLATIONS)
qt6_add_translations( qt6_add_translations(
oracle oracle
@ -286,7 +286,7 @@ if(Qt6_FOUND AND Qt6LinguistTools_FOUND)
else() else()
install(FILES ${oracle_QM} DESTINATION ${ORACLE_UNIX_QM_INSTALL_DIR}) install(FILES ${oracle_QM} DESTINATION ${ORACLE_UNIX_QM_INSTALL_DIR})
endif() endif()
elseif(WIN32) elseif(WIN32) # Windows (including 64bit)
install(FILES ${oracle_QM} DESTINATION ${ORACLE_WIN32_QM_INSTALL_DIR}) install(FILES ${oracle_QM} DESTINATION ${ORACLE_WIN32_QM_INSTALL_DIR})
endif() endif()
endif() endif()

View file

@ -1,6 +1,6 @@
# CMakeLists for servatrice directory # CMakeLists for servatrice directory
# #
# provides the servatrice binary # Provides the servatrice binary
project(Servatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") project(Servatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
@ -25,7 +25,7 @@ set(servatrice_SOURCES
set(servatrice_RESOURCES servatrice.qrc) set(servatrice_RESOURCES servatrice.qrc)
if(WIN32) if(WIN32) # Windows (including 64bit)
set(servatrice_SOURCES ${servatrice_SOURCES} servatrice.rc) set(servatrice_SOURCES ${servatrice_SOURCES} servatrice.rc)
endif(WIN32) endif(WIN32)
@ -49,14 +49,14 @@ endif()
set(QT_DONT_USE_QTGUI TRUE) set(QT_DONT_USE_QTGUI TRUE)
# Mysql connector # MySQL connector
if(UNIX) if(UNIX)
if(APPLE) if(APPLE)
set(MYSQLCLIENT_DEFAULT_PATHS "/usr/local/lib" "/opt/local/lib/mysql55/mysql/" "/opt/local/lib/mysql56/mysql/") set(MYSQLCLIENT_DEFAULT_PATHS "/usr/local/lib" "/opt/local/lib/mysql55/mysql/" "/opt/local/lib/mysql56/mysql/")
else() else()
set(MYSQLCLIENT_DEFAULT_PATHS "/usr/lib64" "/usr/local/lib64" "/usr/lib" "/usr/local/lib") set(MYSQLCLIENT_DEFAULT_PATHS "/usr/lib64" "/usr/local/lib64" "/usr/lib" "/usr/local/lib")
endif() endif()
elseif(WIN32) elseif(WIN32) # Windows (including 64bit)
set(MYSQLCLIENT_DEFAULT_PATHS "C:\\Program Files\\MySQL\\MySQL Server 5.7\\lib" set(MYSQLCLIENT_DEFAULT_PATHS "C:\\Program Files\\MySQL\\MySQL Server 5.7\\lib"
"C:\\Program Files (x86)\\MySQL\\MySQL Server 5.7\\lib" "C:\\Program Files (x86)\\MySQL\\MySQL Server 5.7\\lib"
) )
@ -108,7 +108,7 @@ else()
) )
endif() endif()
# install rules # Install rules
if(UNIX) if(UNIX)
if(APPLE) if(APPLE)
set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}") set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}")
@ -122,7 +122,7 @@ if(UNIX)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION ./servatrice.app/Contents/Resources/) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION ./servatrice.app/Contents/Resources/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION ./servatrice.app/Contents/Resources/) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION ./servatrice.app/Contents/Resources/)
else() else()
# Assume linux # Assume Linux
install(TARGETS servatrice RUNTIME DESTINATION bin/) install(TARGETS servatrice RUNTIME DESTINATION bin/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION share/servatrice/) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION share/servatrice/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION share/servatrice/) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION share/servatrice/)
@ -131,14 +131,14 @@ if(UNIX)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/servatrice.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/servatrice.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.desktop DESTINATION ${DESKTOPDIR}) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.desktop DESTINATION ${DESKTOPDIR})
endif() endif()
elseif(WIN32) elseif(WIN32) # Windows (including 64bit)
install(TARGETS servatrice RUNTIME DESTINATION ./) install(TARGETS servatrice RUNTIME DESTINATION ./)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION ./) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION ./)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION ./) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION ./)
endif() endif()
if(APPLE) if(APPLE)
# these needs to be relative to CMAKE_INSTALL_PREFIX # These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir servatrice.app/Contents/Plugins) set(plugin_dest_dir servatrice.app/Contents/Plugins)
set(qtconf_dest_dir servatrice.app/Contents/Resources) set(qtconf_dest_dir servatrice.app/Contents/Resources)
@ -176,8 +176,8 @@ Translations = Resources/translations\")
) )
endif() endif()
if(WIN32) if(WIN32) # Windows (including 64bit)
# these needs to be relative to CMAKE_INSTALL_PREFIX # These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir Plugins) set(plugin_dest_dir Plugins)
set(qtconf_dest_dir .) set(qtconf_dest_dir .)