Browse Source

set QT_STATICPLUGIN on MSVC

Signed-off-by: crueter <crueter@eden-emu.dev>
pull/3289/head
crueter 4 weeks ago
parent
commit
647ee5e2e6
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 2
      CMakeLists.txt
  2. 24
      src/CMakeLists.txt

2
CMakeLists.txt

@ -562,6 +562,8 @@ endif()
if (ENABLE_QT)
if (YUZU_USE_BUNDLED_QT)
AddQt(6.9.3)
set(YUZU_STATIC_BUILD ON)
else()
message(STATUS "Using system Qt")
if (NOT Qt6_DIR)

24
src/CMakeLists.txt

@ -16,6 +16,10 @@ endif()
set_property(DIRECTORY APPEND PROPERTY
COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG> $<$<NOT:$<CONFIG:Debug>>:NDEBUG>)
if (YUZU_STATIC_BUILD)
add_compile_definitions(QT_STATICPLUGIN)
endif()
# Set compilation flags
if (MSVC AND NOT CXX_CLANG)
set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING "" FORCE)
@ -169,25 +173,19 @@ else()
add_compile_definitions(_FILE_OFFSET_BITS=64)
endif()
if (YUZU_STATIC_BUILD)
add_compile_definitions(QT_STATICPLUGIN)
# macos doesn't even let you make static executables... wtf?
if (NOT APPLE)
add_compile_options(-static)
if (YUZU_STATIC_BUILD)
# yuzu-cmd requires us to explicitly link libpthread, libgcc, and libstdc++ as static
# At a guess, it's probably because Qt handles the Qt executable for us, whereas this does not
add_link_options(-static -lpthread)
add_link_options(-static-libgcc -static-libstdc++)
endif()
if (YUZU_STATIC_BUILD AND NOT APPLE)
add_compile_options(-static)
if (YUZU_STATIC_BUILD)
# yuzu-cmd requires us to explicitly link libpthread, libgcc, and libstdc++ as static
add_link_options(-static -lpthread)
add_link_options(-static-libgcc -static-libstdc++)
endif()
endif()
if (MINGW)
add_compile_definitions(MINGW_HAS_SECURE_API)
# Only windows has this requirement, thanks windows
# Only windows has this requirement
if (WIN32 AND ARCHITECTURE_x86_64)
add_compile_options("-msse4.1")
endif()

Loading…
Cancel
Save