blob: 3523b8aa4763d7cc7e286e8cc556e8845bfa565a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#
# WebAssembly bindings for Slang
#
# This is an executable target because emcmake produces .a files without bindings if you just create a static library
# https://stackoverflow.com/questions/63622009/static-library-built-with-cmake-as-a-with-emscripten-instead-of-wasm-js
if(EMSCRIPTEN)
slang_add_target(
.
EXECUTABLE
EXCLUDE_FROM_ALL
USE_FEWER_WARNINGS
LINK_WITH_PRIVATE
miniz
lz4_static
slang
core
compiler-core
slang-capability-defs
slang-capability-lookup
slang-fiddle-output
slang-lookup-tables
INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR}/include .
)
# To generate binding code
target_link_options(
slang-wasm
PUBLIC
"--bind"
"--emit-tsd" "interface.d.ts"
"-sEXPORT_ES6=1"
"-sMODULARIZE=1"
"-sEXPORTED_RUNTIME_METHODS=['FS']"
)
endif()
|