Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 40 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,70 +27,85 @@ env:

jobs:
build:
name: Build (${{ matrix.name }})
name: Build ${{ matrix.build }} (${{ matrix.name }})
runs-on: ${{ matrix.os }}
# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
# https://trac.ffmpeg.org/wiki/CompilationGuide/macOS
# https://trac.ffmpeg.org/wiki/CompilationGuide/MinGW
strategy:
fail-fast: false # false to test all, true to fail entire job if any fail
fail-fast: false
matrix:
include:
- name: Linux-x86_64 # ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}
# name: ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}
- name: Linux-x86_64
os: ubuntu-22.04
arch: x86_64
generator: "Unix Makefiles"
shell: bash
build: ALL
- name: Linux-aarch64
os: ubuntu-22.04
arch: aarch64
generator: "Unix Makefiles"
shell: bash
target: aarch64-linux-gnu
build: ALL
- name: Linux-ppc64le
os: ubuntu-22.04
arch: powerpc64le
generator: "Unix Makefiles"
shell: bash
target: powerpc64le-linux-gnu
build: FFMPEG # https://github.com/boostorg/context/issues/311
- name: Darwin-x86_64
os: macos-13
arch: x86_64
generator: "Unix Makefiles"
shell: bash
target: x86_64-apple-macosx
build: ALL
- name: Darwin-arm64
os: macos-14
arch: aarch64
generator: "Unix Makefiles"
shell: bash
target: arm64-apple-macosx
build: ALL
- name: Windows-AMD64
os: windows-2022
arch: x86_64
generator: "MSYS Makefiles"
shell: msys2 {0}
msystem: ucrt64
toolchain: ucrt-x86_64
build: BOOST
- name: Windows-AMD64
os: windows-2022
arch: x86_64
generator: "MSYS Makefiles"
shell: msys2 {0}
msystem: ucrt64
toolchain: ucrt-x86_64
build: FFMPEG
- name: Windows-ARM64
os: windows-11-arm
arch: aarch64
generator: "MSYS Makefiles"
shell: msys2 {0}
msystem: clangarm64
toolchain: clang-aarch64
build: ALL
- name: FreeBSD-amd64
os: ubuntu-latest
arch: x86_64
bsd_release: '14.3'
generator: "Unix Makefiles"
shell: freebsd {0}
build: ALL
- name: FreeBSD-aarch64
os: ubuntu-latest # ubuntu-24.04-arm is slower with the FreeBSD VM
arch: aarch64
bsd_release: '14.3'
generator: "Unix Makefiles"
shell: freebsd {0}
build: ALL
defaults:
run:
shell: ${{ matrix.shell }}
Expand Down Expand Up @@ -327,6 +342,7 @@ jobs:
"diffutils"
"git"
"make"
"patch"
"pkg-config"
"mingw-w64-${TOOLCHAIN}-binutils"
"mingw-w64-${TOOLCHAIN}-cmake"
Expand Down Expand Up @@ -489,6 +505,8 @@ jobs:
-B build \
-S . \
-G "${{ matrix.generator }}" \
-DBUILD_ALL=OFF \
-DBUILD_${{ matrix.build }}=ON \
-DCMAKE_TOOLCHAIN_FILE=${{ env.CMAKE_TOOLCHAIN_FILE }} \
-DCMAKE_INSTALL_PREFIX="${{ env.ROOT_PATH }}/build/dist" \
-DPARALLEL_BUILDS=${{ steps.processor_count.outputs.PROCESSOR_COUNT || 1 }}
Expand All @@ -506,7 +524,9 @@ jobs:
${{ env.MAKE_CMD }} -C build install

- name: Debug logs
if: always()
if: >-
always() &&
matrix.build == 'FFMPEG'
shell: bash
run: |
echo "::group::x264 config.log"
Expand All @@ -529,15 +549,26 @@ jobs:

- name: Cleanup
shell: bash
run: rm -f -r ./build/dist/share
run: |
rm -f -r ./build/dist/share
rm -f -r ./build/dist/lib/cmake

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ matrix.name }}
name: ${{ matrix.name }}-${{ matrix.build }}
path: ./build/dist

conclusion:
name: Conclusion
needs: build
runs-on: ubuntu-latest
steps:
# this job is simply used for branch protection rules so we don't have to add every matrix combination
- name: Check build status
run: echo "Build succeeded"

