Skip to content

Commit 4cca3b9

Browse files
authored
Fix warning and add emscripten CI step (#4738)
* 🚨 fix warning Signed-off-by: Niels Lohmann <[email protected]> * 👷 add emscripten Signed-off-by: Niels Lohmann <[email protected]> * 👷 add emscripten Signed-off-by: Niels Lohmann <[email protected]> * 👷 add emscripten Signed-off-by: Niels Lohmann <[email protected]> * 👷 add emscripten Signed-off-by: Niels Lohmann <[email protected]> * 👷 add emscripten Signed-off-by: Niels Lohmann <[email protected]> * 👷 add emscripten Signed-off-by: Niels Lohmann <[email protected]> * 👷 add emscripten Signed-off-by: Niels Lohmann <[email protected]> * 👷 add emscripten Signed-off-by: Niels Lohmann <[email protected]> * 👷 add emscripten Signed-off-by: Niels Lohmann <[email protected]> * 📝 add compiler to list Signed-off-by: Niels Lohmann <[email protected]> --------- Signed-off-by: Niels Lohmann <[email protected]>
1 parent 93e9573 commit 4cca3b9

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

Diff for: .github/workflows/ubuntu.yml

+18
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,24 @@ jobs:
233233
. /opt/intel/oneapi/setvars.sh
234234
cmake --build build --target ci_icpc
235235
236+
ci_emscripten:
237+
runs-on: ubuntu-latest
238+
steps:
239+
- name: Harden Runner
240+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
241+
with:
242+
egress-policy: audit
243+
244+
- name: Install emscripten
245+
uses: mymindstorm/setup-emsdk@v14
246+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
247+
- name: Get latest CMake and ninja
248+
uses: lukka/get-cmake@57c20a23a6cac5b90f31864439996e5b206df9dc # v4.0.1
249+
- name: Run CMake
250+
run: cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -GNinja
251+
- name: Build
252+
run: cmake --build build
253+
236254
ci_test_documentation:
237255
runs-on: ubuntu-latest
238256
strategy:

Diff for: docs/mkdocs/docs/community/quality_assurance.md

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ violations will result in a failed build.
5757
| Clang 19.1.7 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
5858
| Clang 20.1.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
5959
| Clang 21.0.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
60+
| Emscripten 4.0.6 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
6061
| GNU 4.8.5 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
6162
| GNU 4.9.3 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
6263
| GNU 5.5.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |

Diff for: include/nlohmann/detail/output/serializer.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ class serializer
762762

763763
// jump to the end to generate the string from backward,
764764
// so we later avoid reversing the result
765-
buffer_ptr += n_chars;
765+
buffer_ptr += static_cast<typename decltype(number_buffer)::difference_type>(n_chars);
766766

767767
// Fast int2ascii implementation inspired by "Fastware" talk by Andrei Alexandrescu
768768
// See: https://www.youtube.com/watch?v=o4-CwDo2zpg

Diff for: single_include/nlohmann/json.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19483,7 +19483,7 @@ class serializer
1948319483

1948419484
// jump to the end to generate the string from backward,
1948519485
// so we later avoid reversing the result
19486-
buffer_ptr += n_chars;
19486+
buffer_ptr += static_cast<typename decltype(number_buffer)::difference_type>(n_chars);
1948719487

1948819488
// Fast int2ascii implementation inspired by "Fastware" talk by Andrei Alexandrescu
1948919489
// See: https://www.youtube.com/watch?v=o4-CwDo2zpg

0 commit comments

Comments
 (0)