Skip to content

Commit b892f7d

Browse files
author
Jin Huang
committed
minor fixes
1 parent 9784c23 commit b892f7d

File tree

4 files changed

+7
-21
lines changed

4 files changed

+7
-21
lines changed

bazel/test_external/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
bazel-*
2-
dist/

bazel/test_external/BUILD

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ load("@emsdk//emscripten_toolchain:wasm_rules.bzl", "wasm_cc_binary")
33
cc_binary(
44
name = "hello-world",
55
srcs = ["hello-world.cc"],
6-
linkopts = [
7-
"--bind",
8-
],
6+
linkopts = ["--bind"],
97
)
108

119
wasm_cc_binary(
1210
name = "hello-world-wasm",
1311
cc_target = ":hello-world",
1412
)
15-

bazel/test_external/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

bazel/test_external/hello-world.cc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1+
#include <iostream>
2+
13
#ifdef __EMSCRIPTEN__
24
#include <emscripten.h>
35
#include <emscripten/bind.h>
46
using namespace emscripten;
57
#endif
68

7-
#include <iostream>
8-
99
void sayHello() {
1010
std::cout << "hello" << std::endl;
1111
}
1212

1313
#ifdef __EMSCRIPTEN__
14-
EMSCRIPTEN_BINDINGS(aa) {
14+
EMSCRIPTEN_BINDINGS(hello) {
1515
function("sayHello", &sayHello);
1616
}
17-
#else
17+
#endif
18+
1819
int main(int argc, char** argv) {
19-
std::cout << "start main function" << std::endl;
20-
sayHello();
21-
std::cout << "end main function" << std::endl;
20+
std::cout << "hello world!" << std::endl;
2221
return 0;
2322
}
24-
#endif

0 commit comments

Comments
 (0)