Skip to content

Commit c4de20f

Browse files
feat: add boost
1 parent e0d5524 commit c4de20f

9 files changed

Lines changed: 1555 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,27 @@ env:
2727

2828
jobs:
2929
build:
30-
name: Build (${{ matrix.name }})
30+
name: Build ${{ matrix.build }} (${{ matrix.name }})
3131
runs-on: ${{ matrix.os }}
3232
# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
3333
# https://trac.ffmpeg.org/wiki/CompilationGuide/macOS
3434
# https://trac.ffmpeg.org/wiki/CompilationGuide/MinGW
3535
strategy:
36-
fail-fast: false # false to test all, true to fail entire job if any fail
36+
fail-fast: false
3737
matrix:
38+
name: # these are ordered by average build time, longest first
39+
- FreeBSD-aarch64
40+
- FreeBSD-amd64
41+
- Windows-AMD64
42+
- Windows-ARM64
43+
- Darwin-arm64
44+
- Darwin-x86_64
45+
- Linux-aarch64
46+
- Linux-ppc64le
47+
- Linux-x86_64
48+
build:
49+
- BOOST
50+
- FFMPEG
3851
include:
3952
- name: Linux-x86_64 # ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}
4053
os: ubuntu-22.04
@@ -327,6 +340,7 @@ jobs:
327340
"diffutils"
328341
"git"
329342
"make"
343+
"patch"
330344
"pkg-config"
331345
"mingw-w64-${TOOLCHAIN}-binutils"
332346
"mingw-w64-${TOOLCHAIN}-cmake"
@@ -489,6 +503,8 @@ jobs:
489503
-B build \
490504
-S . \
491505
-G "${{ matrix.generator }}" \
506+
-DBUILD_ALL=OFF \
507+
-DBUILD_${{ matrix.build }}=ON \
492508
-DCMAKE_TOOLCHAIN_FILE=${{ env.CMAKE_TOOLCHAIN_FILE }} \
493509
-DCMAKE_INSTALL_PREFIX="${{ env.ROOT_PATH }}/build/dist" \
494510
-DPARALLEL_BUILDS=${{ steps.processor_count.outputs.PROCESSOR_COUNT || 1 }}
@@ -506,7 +522,9 @@ jobs:
506522
${{ env.MAKE_CMD }} -C build install
507523
508524
- name: Debug logs
509-
if: always()
525+
if: >-
526+
always() &&
527+
matrix.build == 'FFMPEG'
510528
shell: bash
511529
run: |
512530
echo "::group::x264 config.log"
@@ -529,13 +547,15 @@ jobs:
529547

530548
- name: Cleanup
531549
shell: bash
532-
run: rm -f -r ./build/dist/share
550+
run: |
551+
rm -f -r ./build/dist/share
552+
rm -f -r ./build/dist/lib/cmake
533553
534554
- name: Upload Artifacts
535555
uses: actions/upload-artifact@v4
536556
with:
537557
if-no-files-found: error
538-
name: ${{ matrix.name }}
558+
name: ${{ matrix.name }}-${{ matrix.build }}
539559
path: ./build/dist
540560

541561
update_dist:

CMakeLists.txt

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ project(build-deps
77

88
# Main options
99
option(BUILD_ALL "Build all dependencies" ON)
10-
option(BUILD_ALL_SUNSHINE "Build all Sunshine dependencies" ON)
10+
option(BUILD_ALL_LIBDISPLAYDEVICE "Build all libdisplaydevice dependencies" OFF)
11+
option(BUILD_ALL_SUNSHINE "Build all Sunshine dependencies" OFF)
12+
13+
# Boost options
14+
option(BUILD_BOOST "Build Boost" OFF)
15+
option(BUILD_BOOST_LIBDISPLAYDEVICE "Build boost for libdisplaydevice" ON)
16+
option(BUILD_BOOST_SUNSHINE "Build boost for Sunshine" ON)
1117

1218
# FFmpeg options
13-
option(BUILD_FFMPEG "Build FFmpeg" ON)
19+
option(BUILD_FFMPEG "Build FFmpeg" OFF)
1420
option(BUILD_FFMPEG_ALL_PATCHES "Apply FFmpeg patches" ON)
1521
option(BUILD_FFMPEG_AMF "Build FFmpeg AMF" ON)
1622
option(BUILD_FFMPEG_AMF_PATCHES "Apply FFmpeg AMF patches" ON)
@@ -33,6 +39,10 @@ option(BUILD_FFMPEG_X265_PATCHES "Apply FFmpeg x265 patches" ON)
3339
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/apply_git_patch.cmake)
3440
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/unix_path.cmake)
3541

