flst / bazel /test_external /hello-embind.cc
arudradey's picture
Upload folder using huggingface_hub
00df61d verified
Raw
History Blame Contribute Delete
355 Bytes
#include <emscripten/bind.h>
using namespace emscripten;
class HelloClass {
public:
static std::string SayHello(const std::string &name) {
return "Yo! " + name;
};
};
EMSCRIPTEN_BINDINGS(Hello) {
emscripten::class_<HelloClass>("HelloClass")
.constructor<>()
.class_function("SayHello", &HelloClass::SayHello);
}