diff --git a/CMakeLists.txt b/CMakeLists.txt index ea0bbe2423..88c92776d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,10 +146,19 @@ cmake_dependent_option(YUZU_USE_EXTERNAL_SDL2 "Build SDL2 from external source" cmake_dependent_option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 build" "${MSVC}" "ENABLE_SDL2" OFF) # qt stuff -option(ENABLE_QT "Enable the Qt frontend" ON) +option(ENABLE_QT "Enable the Qt frontends" ON) +cmake_dependent_option(ENABLE_QT_QML "Enable the experimental Qt Quick frontend" OFF "ENABLE_QT" OFF) +cmake_dependent_option(ENABLE_QT_WIDGETS "Enable the stable Qt Widgets frontend" ON "ENABLE_QT" OFF) + +if (ENABLE_QT AND NOT ENABLE_QT_QML AND NOT ENABLE_QT_WIDGETS) + message(FATAL_ERROR "ENABLE_QT specified without a valid frontend") +endif() + option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF) option(ENABLE_UPDATE_CHECKER "Enable update checker (for Qt and Android)" OFF) + cmake_dependent_option(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF) + option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF) option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF) set(YUZU_QT_MIRROR "" CACHE STRING "What mirror to use for downloading the bundled Qt libraries") @@ -562,7 +571,7 @@ find_package(VulkanUtilityLibraries) find_package(SimpleIni) find_package(SPIRV-Tools) find_package(sirit) -find_package(gamemode) +find_package(gamemode) if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) find_package(xbyak) @@ -608,24 +617,35 @@ if (ENABLE_QT) list(APPEND CMAKE_PREFIX_PATH "${Qt6_DIR}") endif() - find_package(Qt6 REQUIRED COMPONENTS Widgets Concurrent) + # Best practice is to ask for all components at once, so they are from the same version + set(YUZU_QT_COMPONENTS Core Widgets Concurrent) + + if (PLATFORM_LINUX) + list(APPEND YUZU_QT_COMPONENTS DBus) + set(YUZU_OPTIONAL_QT GuiPrivate) + endif() + + if (ENABLE_QT_QML) + list(APPEND YUZU_QT_COMPONENTS Quick QuickControls2) + endif() if (YUZU_USE_QT_MULTIMEDIA) - find_package(Qt6 REQUIRED COMPONENTS Multimedia) + list(APPEND YUZU_QT_COMPONENTS Multimedia) endif() - if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - # yes Qt, we get it - set(QT_NO_PRIVATE_MODULE_WARNING ON) - find_package(Qt6 REQUIRED COMPONENTS DBus OPTIONAL_COMPONENTS GuiPrivate) - elseif (UNIX AND NOT APPLE) - find_package(Qt6 REQUIRED COMPONENTS DBus Gui) + if (YUZU_USE_QT_WEB_ENGINE) + list(APPEND YUZU_QT_COMPONENTS WebEngineCore WebEngineWidgets) endif() if (ENABLE_QT_TRANSLATION) - find_package(Qt6 REQUIRED COMPONENTS LinguistTools) + list(APPEND YUZU_QT_COMPONENTS LinguistTools) endif() + find_package(Qt6 REQUIRED COMPONENTS ${YUZU_QT_COMPONENTS} OPTIONAL_COMPONENTS ${YUZU_OPTIONAL_QT}) + set(QT_MAJOR_VERSION 6) + # Qt6 sets cxx_std_17 and we need to undo that + set_target_properties(Qt6::Platform PROPERTIES INTERFACE_COMPILE_FEATURES "") + if (NOT DEFINED QT_TARGET_PATH) get_target_property(qtcore_path Qt6::Core LOCATION_Release) string(FIND "${qtcore_path}" "/bin/" qtcore_path_bin_pos REVERSE) @@ -645,30 +665,9 @@ if (ENABLE_QT) message(STATUS "Using host Qt at ${QT_HOST_PATH}") endif() -function(set_yuzu_qt_components) - # Best practice is to ask for all components at once, so they are from the same version - set(YUZU_QT_COMPONENTS2 Core Widgets Concurrent) - if (PLATFORM_LINUX) - list(APPEND YUZU_QT_COMPONENTS2 DBus) - endif() - if (YUZU_USE_QT_MULTIMEDIA) - list(APPEND YUZU_QT_COMPONENTS2 Multimedia) - endif() - if (YUZU_USE_QT_WEB_ENGINE) - list(APPEND YUZU_QT_COMPONENTS2 WebEngineCore WebEngineWidgets) - endif() - if (ENABLE_QT_TRANSLATION) - list(APPEND YUZU_QT_COMPONENTS2 LinguistTools) - endif() - set(YUZU_QT_COMPONENTS ${YUZU_QT_COMPONENTS2} PARENT_SCOPE) -endfunction(set_yuzu_qt_components) - -if(ENABLE_QT) - set_yuzu_qt_components() - find_package(Qt6 REQUIRED COMPONENTS ${YUZU_QT_COMPONENTS}) - set(QT_MAJOR_VERSION 6) - # Qt6 sets cxx_std_17 and we need to undo that - set_target_properties(Qt6::Platform PROPERTIES INTERFACE_COMPILE_FEATURES "") +if (UNIX AND NOT APPLE AND NOT ANDROID) + find_package(PkgConfig REQUIRED) + pkg_check_modules(LIBVA libva) endif() if (NOT (YUZU_USE_BUNDLED_FFMPEG OR YUZU_USE_EXTERNAL_FFMPEG)) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 63c80ffd2b..3baf878918 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -171,7 +171,7 @@ else() # glibc, which may default to 32 bits. glibc allows this to be configured # by setting _FILE_OFFSET_BITS. if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR MINGW) - add_definitions(-D_FILE_OFFSET_BITS=64) + add_compile_definitions(_FILE_OFFSET_BITS=64) endif() if (YUZU_STATIC_BUILD) @@ -238,7 +238,12 @@ endif() if (ENABLE_QT) add_subdirectory(qt_common) +endif() + +if (ENABLE_QT_QML) add_subdirectory(Eden) +elseif(ENABLE_QT_WIDGETS) + add_subdirectory(yuzu) endif() if (ENABLE_WEB_SERVICE) @@ -249,3 +254,5 @@ if (ANDROID) add_subdirectory(android/app/src/main/jni) target_include_directories(yuzu-android PRIVATE android/app/src/main) endif() + +include(GenerateDepHashes) diff --git a/src/Eden/CMakeLists.txt b/src/Eden/CMakeLists.txt index d70bcdb90f..18a6cc7e09 100644 --- a/src/Eden/CMakeLists.txt +++ b/src/Eden/CMakeLists.txt @@ -2,14 +2,10 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) -find_package(Qt6 REQUIRED COMPONENTS Widgets Core Gui Quick QuickControls2) - -qt_standard_project_setup(REQUIRES 6.7) +qt_standard_project_setup(REQUIRES 6.4) include(EdenModule) -include_directories(AFTER "${CMAKE_CURRENT_SOURCE_DIR}") - add_subdirectory(Interface) add_subdirectory(Models) diff --git a/src/Eden/Interface/MetaObjectHelper.h b/src/Eden/Interface/MetaObjectHelper.h index 922e1cbb47..375e5d211a 100644 --- a/src/Eden/Interface/MetaObjectHelper.h +++ b/src/Eden/Interface/MetaObjectHelper.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #ifndef METAOBJECTHELPER_H #define METAOBJECTHELPER_H diff --git a/src/Eden/Interface/QMLConfig.h b/src/Eden/Interface/QMLConfig.h index 540ce3d744..3e76889558 100644 --- a/src/Eden/Interface/QMLConfig.h +++ b/src/Eden/Interface/QMLConfig.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #ifndef QMLCONFIG_H #define QMLCONFIG_H diff --git a/src/Eden/Interface/QMLSetting.cpp b/src/Eden/Interface/QMLSetting.cpp index 36bf8c0ffe..ab4375b522 100644 --- a/src/Eden/Interface/QMLSetting.cpp +++ b/src/Eden/Interface/QMLSetting.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include "QMLSetting.h" #include "common/settings.h" diff --git a/src/Eden/Interface/QMLSetting.h b/src/Eden/Interface/QMLSetting.h index 2dbca2b2d8..e29c01a28b 100644 --- a/src/Eden/Interface/QMLSetting.h +++ b/src/Eden/Interface/QMLSetting.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #ifndef QMLSETTING_H #define QMLSETTING_H diff --git a/src/Eden/Interface/SettingsInterface.cpp b/src/Eden/Interface/SettingsInterface.cpp index a545a93b92..609e3ee662 100644 --- a/src/Eden/Interface/SettingsInterface.cpp +++ b/src/Eden/Interface/SettingsInterface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include "SettingsInterface.h" #include "common/settings.h" #include "common/logging/log.h" diff --git a/src/Eden/Interface/SettingsInterface.h b/src/Eden/Interface/SettingsInterface.h index 5e08d3c55e..3545c80e79 100644 --- a/src/Eden/Interface/SettingsInterface.h +++ b/src/Eden/Interface/SettingsInterface.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #ifndef SETTINGSINTERFACE_H #define SETTINGSINTERFACE_H diff --git a/src/Eden/Interface/TitleManager.cpp b/src/Eden/Interface/TitleManager.cpp index 0a3b6eca53..c4cb8f1682 100644 --- a/src/Eden/Interface/TitleManager.cpp +++ b/src/Eden/Interface/TitleManager.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include "TitleManager.h" #include "common/scm_rev.h" #include diff --git a/src/Eden/Interface/TitleManager.h b/src/Eden/Interface/TitleManager.h index 41f0eba331..c24457d6bd 100644 --- a/src/Eden/Interface/TitleManager.h +++ b/src/Eden/Interface/TitleManager.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #ifndef TITLEMANAGER_H #define TITLEMANAGER_H diff --git a/src/Eden/Models/GameIconProvider.cpp b/src/Eden/Models/GameIconProvider.cpp index e7fc279260..0832551575 100644 --- a/src/Eden/Models/GameIconProvider.cpp +++ b/src/Eden/Models/GameIconProvider.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include #include "GameIconProvider.h" #include "qt_common/config/uisettings.h" diff --git a/src/Eden/Models/GameIconProvider.h b/src/Eden/Models/GameIconProvider.h index 10dbcc948d..651fcd3438 100644 --- a/src/Eden/Models/GameIconProvider.h +++ b/src/Eden/Models/GameIconProvider.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #pragma once #include diff --git a/src/Eden/Models/GameListModel.cpp b/src/Eden/Models/GameListModel.cpp index 522400ded2..ba6d7b87f8 100644 --- a/src/Eden/Models/GameListModel.cpp +++ b/src/Eden/Models/GameListModel.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include "GameListModel.h" #include diff --git a/src/Eden/Models/GameListModel.h b/src/Eden/Models/GameListModel.h index ed1706ed1e..219fac124c 100644 --- a/src/Eden/Models/GameListModel.h +++ b/src/Eden/Models/GameListModel.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #ifndef GAMELISTMODEL_H #define GAMELISTMODEL_H diff --git a/src/Eden/Models/SettingsModel.cpp b/src/Eden/Models/SettingsModel.cpp index 6ccade42d7..51740af8ca 100644 --- a/src/Eden/Models/SettingsModel.cpp +++ b/src/Eden/Models/SettingsModel.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include "SettingsModel.h" SettingsModel::SettingsModel(QObject* parent) : QAbstractListModel(parent) {} diff --git a/src/Eden/Models/SettingsModel.h b/src/Eden/Models/SettingsModel.h index b039a282f2..6a7bacd77c 100644 --- a/src/Eden/Models/SettingsModel.h +++ b/src/Eden/Models/SettingsModel.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #ifndef SETTINGSMODEL_H #define SETTINGSMODEL_H diff --git a/src/Eden/Native/Gamepad/gamepad.cpp b/src/Eden/Native/Gamepad/gamepad.cpp index 37e062dc50..aa2ae92991 100644 --- a/src/Eden/Native/Gamepad/gamepad.cpp +++ b/src/Eden/Native/Gamepad/gamepad.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include "gamepad.h" // TODO(crueter): This is just temporary diff --git a/src/Eden/Native/Gamepad/gamepad.h b/src/Eden/Native/Gamepad/gamepad.h index 42c2b3faed..df63a97616 100644 --- a/src/Eden/Native/Gamepad/gamepad.h +++ b/src/Eden/Native/Gamepad/gamepad.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #pragma once #include #include diff --git a/src/Eden/Native/main.cpp b/src/Eden/Native/main.cpp index e691409d55..466692a1cf 100644 --- a/src/Eden/Native/main.cpp +++ b/src/Eden/Native/main.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include #include #include