Mercurial
view third_party/emsdk/bazel/test_external/hello-embind.cc @ 179:8d17f6e6e290
[ThirdParty] Added emsdk bazel rules that can be supported by bazel 9.0.0
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Thu, 22 Jan 2026 21:23:17 -0800 |
| parents | |
| children |
line wrap: on
line source
#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); }