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. 14
      src/CMakeLists.txt

2
CMakeLists.txt

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

14
src/CMakeLists.txt

@ -16,6 +16,10 @@ endif()
set_property(DIRECTORY APPEND PROPERTY set_property(DIRECTORY APPEND PROPERTY
COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG> $<$<NOT:$<CONFIG:Debug>>:NDEBUG>) COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG> $<$<NOT:$<CONFIG:Debug>>:NDEBUG>)
if (YUZU_STATIC_BUILD)
add_compile_definitions(QT_STATICPLUGIN)
endif()
# Set compilation flags # Set compilation flags
if (MSVC AND NOT CXX_CLANG) if (MSVC AND NOT CXX_CLANG)
set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING "" FORCE) set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING "" FORCE)
@ -169,25 +173,19 @@ else()
add_compile_definitions(_FILE_OFFSET_BITS=64) add_compile_definitions(_FILE_OFFSET_BITS=64)
endif() endif()
if (YUZU_STATIC_BUILD)
add_compile_definitions(QT_STATICPLUGIN)
# macos doesn't even let you make static executables... wtf?
if (NOT APPLE)
if (YUZU_STATIC_BUILD AND NOT APPLE)
add_compile_options(-static) add_compile_options(-static)
if (YUZU_STATIC_BUILD) if (YUZU_STATIC_BUILD)
# yuzu-cmd requires us to explicitly link libpthread, libgcc, and libstdc++ as static # 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 -lpthread)
add_link_options(-static-libgcc -static-libstdc++) add_link_options(-static-libgcc -static-libstdc++)
endif() endif()
endif() endif()
endif()
if (MINGW) if (MINGW)
add_compile_definitions(MINGW_HAS_SECURE_API) 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) if (WIN32 AND ARCHITECTURE_x86_64)
add_compile_options("-msse4.1") add_compile_options("-msse4.1")
endif() endif()

Loading…
Cancel
Save