Update Qt to 6.8.3 and fixes dark mode being forced automatically even when light theme is set in app settings

This commit is contained in:
MaranBr 2025-05-13 14:44:29 -04:00
parent daab352512
commit 8254a0e0de
4 changed files with 27 additions and 20 deletions

View file

@ -399,7 +399,7 @@ add_subdirectory(externals)
if (ENABLE_QT) if (ENABLE_QT)
if (NOT USE_SYSTEM_QT) if (NOT USE_SYSTEM_QT)
download_qt(6.7.3) download_qt(6.8.3)
endif() endif()
find_package(Qt6 REQUIRED COMPONENTS Widgets Multimedia Concurrent) find_package(Qt6 REQUIRED COMPONENTS Widgets Multimedia Concurrent)

View file

@ -16,7 +16,7 @@ function(copy_yuzu_Qt6_deps target_dir)
set(PLATFORMS ${DLL_DEST}plugins/platforms/) set(PLATFORMS ${DLL_DEST}plugins/platforms/)
set(STYLES ${DLL_DEST}plugins/styles/) set(STYLES ${DLL_DEST}plugins/styles/)
set(IMAGEFORMATS ${DLL_DEST}plugins/imageformats/) set(IMAGEFORMATS ${DLL_DEST}plugins/imageformats/)
set(RESOURCES ${DLL_DEST}resources/)
if (MSVC) if (MSVC)
windows_copy_files(${target_dir} ${Qt6_DLL_DIR} ${DLL_DEST} windows_copy_files(${target_dir} ${Qt6_DLL_DIR} ${DLL_DEST}
Qt6Core$<$<CONFIG:Debug>:d>.* Qt6Core$<$<CONFIG:Debug>:d>.*
@ -31,20 +31,31 @@ function(copy_yuzu_Qt6_deps target_dir)
endif() endif()
if (YUZU_USE_QT_WEB_ENGINE) if (YUZU_USE_QT_WEB_ENGINE)
windows_copy_files(${target_dir} ${Qt6_DLL_DIR} ${DLL_DEST} windows_copy_files(${target_dir} ${Qt6_DLL_DIR} ${DLL_DEST}
Qt6OpenGL$<$<CONFIG:Debug>:d>.*
Qt6Positioning$<$<CONFIG:Debug>:d>.*
Qt6PrintSupport$<$<CONFIG:Debug>:d>.*
Qt6Qml$<$<CONFIG:Debug>:d>.*
Qt6QmlMeta$<$<CONFIG:Debug>:d>.*
Qt6QmlModels$<$<CONFIG:Debug>:d>.*
Qt6QmlWorkerScript$<$<CONFIG:Debug>:d>.*
Qt6Quick$<$<CONFIG:Debug>:d>.*
Qt6QuickWidgets$<$<CONFIG:Debug>:d>.*
Qt6WebChannel$<$<CONFIG:Debug>:d>.*
Qt6WebEngineCore$<$<CONFIG:Debug>:d>.* Qt6WebEngineCore$<$<CONFIG:Debug>:d>.*
Qt6WebEngineWidgets$<$<CONFIG:Debug>:d>.* Qt6WebEngineWidgets$<$<CONFIG:Debug>:d>.*
QtWebEngineProcess$<$<CONFIG:Debug>:d>.* QtWebEngineProcess$<$<CONFIG:Debug>:d>.*
) )
windows_copy_files(${target_dir} ${Qt6_RESOURCES_DIR} ${DLL_DEST} windows_copy_files(${target_dir} ${Qt6_RESOURCES_DIR} ${RESOURCES}
icudtl.dat icudtl.dat
qtwebengine_devtools_resources.pak qtwebengine_devtools_resources.pak
qtwebengine_resources.pak qtwebengine_resources.pak
qtwebengine_resources_100p.pak qtwebengine_resources_100p.pak
qtwebengine_resources_200p.pak qtwebengine_resources_200p.pak
v8_context_snapshot.bin
) )
endif() endif()
windows_copy_files(yuzu ${Qt6_PLATFORMS_DIR} ${PLATFORMS} qwindows$<$<CONFIG:Debug>:d>.*) windows_copy_files(yuzu ${Qt6_PLATFORMS_DIR} ${PLATFORMS} qwindows$<$<CONFIG:Debug>:d>.*)
windows_copy_files(yuzu ${Qt6_STYLES_DIR} ${STYLES} qwindowsvistastyle$<$<CONFIG:Debug>:d>.*) windows_copy_files(yuzu ${Qt6_STYLES_DIR} ${STYLES} qmodernwindowsstyle$<$<CONFIG:Debug>:d>.*)
windows_copy_files(yuzu ${Qt6_IMAGEFORMATS_DIR} ${IMAGEFORMATS} windows_copy_files(yuzu ${Qt6_IMAGEFORMATS_DIR} ${IMAGEFORMATS}
qjpeg$<$<CONFIG:Debug>:d>.* qjpeg$<$<CONFIG:Debug>:d>.*
qgif$<$<CONFIG:Debug>:d>.* qgif$<$<CONFIG:Debug>:d>.*
@ -52,9 +63,6 @@ function(copy_yuzu_Qt6_deps target_dir)
else() else()
# Update for non-MSVC platforms if needed # Update for non-MSVC platforms if needed
endif() endif()
# Fixes dark mode being forced automatically even when light theme is set in app settings.
# Create an empty qt.conf file file(WRITE "${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/qt.conf" "[Platforms]\nWindowsArguments = darkmode=0")
add_custom_command(TARGET yuzu POST_BUILD
COMMAND ${CMAKE_COMMAND} -E touch ${DLL_DEST}qt.conf
)
endfunction(copy_yuzu_Qt6_deps) endfunction(copy_yuzu_Qt6_deps)

View file

@ -68,18 +68,18 @@ function(determine_qt_parameters target host_out type_out arch_out arch_path_out
set(arch_path "mingw_64") set(arch_path "mingw_64")
elseif (MSVC) elseif (MSVC)
if ("arm64" IN_LIST ARCHITECTURE) if ("arm64" IN_LIST ARCHITECTURE)
set(arch_path "msvc2019_arm64") set(arch_path "msvc2022_arm64")
elseif ("x86_64" IN_LIST ARCHITECTURE) elseif ("x86_64" IN_LIST ARCHITECTURE)
set(arch_path "msvc2019_64") set(arch_path "msvc2022_64")
else() else()
message(FATAL_ERROR "Unsupported bundled Qt architecture. Enable USE_SYSTEM_QT and provide your own.") message(FATAL_ERROR "Unsupported bundled Qt architecture. Enable USE_SYSTEM_QT and provide your own.")
endif() endif()
set(arch "win64_${arch_path}") set(arch "win64_${arch_path}")
if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64") if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64")
set(host_arch_path "msvc2019_64") set(host_arch_path "msvc2022_64")
elseif (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "ARM64") elseif (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "ARM64")
set(host_arch_path "msvc2019_64") set(host_arch_path "msvc2022_arm64")
endif() endif()
set(host_arch "win64_${host_arch_path}") set(host_arch "win64_${host_arch_path}")
else() else()
@ -133,13 +133,12 @@ function(download_qt_configuration prefix_out target host type arch arch_path ba
set(install_args ${install_args} install-tool --outputdir ${base_path} ${host} desktop ${target}) set(install_args ${install_args} install-tool --outputdir ${base_path} ${host} desktop ${target})
else() else()
set(prefix "${base_path}/${target}/${arch_path}") set(prefix "${base_path}/${target}/${arch_path}")
set(install_args ${install_args} install-qt --outputdir ${base_path} ${host} ${type} ${target} ${arch} set(install_args ${install_args} install-qt --outputdir ${base_path} ${host} ${type} ${target} ${arch} -m qt3d qt5compat qtactiveqt qtcharts qtconnectivity qtdatavis3d qtgraphs qtgrpc qthttpserver qtimageformats qtlanguageserver qtlocation qtlottie qtmultimedia qtnetworkauth qtpdf qtpositioning qtquick3d qtquick3dphysics qtquickeffectmaker qtquicktimeline qtremoteobjects qtscxml qtsensors qtserialbus qtserialport qtshadertools qtspeech qtvirtualkeyboard qtwebchannel qtwebengine qtwebsockets qtwebview)
-m qtmultimedia --archives qttranslations qttools qtsvg qtbase)
endif() endif()
if (NOT EXISTS "${prefix}") if (NOT EXISTS "${prefix}")
message(STATUS "Downloading Qt binaries for ${target}:${host}:${type}:${arch}:${arch_path}") message(STATUS "Downloading Qt binaries for ${target}:${host}:${type}:${arch}:${arch_path}")
set(AQT_PREBUILD_BASE_URL "https://github.com/miurahr/aqtinstall/releases/download/v3.1.18") set(AQT_PREBUILD_BASE_URL "https://github.com/miurahr/aqtinstall/releases/download/v3.2.1")
if (WIN32) if (WIN32)
set(aqt_path "${base_path}/aqt.exe") set(aqt_path "${base_path}/aqt.exe")
if (NOT EXISTS "${aqt_path}") if (NOT EXISTS "${aqt_path}")

View file

@ -450,12 +450,12 @@ if(UNIX AND NOT APPLE)
install(TARGETS yuzu) install(TARGETS yuzu)
endif() endif()
if (WIN32 AND QT_VERSION VERSION_GREATER_EQUAL 6) if (WIN32 AND USE_SYSTEM_QT AND QT_VERSION VERSION_GREATER_EQUAL 6)
set(YUZU_EXE_DIR "$<TARGET_FILE_DIR:yuzu>") set(YUZU_EXE_DIR "$<TARGET_FILE_DIR:yuzu>")
add_custom_command(TARGET yuzu POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} "${YUZU_EXE_DIR}/yuzu.exe" --dir "${YUZU_EXE_DIR}" --libdir "${YUZU_EXE_DIR}" --plugindir "${YUZU_EXE_DIR}/plugins" --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler --no-translations --verbose 0) add_custom_command(TARGET yuzu POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} "${YUZU_EXE_DIR}/eden.exe" --dir "${YUZU_EXE_DIR}" --libdir "${YUZU_EXE_DIR}" --plugindir "${YUZU_EXE_DIR}/plugins" --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler --no-translations --verbose 0)
endif() endif()
if (YUZU_USE_BUNDLED_QT) if (NOT USE_SYSTEM_QT)
include(CopyYuzuQt6Deps) include(CopyYuzuQt6Deps)
copy_yuzu_Qt6_deps(yuzu) copy_yuzu_Qt6_deps(yuzu)
endif() endif()