From 026307219c2d577e357abaf8410d3b6d1e2f474d Mon Sep 17 00:00:00 2001 From: BearOso Date: Tue, 28 Nov 2023 18:30:45 -0600 Subject: [PATCH] Qt: Update Windows build with prebuilt Qt. --- qt/CMakeLists.txt | 15 ++++++++++++++- qt/QtStaticBuildVars.txt | 38 ------------------------------------- qt/src/Snes9xController.cpp | 2 +- 3 files changed, 15 insertions(+), 40 deletions(-) delete mode 100644 qt/QtStaticBuildVars.txt diff --git a/qt/CMakeLists.txt b/qt/CMakeLists.txt index b4c7bcb6..8edfaf77 100644 --- a/qt/CMakeLists.txt +++ b/qt/CMakeLists.txt @@ -77,7 +77,19 @@ target_include_directories(snes9x-core PRIVATE ../) target_compile_definitions(snes9x-core PRIVATE ZLIB HAVE_STDINT_H ALLOW_CPU_OVERCLOCK) if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - set(CMAKE_PREFIX_PATH "../external/qt6-mingw-clang-bin") + set(PREBUILT_QT "${PROJECT_SOURCE_DIR}/../external/qt6-mingw-clang-bin") + if (EXISTS ${PREBUILT_QT}) + message("Using existing Qt6 build at ${PREBUILT_QT}") + set(CMAKE_PREFIX_PATH ${PREBUILT_QT}) + else() + message("Getting Qt6 binaries...") + include(FetchContent) + FetchContent_Declare(qt6-mingw-clang-bin + GIT_REPOSITORY https://github.com/bearoso/qt6-mingw-clang-bin.git + GIT_TAG main) + FetchContent_MakeAvailable(qt6-mingw-clang-bin) + set(CMAKE_PREFIX_PATH ${qt6-mingw-clang-bin_SOURCE_DIR}) + endif() endif() find_package(Qt6 REQUIRED COMPONENTS Widgets Gui) list(APPEND LIBS Qt6::Widgets Qt6::Gui) @@ -91,6 +103,7 @@ list(APPEND FLAGS ${SDL_COMPILE_FLAGS} ${ZLIB_COMPILE_FLAGS}) if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") list(APPEND LIBS opengl32 libSDL2.a libz.a libc++.a) + list(APPEND LIBS gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32 dinput8) list(APPEND DEFINES SDL_MAIN_HANDLED) list(APPEND PLATFORM_SOURCES ../common/video/wgl_context.cpp diff --git a/qt/QtStaticBuildVars.txt b/qt/QtStaticBuildVars.txt deleted file mode 100644 index b3456983..00000000 --- a/qt/QtStaticBuildVars.txt +++ /dev/null @@ -1,38 +0,0 @@ --DBUILD_SHARED_LIBS=0 --DCMAKE_BUILD_TYPE=Release --DCMAKE_INSTALL_PREFIX="C:/Qt" --DFEATURE_androiddeployqt=0 --DFEATURE_brotli=0 --DFEATURE_dbus=0 --DFEATURE_freetype=0 --DFEATURE_harfbuzz=0 --DFEATURE_imageformat_ppm=0 --DFEATURE_islamiccivilcalendar=0 --DFEATURE_jalalicalendar=0 --DFEATURE_lcdnumber=0 --DFEATURE_movie=0 --DFEATURE_openssl_linked=0 --DFEATURE_openssl_runtime=0 --DFEATURE_optimize_size=1 --DFEATURE_pdf=0 --DFEATURE_printsupport=0 --DFEATURE_shani=0 --DFEATURE_sql=0 --DFEATURE_static=1 --DFEATURE_system_doubleconversion=0 --DFEATURE_system_freetype=0 --DFEATURE_system_harfbuzz=0 --DFEATURE_system_jpeg=0 --DFEATURE_system_libb2=0 --DFEATURE_system_pcre2=0 --DFEATURE_system_png=0 --DFEATURE_system_proxies=0 --DFEATURE_system_textmarkdownreader=0 --DFEATURE_system_zlib=0 --DFEATURE_testlib=0 --DFEATURE_textodfwriter=0 --DFEATURE_vkgen=0 --DFEATURE_vulkan=0 --DFEATURE_zstd=0 --DQT_BUILD_EXAMPLES_BY_DEFAULT=0 --DQT_BUILD_TESTS_BY_DEFAULT=0 diff --git a/qt/src/Snes9xController.cpp b/qt/src/Snes9xController.cpp index 15eb4c43..52860ae9 100644 --- a/qt/src/Snes9xController.cpp +++ b/qt/src/Snes9xController.cpp @@ -611,7 +611,7 @@ void Snes9xController::updateBindings(const EmuConfig *const config) S9xUnmapAllControls(); S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - + S9xSetController(1, CTL_JOYPAD, 1, 1, 1, 1); for (int controller_number = 0; controller_number < 5; controller_number++) {