Skip to content

Commit

Permalink
Use system copy of nlohmann_json on all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
chewi committed Feb 24, 2024
1 parent 9b49963 commit 47b00a0
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 11 deletions.
1 change: 1 addition & 0 deletions .codeql-prebuild-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ sudo apt-get install -y \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
nlohmann-json3-dev \
wget

# clean apt cache
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ jobs:
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
nlohmann-json3-dev \
wget
# clean apt cache
Expand Down Expand Up @@ -519,7 +520,7 @@ jobs:
- name: Setup Dependencies MacOS
run: |
# install dependencies using homebrew
brew install cmake curl miniupnpc node openssl opus pkg-config
brew install cmake curl miniupnpc nlohmann-json node openssl opus pkg-config
# fix openssl header not found
# ln -sf /usr/local/opt/openssl/include/openssl /usr/local/include/openssl
Expand Down Expand Up @@ -760,6 +761,7 @@ jobs:
diffutils
git
make
mingw-w64-nlohmann-json
mingw-w64-x86_64-binutils
mingw-w64-x86_64-boost
mingw-w64-x86_64-cmake
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
path = third-party/nanors
url = https://github.com/sleepybishop/nanors.git
branch = master
[submodule "third-party/nlohmann_json"]
path = third-party/nlohmann_json
url = https://github.com/nlohmann/json
branch = master
[submodule "third-party/nv-codec-headers"]
path = third-party/nv-codec-headers
url = https://github.com/FFmpeg/nv-codec-headers
Expand Down
2 changes: 1 addition & 1 deletion cmake/compile_definitions/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,4 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
${OPENSSL_LIBRARIES}
${CURL_LIBRARIES}
${PLATFORM_LIBRARIES}
nlohmann_json::nlohmann_json)
PkgConfig::NLOHMANN_JSON)
2 changes: 1 addition & 1 deletion cmake/dependencies/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pkg_check_modules(MINIUPNP miniupnpc REQUIRED)
include_directories(SYSTEM ${MINIUPNP_INCLUDE_DIRS})

# nlohmann_json
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/nlohmann_json")
pkg_check_modules(NLOHMANN_JSON nlohmann_json REQUIRED IMPORTED_TARGET)

# ffmpeg pre-compiled binaries
if(WIN32)
Expand Down
1 change: 1 addition & 0 deletions docker/clion-toolchain.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ apt-get install -y --no-install-recommends \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
nlohmann-json3-dev \
udev \
wget
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
Expand Down
1 change: 1 addition & 0 deletions docker/debian-bookworm.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ apt-get install -y --no-install-recommends \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
nlohmann-json3-dev \
nodejs \
npm \
udev \
Expand Down
1 change: 1 addition & 0 deletions docker/debian-bullseye.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ apt-get install -y --no-install-recommends \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
nlohmann-json3-dev \
udev \
wget
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
Expand Down
1 change: 1 addition & 0 deletions docker/fedora-38.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dnf -y install \
gcc-13.2.* \
gcc-c++-13.2.* \
git \
json-devel \
libappindicator-gtk3-devel \
libcap-devel \
libcurl-devel \
Expand Down
1 change: 1 addition & 0 deletions docker/fedora-39.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dnf -y install \
gcc-13.2.* \
gcc-c++-13.2.* \
git \
json-devel \
libappindicator-gtk3-devel \
libcap-devel \
libcurl-devel \
Expand Down
1 change: 1 addition & 0 deletions docker/ubuntu-20.04.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ apt-get install -y --no-install-recommends \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
nlohmann-json3-dev \
udev \
wget
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
Expand Down
1 change: 1 addition & 0 deletions docker/ubuntu-22.04.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ apt-get install -y --no-install-recommends \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
nlohmann-json3-dev \
udev \
wget
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
Expand Down
4 changes: 4 additions & 0 deletions docs/source/building/linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Install Requirements
libxfixes-dev \ # X11
libxrandr-dev \ # X11
libxtst-dev \ # X11
nlohmann-json3-dev \
nodejs \
npm \
nvidia-cuda-dev \ # Cuda, NvFBC
Expand All @@ -61,6 +62,7 @@ Install Requirements
gcc \
gcc-c++ \
intel-mediasdk-devel \ # x86_64 only
json-devel \
libappindicator-gtk3-devel \
libcap-devel \
libcurl-devel \
Expand Down Expand Up @@ -126,6 +128,7 @@ Install Requirements
libxfixes-dev \ # X11
libxrandr-dev \ # X11
libxtst-dev \ # X11
nlohmann-json3-dev \
nodejs \
npm \
wget # necessary for cuda install with `run` file
Expand Down Expand Up @@ -176,6 +179,7 @@ Install Requirements
libxfixes-dev \ # X11
libxrandr-dev \ # X11
libxtst-dev \ # X11
nlohmann-json3-dev \
nodejs \
npm \
nvidia-cuda-dev \ # CUDA, NvFBC
Expand Down
4 changes: 2 additions & 2 deletions docs/source/building/macos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ MacPorts
Install Requirements
.. code-block:: bash
sudo port install avahi boost180 cmake curl libopus miniupnpc npm9 pkgconfig
sudo port install avahi boost180 cmake curl libopus miniupnpc nlohmann-json npm9 pkgconfig
Homebrew
""""""""
Install Requirements
.. code-block:: bash
brew install boost cmake miniupnpc node opus pkg-config
brew install boost cmake miniupnpc nlohmann-json node opus pkg-config
# if there are issues with an SSL header that is not found:
cd /usr/local/include
ln -s ../opt/openssl/include/openssl .
Expand Down
1 change: 1 addition & 0 deletions docs/source/building/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Install dependencies:
gcc \
git \
make \
mingw-w64-nlohmann-json \
mingw-w64-x86_64-binutils \
mingw-w64-x86_64-boost \
mingw-w64-x86_64-cmake \
Expand Down
1 change: 1 addition & 0 deletions packaging/linux/Arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ makedepends=('boost'
'cmake'
'git'
'make'
'nlohmann-json'
'nodejs'
'npm')
optdepends=('cuda: NvFBC capture support'
Expand Down
3 changes: 2 additions & 1 deletion packaging/macos/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ post-fetch {
system -W ${worksrcpath} "${git.cmd} submodule update --init --recursive"
}

depends_build port:npm9 \
depends_build port:nlohmann-json \
port:npm9 \
port:pkgconfig

depends_lib port:avahi \
Expand Down
1 change: 0 additions & 1 deletion third-party/nlohmann_json
Submodule nlohmann_json deleted from 9cca28

0 comments on commit 47b00a0

Please sign in to comment.