-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): make this a fullblown cmake project
- Loading branch information
1 parent
0170afd
commit 1834e9b
Showing
37 changed files
with
200 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Distribution / packaging | ||
build/ | ||
cmake-*/ | ||
|
||
# JetBrains project folder | ||
.idea/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
[submodule "ffmpeg_sources/AMF"] | ||
path = ffmpeg_sources/AMF | ||
url = https://github.com/GPUOpen-LibrariesAndSDKs/AMF | ||
[submodule "third-party/FFmpeg/AMF"] | ||
path = third-party/FFmpeg/AMF | ||
url = https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git | ||
branch = master | ||
[submodule "ffmpeg_sources/x264"] | ||
path = ffmpeg_sources/x264 | ||
[submodule "third-party/FFmpeg/x264"] | ||
path = third-party/FFmpeg/x264 | ||
url = https://code.videolan.org/videolan/x264.git | ||
branch = stable | ||
[submodule "ffmpeg_sources/x265_git"] | ||
path = ffmpeg_sources/x265_git | ||
[submodule "third-party/FFmpeg/x265_git"] | ||
path = third-party/FFmpeg/x265_git | ||
url = https://bitbucket.org/multicoreware/x265_git.git | ||
branch = Release_3.5 | ||
[submodule "ffmpeg_sources/nv-codec-headers"] | ||
path = ffmpeg_sources/nv-codec-headers | ||
url = https://github.com/FFmpeg/nv-codec-headers | ||
[submodule "third-party/FFmpeg/nv-codec-headers"] | ||
path = third-party/FFmpeg/nv-codec-headers | ||
url = https://github.com/FFmpeg/nv-codec-headers.git | ||
branch = sdk/12.0 | ||
[submodule "ffmpeg_sources/ffmpeg"] | ||
path = ffmpeg_sources/ffmpeg | ||
url = https://github.com/FFmpeg/FFmpeg | ||
[submodule "third-party/FFmpeg/FFmpeg"] | ||
path = third-party/FFmpeg/FFmpeg | ||
url = https://github.com/FFmpeg/FFmpeg.git | ||
branch = release/7.1 | ||
[submodule "ffmpeg_sources/SVT-AV1"] | ||
path = ffmpeg_sources/SVT-AV1 | ||
[submodule "third-party/FFmpeg/SVT-AV1"] | ||
path = third-party/FFmpeg/SVT-AV1 | ||
url = https://gitlab.com/AOMediaCodec/SVT-AV1.git | ||
branch = v1.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,43 @@ | ||
cmake_minimum_required(VERSION 3.2) | ||
|
||
project(build-deps | ||
DESCRIPTION "Pre-build dependencies for LizardByte projects") | ||
DESCRIPTION "Pre-build dependencies for LizardByte projects.") | ||
|
||
option(FFMPEG_CBS "Enable CBS library configuration" ON) | ||
option(BUILD_ALL "Build all dependencies" ON) | ||
option(BUILD_ALL_SUNSHINE "Build all Sunshine dependencies" ON) | ||
|
||
if(FFMPEG_CBS) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg_cbs.cmake) | ||
# FFmpeg | ||
option(BUILD_FFMPEG "Build FFmpeg" ON) | ||
option(BUILD_FFMPEG_ALL_PATCHES "Apply FFmpeg patches" ON) | ||
option(BUILD_FFMPEG_AMF "Build FFmpeg AMF" ON) | ||
option(BUILD_FFMPEG_AMF_PATCHES "Apply FFmpeg AMF patches" ON) | ||
option(BUILD_FFMPEG_CBS "Build FFmpeg CBS" ON) | ||
option(BUILD_FFMPEG_CBS_PATCHES "Apply FFmpeg CBS patches" ON) | ||
option(BUILD_FFMPEG_NV_CODEC_HEADERS "Build FFmpeg NV Codec Headers" ON) | ||
option(BUILD_FFMPEG_NV_CODEC_HEADERS_PATCHES "Apply FFmpeg NV Codec Headers patches" ON) | ||
option(BUILD_FFMPEG_SVT_AV1 "Build FFmpeg SVT-AV1" ON) | ||
option(BUILD_FFMPEG_SVT_AV1_PATCHES "Apply FFmpeg SVT-AV1 patches" ON) | ||
option(BUILD_FFMPEG_VAAPI "Build FFmpeg with VAAPI support" ON) | ||
option(BUILD_FFMPEG_VAAPI_PATCHES "Apply FFmpeg VAAPI patches" ON) | ||
option(BUILD_FFMPEG_X264 "Build FFmpeg x264" ON) | ||
option(BUILD_FFMPEG_X264_PATCHES "Apply FFmpeg x264 patches" ON) | ||
option(BUILD_FFMPEG_X265 "Build FFmpeg x265" ON) | ||
option(BUILD_FFMPEG_X265_PATCHES "Apply FFmpeg x265 patches" ON) | ||
|
||
add_custom_target(${CMAKE_PROJECT_NAME}) | ||
|
||
# set generated source path | ||
set(CMAKE_GENERATED_SRC_PATH ${CMAKE_CURRENT_BINARY_DIR}/generated-src) | ||
|
||
# Explicit shell otherwise Windows runs outside the mingw environment | ||
# TODO: is this true when using `${CMAKE_COMMAND} -E`? | ||
if(WIN32) | ||
set(SHELL_COMMAND sh) | ||
endif() | ||
|
||
# common includes | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/apply_git_patch.cmake) | ||
|
||
if(BUILD_ALL OR BUILD_ALL_SUNSHINE OR BUILD_FFMPEG) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/_main.cmake) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/third-party/FFmpeg/FFmpeg DESTINATION ${CMAKE_GENERATED_SRC_PATH}) | ||
|
||
set(FFMPEG_GENERATED_SRC_PATH ${CMAKE_GENERATED_SRC_PATH}/FFmpeg) | ||
set(AVCODEC_GENERATED_SRC_PATH ${CMAKE_GENERATED_SRC_PATH}/FFmpeg/libavcodec) | ||
|
||
if(NOT APPLE) | ||
if(BUILD_FFMPEG_AMF) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/amf.cmake) | ||
endif() | ||
endif() | ||
|
||
if(BUILD_FFMPEG_NV_CODEC_HEADERS) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/nv_codec_headers.cmake) | ||
endif() | ||
|
||
if(BUILD_FFMPEG_SVT_AV1) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/svt_av1.cmake) | ||
endif() | ||
|
||
if(BUILD_FFMPEG_VAAPI) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/vaapi.cmake) | ||
endif() | ||
|
||
if(BUILD_FFMPEG_X264) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/x264.cmake) | ||
endif() | ||
|
||
if(BUILD_FFMPEG_X265) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/x265.cmake) | ||
endif() | ||
|
||
if(BUILD_FFMPEG_CBS) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/cbs.cmake) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
if(BUILD_FFMPEG_ALL_PATCHES OR BUILD_FFMPEG_AMF_PATCHES) | ||
file(GLOB FFMPEG_AMF_PATCH_FILES ${CMAKE_CURRENT_SOURCE_DIR}/patches/FFmpeg/AMF/*.patch) | ||
|
||
foreach(patch_file ${FFMPEG_AMF_PATCH_FILES}) | ||
APPLY_GIT_PATCH(${FFMPEG_GENERATED_SRC_PATH} ${patch_file}) | ||
endforeach() | ||
endif() | ||
|
||
add_custom_target(amf ALL | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory | ||
"${CMAKE_CURRENT_SOURCE_DIR}/third-party/FFmpeg/AMF/amf/public/include" | ||
"${CMAKE_GENERATED_SRC_PATH}/include/AMF" | ||
COMMENT "Copying AMF headers" | ||
) |
Oops, something went wrong.