Skip to content

Commit e9b7da1

Browse files
move wit-bindgen check target to rake
1 parent 66c648c commit e9b7da1

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

ext/js/depend

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ link.filelist:
33

44
js.a: link.filelist
55

6-
.PHONY: check-bindgen
7-
check-bindgen: $(srcdir)/bindgen/rb-js-abi-host.wit
8-
@mkdir -p "$(@D)"
9-
wit-bindgen c --import $(srcdir)/bindgen/rb-js-abi-host.wit --out-dir $(srcdir)/bindgen
10-
116
js-core.o: $(srcdir)/bindgen/rb-js-abi-host.h
127

138
bindgen/%.o: $(srcdir)/bindgen/%.c

ext/js/extconf.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
require "mkmf"
22
$objs = ["js-core.o", "bindgen/rb-js-abi-host.o"]
3-
find_executable("wit-bindgen")
43
create_makefile("js")

ext/witapi/depend

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ link.filelist:
44

55
witapi.a: link.filelist
66

7-
.PHONY: check-bindgen
8-
check-bindgen: $(srcdir)/bindgen/rb-abi-guest.wit
9-
@mkdir -p "$(@D)"
10-
wit-bindgen c --export $(srcdir)/bindgen/rb-abi-guest.wit --out-dir $(srcdir)/bindgen
11-
127
witapi-core.o: $(srcdir)/bindgen/rb-abi-guest.h
138

149
bindgen/%.o: $(srcdir)/bindgen/%.c

ext/witapi/extconf.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
require "mkmf"
22
$objs = ["witapi-core.o", "bindgen/rb-abi-guest.o"]
3-
find_executable("wit-bindgen")
43
create_makefile("witapi")

tasks/check.rake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace :check do
2+
desc "Check wit-bindgen'ed sources are up-to-date"
3+
task :bindgen do
4+
RubyWasm::Toolchain.check_executable("wit-bindgen")
5+
wits = [
6+
["ext/witapi/bindgen/rb-abi-guest.wit", "--export"],
7+
["ext/js/bindgen/rb-js-abi-host.wit", "--import"],
8+
]
9+
wits.each do |wit|
10+
path, mode = wit
11+
sh "wit-bindgen c #{mode} #{path} --out-dir #{File.dirname(path)}"
12+
end
13+
end
14+
end

0 commit comments

Comments
 (0)