2022-12-28 21:21:41 +00:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2023-03-15 16:39:30 +00:00
|
|
|
index 1842c67..8afd0e9 100644
|
2022-12-28 21:21:41 +00:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2023-03-15 16:39:30 +00:00
|
|
|
@@ -280,6 +280,8 @@ else()
|
|
|
|
set(WAYLAND_FOUND OFF)
|
|
|
|
endif()
|
2022-12-28 21:21:41 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
+ find_package(FFMPEG REQUIRED)
|
2022-12-28 21:21:41 +00:00
|
|
|
+
|
2023-03-15 16:39:30 +00:00
|
|
|
if(X11_FOUND)
|
|
|
|
add_compile_definitions(SUNSHINE_BUILD_X11)
|
|
|
|
include_directories(${X11_INCLUDE_DIR})
|
|
|
|
@@ -451,51 +453,12 @@ set_source_files_properties(src/upnp.cpp PROPERTIES COMPILE_FLAGS -Wno-pedantic)
|
|
|
|
set_source_files_properties(third-party/nanors/rs.c
|
|
|
|
PROPERTIES COMPILE_FLAGS "-include deps/obl/autoshim.h -ftree-vectorize")
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
-# Pre-compiled binaries
|
|
|
|
-if(WIN32)
|
2023-03-15 16:39:30 +00:00
|
|
|
- set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-windows-x86_64")
|
|
|
|
- set(FFMPEG_PLATFORM_LIBRARIES mfplat ole32 strmiids mfuuid mfx)
|
2022-12-28 21:21:41 +00:00
|
|
|
-elseif(APPLE)
|
2023-03-15 16:39:30 +00:00
|
|
|
- if (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
|
|
|
|
- set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-macos-aarch64")
|
|
|
|
- else()
|
|
|
|
- set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-macos-x86_64")
|
|
|
|
- endif()
|
2022-12-28 21:21:41 +00:00
|
|
|
-else()
|
2023-03-15 16:39:30 +00:00
|
|
|
- set(FFMPEG_PLATFORM_LIBRARIES va va-drm va-x11 vdpau X11)
|
|
|
|
- if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
|
|
|
- set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-aarch64")
|
|
|
|
- else()
|
|
|
|
- set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-x86_64")
|
|
|
|
- list(APPEND FFMPEG_PLATFORM_LIBRARIES mfx)
|
|
|
|
- set(CPACK_DEB_PLATFORM_PACKAGE_DEPENDS "libmfx1,")
|
|
|
|
- set(CPACK_RPM_PLATFORM_PACKAGE_REQUIRES "intel-mediasdk >= 22.3.0,")
|
|
|
|
- endif()
|
2022-12-28 21:21:41 +00:00
|
|
|
-endif()
|
|
|
|
-set(FFMPEG_INCLUDE_DIRS
|
2023-03-15 16:39:30 +00:00
|
|
|
- ${FFMPEG_PREPARED_BINARIES}/include)
|
2022-12-28 21:21:41 +00:00
|
|
|
-if(EXISTS ${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a)
|
2023-03-15 16:39:30 +00:00
|
|
|
- set(HDR10_PLUS_LIBRARY
|
|
|
|
- ${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a)
|
2022-12-28 21:21:41 +00:00
|
|
|
-endif()
|
|
|
|
-set(FFMPEG_LIBRARIES
|
2023-03-15 16:39:30 +00:00
|
|
|
- ${FFMPEG_PREPARED_BINARIES}/lib/libavcodec.a
|
|
|
|
- ${FFMPEG_PREPARED_BINARIES}/lib/libavutil.a
|
|
|
|
- ${FFMPEG_PREPARED_BINARIES}/lib/libcbs.a
|
|
|
|
- ${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a
|
|
|
|
- ${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a
|
|
|
|
- ${FFMPEG_PREPARED_BINARIES}/lib/libx264.a
|
|
|
|
- ${FFMPEG_PREPARED_BINARIES}/lib/libx265.a
|
|
|
|
- ${HDR10_PLUS_LIBRARY}
|
|
|
|
- ${FFMPEG_PLATFORM_LIBRARIES})
|
2022-12-28 21:21:41 +00:00
|
|
|
-
|
|
|
|
include_directories(
|
2023-03-15 16:39:30 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/third-party
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/third-party/moonlight-common-c/enet/include
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/third-party/nanors
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/third-party/nanors/deps/obl
|
|
|
|
- ${FFMPEG_INCLUDE_DIRS}
|
|
|
|
${PLATFORM_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
|
|
|
@@ -529,6 +492,7 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
|
|
|
${CMAKE_THREAD_LIBS_INIT}
|
|
|
|
enet
|
|
|
|
opus
|
|
|
|
+ cbs
|
|
|
|
${FFMPEG_LIBRARIES}
|
|
|
|
${Boost_LIBRARIES}
|
|
|
|
${OPENSSL_LIBRARIES}
|