summaryrefslogtreecommitdiff
path: root/scripts/gen-wasm2c-templates.cmake
diff options
context:
space:
mode:
authorKeith Winstein <keithw@cs.stanford.edu>2022-09-20 22:59:47 -0700
committerGitHub <noreply@github.com>2022-09-21 05:59:47 +0000
commit608d23e5f9e5b377ccb455224d68f6f3e3cb3017 (patch)
tree8afd0a38f7bce126fcf296270f18edcaf806b64f /scripts/gen-wasm2c-templates.cmake
parent65ce49a6d307b101aa058da8269e1ccae43feeb9 (diff)
downloadwabt-608d23e5f9e5b377ccb455224d68f6f3e3cb3017.tar.gz
wabt-608d23e5f9e5b377ccb455224d68f6f3e3cb3017.tar.bz2
wabt-608d23e5f9e5b377ccb455224d68f6f3e3cb3017.zip
wasm2c: implement the bulk memory operations proposal (#1877)
Co-authored-by: Yuhan Deng <yhdeng@stanford.edu>
Diffstat (limited to 'scripts/gen-wasm2c-templates.cmake')
-rw-r--r--scripts/gen-wasm2c-templates.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/gen-wasm2c-templates.cmake b/scripts/gen-wasm2c-templates.cmake
index 99a61d03..3fc387f9 100644
--- a/scripts/gen-wasm2c-templates.cmake
+++ b/scripts/gen-wasm2c-templates.cmake
@@ -1,4 +1,5 @@
# https://stackoverflow.com/a/47801116
file(READ ${in} content)
-set(content "const char* ${symbol} = R\"w2c_template(${content})w2c_template\";")
+string(REGEX REPLACE "(.[^\n]*\n)" "R\"w2c_template(\\1)w2c_template\"\n" content "${content}")
+set(content "const char* ${symbol} = ${content};")
file(WRITE ${out} "${content}")