-
-
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 8840701
Showing
42 changed files
with
429 additions
and
258 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,65 @@ | ||
cmake_minimum_required(VERSION 3.2) | ||
cmake_minimum_required(VERSION 3.25) | ||
|
||
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) | ||
# The shell command and prefix to use for running extra commands. | ||
if(NOT DEFINED SHELL_CMD) | ||
if(WIN32) | ||
set(SHELL_CMD "C:\\msys64\\usr\\bin\\bash.exe" CACHE STRING "Shell to use" FORCE) | ||
else() | ||
set(SHELL_CMD "bash" CACHE STRING "Shell to use" FORCE) | ||
endif() | ||
endif() | ||
if(NOT DEFINED SHELL_CMD_PREFIX) | ||
if(WIN32) | ||
set(SHELL_CMD_PREFIX -l -c CACHE STRING "Shell command prefix" FORCE) | ||
set(MSYSTEM "UCRT64" CACHE STRING "MSYSTEM to use" FORCE) | ||
set(ENV{MSYSTEM} ${MSYSTEM}) | ||
else() | ||
set(SHELL_CMD_PREFIX -c CACHE STRING "Shell command prefix" FORCE) | ||
endif() | ||
endif() | ||
message(STATUS "Using shell command: ${SHELL_CMD}") | ||
message(STATUS "Using shell command prefix: ${SHELL_CMD_PREFIX}") | ||
|
||
# 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_MF "Build FFmpeg Media Foundation" ON) | ||
option(BUILD_FFMPEG_MF_PATCHES "Apply FFmpeg Media Foundation 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} | ||
COMMENT "Completed build-deps" | ||
) | ||
|
||
# set architecture | ||
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} arch) | ||
|
||
# set generated source path | ||
set(CMAKE_GENERATED_SRC_PATH ${CMAKE_CURRENT_BINARY_DIR}/generated-src) | ||
|
||
# common includes | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/apply_git_patch.cmake) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/unix_path.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,2 @@ | ||
# unix line endings | ||
* text eol=lf |
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,45 @@ | ||
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) | ||
|
||
# TODO: install these files | ||
set(FFMPEG_HEADER_DIRECTORIES "") | ||
set(FFMPEG_HEADER_FILES "") | ||
set(FFMPEG_STATIC_LIBRARIES "") | ||
|
||
if(APPLE) | ||
set(BUILD_FFMPEG_AMF OFF) | ||
endif() | ||
|
||
if(BUILD_FFMPEG_AMF) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/amf.cmake) | ||
endif() | ||
|
||
if(BUILD_FFMPEG_MF) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/mf.cmake) | ||
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() |
Oops, something went wrong.