From 031a9006e40fe987118faa558930535b04d981cc Mon Sep 17 00:00:00 2001 From: tritao Date: Fri, 18 Apr 2025 00:57:48 +0100 Subject: [PATCH] Use a Lua bindings spec file for Emscripten tests. --- tests/emscripten/bindings.lua | 23 +++++++++++++++++++++++ tests/emscripten/test.sh | 5 ++--- 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 tests/emscripten/bindings.lua diff --git a/tests/emscripten/bindings.lua b/tests/emscripten/bindings.lua new file mode 100644 index 00000000..ee1cb53b --- /dev/null +++ b/tests/emscripten/bindings.lua @@ -0,0 +1,23 @@ +generator "emscripten" +platform "emscripten" +architecture "wasm32" + +includedirs +{ + "..", + "../../include", +} + +output "gen" + +module "tests" + namespace "test" + headers + { + "Builtins.h", + "Classes.h", + "Classes2.h", + "Delegates.h", + "Enums.h", + "Overloads.h" + } diff --git a/tests/emscripten/test.sh b/tests/emscripten/test.sh index 2475b43c..fac30070 100755 --- a/tests/emscripten/test.sh +++ b/tests/emscripten/test.sh @@ -38,9 +38,8 @@ generate=true if [ $generate = true ]; then echo "${green}Generating bindings${reset}" - dotnet $rootdir/bin/${dotnet_configuration}_${platform}/CppSharp.CLI.dll \ - --gen=emscripten --platform=emscripten --arch=wasm32 --property=keywords \ - -I$dir/.. -I$rootdir/include -o $dir/gen -m tests $dir/../*.h + dotnet $rootdir/bin/${dotnet_configuration}/CppSharp.CLI.dll --property=keywords \ + $dir/bindings.lua fi echo "${green}Building generated binding files${reset}"