From f5bf5ba5170058f9a9634438f7ff06f1a02e1da6 Mon Sep 17 00:00:00 2001 From: Anders Leino Date: Wed, 25 Sep 2024 10:24:51 +0300 Subject: Enable emscripten builds to compile slang.dll to WebAssembly. (#5131) * Compile fixes for Wasm The issues are all are due to 'long' types being 32 bits on WASM. - class members redeclared errors - << with StringBuilder and unsigned long is ambiguous This helps to address issue #5115. * Use the host executable suffix for generators Since the generators are run at build-time, we should not use CMAKE_EXECUTABLE_SUFFIX, which is the suffix for the target platform. Instead, define CMAKE_HOST_EXECUTABLE_SUFFIX as appropriate, and use that suffix instead. This helps to address issue #5115. * Add support for Wasm as a platform This helps to address issue #5115. * Add emscripten build This closes #5115. --- source/slang/slang-ast-dump.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-ast-dump.cpp') diff --git a/source/slang/slang-ast-dump.cpp b/source/slang/slang-ast-dump.cpp index a1ab7a5c8..b3a554e6d 100644 --- a/source/slang/slang-ast-dump.cpp +++ b/source/slang/slang-ast-dump.cpp @@ -304,9 +304,9 @@ struct ASTDumpContext void dump(uint32_t v) { - m_writer->emit(UInt(v)); + m_writer->emit((uint64_t)v); } - void dump(UInt v) + void dump(uint64_t v) { m_writer->emit(v); } -- cgit v1.2.3