Browse Source

fix openssl and ffmpeg, add sdl

Signed-off-by: crueter <crueter@eden-emu.dev>
pull/3003/head
crueter 3 months ago
parent
commit
89678f0c0e
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 20
      CMakeLists.txt
  2. 23
      CMakeModules/StaticQtLibs.cmake
  3. 7
      externals/cpmfile.json
  4. 27
      src/yuzu/CMakeLists.txt

20
CMakeLists.txt

@ -119,6 +119,8 @@ endif()
option(YUZU_STATIC_BUILD "Use static libraries and executables if available" OFF)
if (YUZU_STATIC_BUILD)
include(StaticQtLibs)
# lol
set(Boost_USE_STATIC_LIBS ON)
set(BUILD_SHARED_LIBS OFF)
@ -136,7 +138,8 @@ if (YUZU_STATIC_BUILD)
# simple hook to reject dynamic libs
function(find_library var)
# also skip previously-found libraries cuz... yaknow
if (${var})
# UNLESS they are dll.a :{
if (${var} AND NOT ${var} MATCHES "dll\\.a$")
return()
endif()
@ -163,7 +166,7 @@ if (YUZU_STATIC_BUILD)
set(YUZU_USE_CPM ON)
set(YUZU_USE_BUNDLED_FFMPEG ON)
set(YUZU_USE_EXTERNAL_SDL2 ON)
set(YUZU_USE_BUNDLED_SDL2 ON)
set(YUZU_USE_BUNDLED_OPENSSL ON)
# IMPORTED_IMPLIB not set for imported target
@ -175,19 +178,6 @@ if (YUZU_STATIC_BUILD)
endif()
endif()
## certain libraries need extra static libs to be linked ##
if (YUZU_STATIC_BUILD AND MINGW)
macro(extra_libs)
foreach(lib ${ARGN})
find_library(${lib}_LIBRARY ${lib} REQUIRED)
link_libraries(${${lib}_LIBRARY})
endforeach()
endmacro()
# ffmpeg
extra_libs(iconv)
endif()
# Detect current compilation architecture and create standard definitions
# =======================================================================

23
CMakeModules/StaticQtLibs.cmake

@ -0,0 +1,23 @@
## When linking to a static Qt build on MinGW, certain additional libraries
## must be statically linked to as well.
function(static_qt_link target)
macro(extra_libs)
foreach(lib ${ARGN})
find_library(${lib}_LIBRARY ${lib} REQUIRED)
target_link_libraries(${target} PRIVATE ${${lib}_LIBRARY})
endforeach()
endmacro()
# I am constantly impressed at how ridiculously stupid the linker is
# NB: yes, we have to put them here twice. I have no idea why
# libtiff.a
extra_libs(tiff jbig bz2 lzma deflate jpeg tiff)
# libfreetype.a
extra_libs(freetype bz2 Lerc brotlidec brotlicommon freetype)
# libharfbuzz.a
extra_libs(harfbuzz graphite2)
endfunction()

7
externals/cpmfile.json

@ -167,11 +167,8 @@
"package": "SDL2",
"name": "SDL2",
"repo": "crueter-ci/SDL2",
"version": "2.32.10",
"min_version": "2.26.4",
"disabled_platforms": [
"macos-universal"
]
"version": "2.32.10-38e0094637",
"min_version": "2.26.4"
},
"catch2": {
"package": "Catch2",

27
src/yuzu/CMakeLists.txt

@ -459,33 +459,8 @@ if (NOT MSVC AND (APPLE OR NOT YUZU_STATIC_BUILD))
-Wno-missing-field-initializers)
endif()
## certain libraries need extra static libs to be linked ##
# I have no fucking clue why it ONLY has to be on yuzu
# yuzu_cmd works totally fine but not this??????????
if (YUZU_STATIC_BUILD AND MINGW)
macro(extra_libs)
foreach(lib ${ARGN})
find_library(${lib}_LIBRARY ${lib} REQUIRED)
target_link_libraries(yuzu PRIVATE ${${lib}_LIBRARY})
endforeach()
endmacro()
# I am constantly impressed at how ridiculously stupid the linker is
# NB: yes, we have to put them here twice. I have no idea why
# libtiff.a
extra_libs(tiff jbig bz2 lzma deflate jpeg tiff)
# libfreetype.a
extra_libs(freetype bz2 Lerc brotlidec brotlicommon freetype)
# libharfbuzz.a
extra_libs(harfbuzz graphite2)
# ffmpeg
extra_libs(iconv)
extra_libs(wsock32 ws2_32 crypt32 mswsock wlanapi)
static_qt_link(yuzu)
endif()
create_target_directory_groups(yuzu)
Loading…
Cancel
Save