Mercurial
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 178:94705b5986b3 | 179:8d17f6e6e290 |
|---|---|
| 1 #include <emscripten/bind.h> | |
| 2 | |
| 3 using namespace emscripten; | |
| 4 | |
| 5 class HelloClass { | |
| 6 public: | |
| 7 static std::string SayHello(const std::string &name) { | |
| 8 return "Yo! " + name; | |
| 9 }; | |
| 10 }; | |
| 11 | |
| 12 EMSCRIPTEN_BINDINGS(Hello) { | |
| 13 emscripten::class_<HelloClass>("HelloClass") | |
| 14 .constructor<>() | |
| 15 .class_function("SayHello", &HelloClass::SayHello); | |
| 16 } |