File tree Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,6 @@ link.filelist:
3
3
4
4
js.a: link.filelist
5
5
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
-
11
6
js-core.o: $(srcdir)/bindgen/rb-js-abi-host.h
12
7
13
8
bindgen/%.o: $(srcdir)/bindgen/%.c
Original file line number Diff line number Diff line change 1
1
require "mkmf"
2
2
$objs = [ "js-core.o" , "bindgen/rb-js-abi-host.o" ]
3
- find_executable ( "wit-bindgen" )
4
3
create_makefile ( "js" )
Original file line number Diff line number Diff line change @@ -4,11 +4,6 @@ link.filelist:
4
4
5
5
witapi.a: link.filelist
6
6
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
-
12
7
witapi-core.o: $(srcdir)/bindgen/rb-abi-guest.h
13
8
14
9
bindgen/%.o: $(srcdir)/bindgen/%.c
Original file line number Diff line number Diff line change 1
1
require "mkmf"
2
2
$objs = [ "witapi-core.o" , "bindgen/rb-abi-guest.o" ]
3
- find_executable ( "wit-bindgen" )
4
3
create_makefile ( "witapi" )
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments