From d8657802917aeba28fea5a253b84eaf4ec6aa33e Mon Sep 17 00:00:00 2001 From: emufan4568 Date: Sat, 16 Jul 2022 16:32:51 +0300 Subject: [PATCH] vcpkg: Dont't build Qt from source * Currently vcpkg has no mechanism of consistently handling prebuilt libraries. This means that large libraries like Qt need special treatment --- CMakeLists.txt | 23 +++++++++++++++++++++-- vcpkg.json | 7 +------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index acf4e7a44..7cb48e1cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,11 +210,30 @@ else() set(SDL2_FOUND NO) endif() + if (ENABLE_QT) - find_package(Qt5 REQUIRED COMPONENTS Widgets Multimedia) + if (CITRA_USE_BUNDLED_QT) + if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64) + set(QT_VER qt-5.10.0-msvc2017_64) + else() + message(FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable CITRA_USE_BUNDLED_QT and provide your own.") + endif() + + if (DEFINED QT_VER) + download_bundled_external("qt/" ${QT_VER} QT_PREFIX) + endif() + + set(QT_PREFIX_HINT HINTS "${QT_PREFIX}") + else() + # Passing an empty HINTS seems to cause default system paths to get ignored in CMake 2.8 so + # make sure to not pass anything if we don't have one. + set(QT_PREFIX_HINT) + endif() + + find_package(Qt5 REQUIRED COMPONENTS Widgets Multimedia ${QT_PREFIX_HINT}) if (ENABLE_QT_TRANSLATION) - find_package(Qt5 REQUIRED COMPONENTS LinguistTools) + find_package(Qt5 REQUIRED COMPONENTS LinguistTools ${QT_PREFIX_HINT}) endif() endif() diff --git a/vcpkg.json b/vcpkg.json index b20cb002b..a8c563506 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -36,13 +36,8 @@ "libyuv", "lodepng", "glslang", - "soundtouch", - "robin-map", "xbyak", "zstd", - "sdl2", - "sdl2-image", - "qt5-base", - "qt5-multimedia" + "sdl2" ] } \ No newline at end of file