42+
# CPM
43+
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cpm/CPM.cmake)
44+
CPMUsePackageLock(package-lock.cmake)
45+
3646
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
3747
set(FREEBSD ON)
3848
endif()
@@ -200,6 +210,15 @@ message(STATUS "Detected system name: ${CMAKE_SYSTEM_NAME}")
200210
message(STATUS "Detected architecture: ${CMAKE_SYSTEM_PROCESSOR}")
201211
message(STATUS "CI Matrix name should be: '${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}'")
202212

213+
# boost
214+
# TODO: boost build fails on Windows due to NASM errors during configure?
215+
# https://github.com/Orphis/boost-cmake/issues/42
216+
# https://github.com/libsdl-org/SDL/issues/10250
217+
if(BUILD_ALL OR BUILD_ALL_LIBDISPLAYDEVICE OR BUILD_ALL_SUNSHINE OR BUILD_BOOST)
218+
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/boost/_main.cmake)
219+
endif()
220+
221+
# FFmpeg
203222
if(BUILD_ALL OR BUILD_ALL_SUNSHINE OR BUILD_FFMPEG)
204223
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ffmpeg/_main.cmake)
205224
endif()

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

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

7+
- [Boost](https://www.boost.org)
78
- [FFmpeg](https://ffmpeg.org)
89

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

20-
## Plans
21-
22-
- [ ] Add more dependencies
23-
- [ ] boost
24-
- [ ] cuda (developer toolkit)
25-
- [ ] build linux dependencies in Docker (to more closely align with target environments)
26-
2721
## License
2822

2923
This repo is licensed under the MIT License, but this does not cover submodules or patches.
@@ -159,6 +153,7 @@ pacman -S \
159153
diffutils \
160154
git \
161155
make \
156+
patch \
162157
pkg-config \
163158
mingw-w64-ucrt-x86_64-binutils \
164159
mingw-w64-ucrt-x86_64-cmake \
@@ -179,6 +174,7 @@ pacman -S \
179174
diffutils \
180175
git \
181176
make \
177+
patch \
182178
pkg-config \
183179
mingw-w64-clang-aarch64-binutils \
184180
mingw-w64-clang-aarch64-cmake \

cmake/boost/_main.cmake

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
CPMGetPackage(Boost)
2+
3+
if(BUILD_BOOST_SUNSHINE)
4+
set(BUILD_BOOST_LIBDISPLAYDEVICE ON)
5+
endif()
6+
7+
list(APPEND BOOST_COMPONENTS_BASE
8+
asio
9+
crc
10+
format
11+
process
12+
property_tree
13+
)
14+
15+
if(BUILD_BOOST_LIBDISPLAYDEVICE)
16+
list(APPEND BOOST_COMPONENTS
17+
algorithm
18+
preprocessor
19+
scope
20+
uuid
21+
)
22+
endif()
23+
if(BUILD_BOOST_SUNSHINE)
24+
list(APPEND BOOST_COMPONENTS
25+
filesystem
26+
locale
27+
log
28+
program_options
29+
system
30+
)
31+
endif()
32+
33+
set(BOOST_ENABLE_CMAKE ON) # Use experimental superproject to pull library dependencies recursively
34+
set(BOOST_INCLUDE_LIBRARIES ${BOOST_COMPONENTS_BASE} ${BOOST_COMPONENTS})
35+
set(BOOST_SKIP_INSTALL_RULES OFF) # disabled to allow installation of Boost libraries
36+
set(Boost_USE_STATIC_LIBS ON) # cmake-lint: disable=C0103
37+
38+
message(STATUS "Boost_BINARY_DIR: ${Boost_BINARY_DIR}")
39+
message(STATUS "Boost_SOURCE_DIR: ${Boost_SOURCE_DIR}")
40+
41+
if(WIN32)
42+
# Windows build is failing to create header file in this directory
43+
file(MAKE_DIRECTORY ${Boost_BINARY_DIR}/libs/log/src/windows)
44+
endif()
45+
46+
add_subdirectory(${Boost_SOURCE_DIR} ${Boost_BINARY_DIR} SYSTEM)

cmake/cpm/.cmake-lint-ignore

Whitespace-only changes.

0 commit comments

Comments
 (0)