update_dist:
# only the commit is conditional, so the rest of the job can be verified on PRs
name: Update dist
Expand Down
23 changes: 21 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ project(build-deps

# Main options
option(BUILD_ALL "Build all dependencies" ON)
option(BUILD_ALL_SUNSHINE "Build all Sunshine dependencies" ON)
option(BUILD_ALL_LIBDISPLAYDEVICE "Build all libdisplaydevice dependencies" OFF)
option(BUILD_ALL_SUNSHINE "Build all Sunshine dependencies" OFF)

# Boost options
option(BUILD_BOOST "Build Boost" OFF)
option(BUILD_BOOST_LIBDISPLAYDEVICE "Build boost for libdisplaydevice" ON)
option(BUILD_BOOST_SUNSHINE "Build boost for Sunshine" ON)

# FFmpeg options
option(BUILD_FFMPEG "Build FFmpeg" ON)
option(BUILD_FFMPEG "Build FFmpeg" OFF)
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)
Expand All @@ -33,6 +39,10 @@ option(BUILD_FFMPEG_X265_PATCHES "Apply FFmpeg x265 patches" ON)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/apply_git_patch.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/unix_path.cmake)

# CPM
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cpm/CPM.cmake)
CPMUsePackageLock(package-lock.cmake)

if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(FREEBSD ON)
endif()
Expand Down Expand Up @@ -200,6 +210,15 @@ message(STATUS "Detected system name: ${CMAKE_SYSTEM_NAME}")
message(STATUS "Detected architecture: ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "CI Matrix name should be: '${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}'")

# boost
# TODO: boost build fails on Windows due to NASM errors during configure?
# https://github.com/Orphis/boost-cmake/issues/42
# https://github.com/libsdl-org/SDL/issues/10250
if(BUILD_ALL OR BUILD_ALL_LIBDISPLAYDEVICE OR BUILD_ALL_SUNSHINE OR BUILD_BOOST)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/boost/_main.cmake)
endif()

# FFmpeg
if(BUILD_ALL OR BUILD_ALL_SUNSHINE OR BUILD_FFMPEG)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/_main.cmake)
endif()
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

This is a common set of pre-compiled dependencies for [LizardByte/Sunshine](https://github.com/LizardByte/Sunshine).

- [Boost](https://www.boost.org)
- [FFmpeg](https://ffmpeg.org)

## Usage
Expand All @@ -17,13 +18,6 @@ This is a common set of pre-compiled dependencies for [LizardByte/Sunshine](http
checkout dist
```

## Plans

- [ ] Add more dependencies
- [ ] boost
- [ ] cuda (developer toolkit)
- [ ] build linux dependencies in Docker (to more closely align with target environments)

## License

This repo is licensed under the MIT License, but this does not cover submodules or patches.
Expand Down Expand Up @@ -159,6 +153,7 @@ pacman -S \
diffutils \
git \
make \
patch \
pkg-config \
mingw-w64-ucrt-x86_64-binutils \
mingw-w64-ucrt-x86_64-cmake \
Expand All @@ -179,6 +174,7 @@ pacman -S \
diffutils \
git \
make \
patch \
pkg-config \
mingw-w64-clang-aarch64-binutils \
mingw-w64-clang-aarch64-cmake \
Expand Down
46 changes: 46 additions & 0 deletions cmake/boost/_main.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
CPMGetPackage(Boost)

if(BUILD_BOOST_SUNSHINE)
set(BUILD_BOOST_LIBDISPLAYDEVICE ON)
endif()

list(APPEND BOOST_COMPONENTS_BASE
asio
crc
format
process
property_tree
)

if(BUILD_BOOST_LIBDISPLAYDEVICE)
list(APPEND BOOST_COMPONENTS
algorithm
preprocessor
scope
uuid
)
endif()
if(BUILD_BOOST_SUNSHINE)
list(APPEND BOOST_COMPONENTS
filesystem
locale
log
program_options
system
)
endif()

set(BOOST_ENABLE_CMAKE ON) # Use experimental superproject to pull library dependencies recursively
set(BOOST_INCLUDE_LIBRARIES ${BOOST_COMPONENTS_BASE} ${BOOST_COMPONENTS})
set(BOOST_SKIP_INSTALL_RULES OFF) # disabled to allow installation of Boost libraries
set(Boost_USE_STATIC_LIBS ON) # cmake-lint: disable=C0103

message(STATUS "Boost_BINARY_DIR: ${Boost_BINARY_DIR}")
message(STATUS "Boost_SOURCE_DIR: ${Boost_SOURCE_DIR}")

if(WIN32)
# Windows build is failing to create header file in this directory
file(MAKE_DIRECTORY ${Boost_BINARY_DIR}/libs/log/src/windows)
endif()

add_subdirectory(${Boost_SOURCE_DIR} ${Boost_BINARY_DIR} SYSTEM)
Empty file added cmake/cpm/.cmake-lint-ignore
Empty file.
Loading
Loading