Skip to content

Commit

Permalink
nlohmann from package managers (#4071)
Browse files Browse the repository at this point in the history
  • Loading branch information
briaguya-ai authored Apr 25, 2024
1 parent 3070fb4 commit a4fb677
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/apt-deps.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libusb-dev libusb-1.0-0-dev libsdl2-dev libsdl2-net-dev libpng-dev libglew-dev libzip-dev zipcmp zipmerge ziptool ninja-build
libusb-dev libusb-1.0-0-dev libsdl2-dev libsdl2-net-dev libpng-dev libglew-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev ninja-build
37 changes: 37 additions & 0 deletions .github/workflows/generate-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,21 @@ jobs:
cmake ..
make
sudo make install
- name: Install latest nlohmann
if: ${{ (matrix.os == 'ubuntu-20.04' && !vars.LINUX_COMPATIBILITY_RUNNER) }}
run: |
sudo apt-get remove nlohmann-json3-dev
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
if [ ! -d "json-3.11.3" ]; then
wget https://github.com/nlohmann/json/archive/refs/tags/v3.11.3.tar.gz
tar -xzvf v3.11.3.tar.gz
fi
cd json-3.11.3
mkdir build
cd build
cmake ..
make
sudo make install
- name: Install latest SDL_net
if: ${{ (matrix.os == 'ubuntu-20.04' && !vars.LINUX_COMPATIBILITY_RUNNER) || (matrix.os == 'ubuntu-22.04' && !vars.LINUX_PERFORMANCE_RUNNER) }}
run: |
Expand Down Expand Up @@ -247,6 +262,17 @@ jobs:
cmake -H.. -B. -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake
make
make install
cd ../..
wget https://github.com/nlohmann/json/archive/refs/tags/v3.11.3.tar.gz
tar -xzvf v3.11.3.tar.gz
cd json-3.11.3
mkdir build
cd build
cmake -H.. -B. -DJSON_BuildTests=OFF -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake
make
make install
cd ../..
- name: Fix dubious ownership error
if: ${{ vars.LINUX_RUNNER }}
run: git config --global --add safe.directory '*'
Expand Down Expand Up @@ -300,6 +326,17 @@ jobs:
cmake -H.. -B. -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/WiiU.cmake
make
make install
cd ../..
wget https://github.com/nlohmann/json/archive/refs/tags/v3.11.3.tar.gz
tar -xzvf v3.11.3.tar.gz
cd json-3.11.3
mkdir build
cd build
cmake -H.. -B. -DJSON_BuildTests=OFF -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/WiiU.cmake
make
make install
cd ../..
- uses: actions/checkout@v3
with:
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macports-deps.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libsdl2 +universal libsdl2_net +universal libpng +universal glew +universal libzip +universal
libsdl2 +universal libsdl2_net +universal libpng +universal glew +universal libzip +universal nlohmann-json +universal
3 changes: 3 additions & 0 deletions .github/workflows/test-builds-on-distros.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# todo:
# nlohmann

name: test-builds-on-distros
on:
workflow_dispatch: # by request
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(VCPKG_TARGET_TRIPLET x64-windows-static)

vcpkg_bootstrap()
vcpkg_install_packages(zlib bzip2 libzip libpng sdl2 sdl2-net glew glfw3)
vcpkg_install_packages(zlib bzip2 libzip libpng sdl2 sdl2-net glew glfw3 nlohmann-json)

if (CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache|sccache")
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
Expand Down
2 changes: 1 addition & 1 deletion OTRExporter
2 changes: 1 addition & 1 deletion libultraship
Submodule libultraship updated 1093 files

0 comments on commit a4fb677

Please sign in to comment.