From a01a7a44cd120cd0f8d5d54bda2bda16fe9f2d7d Mon Sep 17 00:00:00 2001 From: oltolm Date: Fri, 28 Jul 2023 11:25:18 +0200 Subject: [PATCH] qt6: fix mingw-w64 build --- 3rdparty/llvm/CMakeLists.txt | 1 + 3rdparty/qt6.cmake | 3 +-- CMakeLists.txt | 2 -- rpcs3/CMakeLists.txt | 36 +----------------------------------- 4 files changed, 3 insertions(+), 39 deletions(-) diff --git a/3rdparty/llvm/CMakeLists.txt b/3rdparty/llvm/CMakeLists.txt index 1c9552e322..679cb23a61 100644 --- a/3rdparty/llvm/CMakeLists.txt +++ b/3rdparty/llvm/CMakeLists.txt @@ -15,6 +15,7 @@ if(WITH_LLVM) option(LLVM_INCLUDE_TOOLS OFF) option(LLVM_INCLUDE_UTILS OFF) option(LLVM_CCACHE_BUILD ON) + set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "Enable compiler warnings.") if(WIN32) set(LLVM_USE_INTEL_JITEVENTS ON) diff --git a/3rdparty/qt6.cmake b/3rdparty/qt6.cmake index 40d8e94df4..7fce290470 100644 --- a/3rdparty/qt6.cmake +++ b/3rdparty/qt6.cmake @@ -4,8 +4,7 @@ set(QT_MIN_VER 6.2.4) find_package(Qt6 ${QT_MIN_VER} CONFIG COMPONENTS Widgets Concurrent Multimedia MultimediaWidgets Svg SvgWidgets) if(WIN32) - find_package(Qt6 ${QT_MIN_VER} COMPONENTS WinExtras REQUIRED) - target_link_libraries(3rdparty_qt6 INTERFACE Qt6::Widgets Qt6::WinExtras Qt6::Concurrent Qt6::Multimedia Qt6::MultimediaWidgets Qt6::Svg Qt6::SvgWidgets) + target_link_libraries(3rdparty_qt6 INTERFACE Qt6::Widgets Qt6::Concurrent Qt6::Multimedia Qt6::MultimediaWidgets Qt6::Svg Qt6::SvgWidgets) else() find_package(Qt6 ${QT_MIN_VER} COMPONENTS DBus Gui) if(Qt6DBus_FOUND) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8887c21d36..e8b39077f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,8 +115,6 @@ if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64") link_directories(/opt/homebrew/lib) endif() -set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "Enable compiler warnings.") - if(MSVC) add_compile_options(/wd4530 /utf-8) # C++ exception handler used, but unwind semantics are not enabled endif() diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index f89c8b059a..0bf6f5ebbb 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -112,14 +112,6 @@ if(USE_PRECOMPILED_HEADERS) target_precompile_headers(rpcs3 PRIVATE stdafx.h) endif() -get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION) -get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY) -if(APPLE) - find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}") -elseif(WIN32) - find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}") -endif() - # Copy icons to executable directory if(APPLE) if (CMAKE_BUILD_TYPE MATCHES "Debug" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") @@ -148,35 +140,9 @@ elseif(UNIX) COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/git $/git) elseif(WIN32) - # TODO(cjj19970505@live.cn) - # offical Qt binaries are built with -MD(d) only as stated in offical wiki - # https://wiki.qt.io/Technical_FAQ#Why_does_a_statically_built_Qt_use_the_dynamic_Visual_Studio_runtime_libraries_.3F_Do_I_need_to_deploy_those_with_my_application_.3F - # If we build our libs with /MT(d), we might encounter some issues. - # https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-160#what-problems-exist-if-an-application-uses-more-than-one-crt-version - - # Qt installed from Qt installer has following hierarchy: - # bin/ for release and debug dlls and windeployqt tools - # lib/cmake/Qt6/ for Qt6_Dir - # Qt installed from vcpkg has following hierarchy: - # bin/ for release dlls - # debug/bin/ for debug dlls - # tools/qt6/bin/ for tools including windeployqt - # tools/qt6/debug/bin/ for tools with debug build including windeployqt - # share/cmake/Qt6/ for Qt6_Dir - - # If Qt is installed from official Qt installer - # list(APPEND _QT6_TOOLS_PATHS "${Qt6_DIR}/../../../bin/") - - # If Qt is installed from vcpkg - # list(APPEND _QT6_TOOLS_PATHS "${Qt6_DIR}/../../../tools/qt6$<$:/debug>/bin/") - add_custom_command(TARGET rpcs3 POST_BUILD - # COMMAND set PATH=${_QT6_TOOLS_PATHS}$%PATH% COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_SOURCE_DIR}/bin" "$" - # If Qt is installed from vcpkg, add binary path to PATH - # otherwise windeployqt tool won't be able to locate necessary dlls - # COMMAND set PATH=${Qt6_DIR}/../../../$<$:debug/>bin/$%PATH% - COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-quick-import --plugindir "$/qt6/plugins" --verbose 0 "$") + COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-quick-import --plugindir "$,$/plugins,$/share/qt6/plugins>" --verbose 0 "$") endif() # Unix installation