qt6: fix mingw-w64 build

This commit is contained in:
oltolm 2023-07-28 11:25:18 +02:00 committed by Megamouse
parent d25d5327e5
commit a01a7a44cd
4 changed files with 3 additions and 39 deletions

View file

@ -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)

3
3rdparty/qt6.cmake vendored
View file

@ -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)

View file

@ -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()

View file

@ -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 $<TARGET_FILE_DIR:rpcs3>/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$<$<CONFIG:Debug>:/debug>/bin/")
add_custom_command(TARGET rpcs3 POST_BUILD
# COMMAND set PATH=${_QT6_TOOLS_PATHS}$<SEMICOLON>%PATH%
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_SOURCE_DIR}/bin" "$<TARGET_FILE_DIR:rpcs3>"
# 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}/../../../$<$<CONFIG:Debug>:debug/>bin/$<SEMICOLON>%PATH%
COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-quick-import --plugindir "$<TARGET_FILE_DIR:rpcs3>/qt6/plugins" --verbose 0 "$<TARGET_FILE:rpcs3>")
COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-quick-import --plugindir "$<IF:$<CXX_COMPILER_ID:MSVC>,$<TARGET_FILE_DIR:rpcs3>/plugins,$<TARGET_FILE_DIR:rpcs3>/share/qt6/plugins>" --verbose 0 "$<TARGET_FILE:rpcs3>")
endif()
# Unix installation