Skip to content

Commit 40d24e7

Browse files
author
Julian LALU
committed
Improve wasm uuid
1 parent 4e56d00 commit 40d24e7

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.github/workflows/ubuntu_wasm.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ jobs:
2020
run: ctest --test-dir target -C Debug -T test --output-on-failure -VV
2121
- name: Release
2222
run: |
23-
xcopy target\test\test_core.js release\ /s /y
24-
xcopy target\test\test_core.wasm release\ /s /y
25-
xcopy target\test\test_core_report.xml release\ /s /y
26-
xcopy target\src\libcore.a release\ /s /y
27-
xcopy interface\core release\core\ /s /y
23+
mkdir -p release
24+
cp -R target\test\test_core.js release -i
25+
cp -R target\test\test_core.wasm release -i
26+
cp -R target/test/test_core_report.xml release -i
27+
cp -R target/src/libcore.a release -i
28+
cp -R interface/core release/core -i
2829
- name: Upload artifacts
2930
uses: actions/upload-artifact@v4
3031
with:

interface/core/uuid/uuid_linux.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ namespace hud::linux
4444
// LCOV_EXCL_STOP
4545
#elif defined(HD_OS_BROWSER)
4646
EM_ASM({
47-
const crypto = require('crypto');
47+
if (typeof window.crypto === 'undefined') {
48+
const crypto = require('crypto');
49+
}
4850
var bytes = new Uint8Array(16);
4951
crypto.getRandomValues(bytes);
50-
// Copier les octets dans la mémoire partagée de WebAssembly
5152
for (var i = 0; i < 16; i++) {
5253
HEAPU8[$0 + i] = bytes[i];
5354
} }, &bytes[0]);

0 commit comments

Comments
 (0)