Skip to content

Commit ba33ad3

Browse files
Repsect BuildTask's naming scheme
1 parent bbb016d commit ba33ad3

File tree

2 files changed

+36
-37
lines changed

2 files changed

+36
-37
lines changed

Rakefile

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -82,44 +82,45 @@ LIB_ROOT = File.dirname(__FILE__)
8282
TOOLCHAINS = {}
8383

8484
namespace :build do
85-
BUILDS.each do |params|
86-
name = "#{params[:src]}-#{params[:target]}-#{params[:profile]}"
87-
source = BUILD_SOURCES[params[:src]].merge(name: params[:src])
88-
profile = BUILD_PROFILES[params[:profile]]
89-
options = {
90-
src: source,
91-
target: params[:target],
92-
default_exts: profile[:default_exts]
93-
}
94-
debug = profile[:debug]
95-
RubyWasm::BuildTask.new(name, **options) do |t|
96-
if debug
97-
t.crossruby.debugflags = %w[-g]
98-
t.crossruby.wasmoptflags = %w[-O3 -g]
99-
t.crossruby.ldflags = %w[
100-
-Xlinker
101-
--stack-first
102-
-Xlinker
103-
-z
104-
-Xlinker
105-
stack-size=16777216
106-
]
107-
else
108-
t.crossruby.debugflags = %w[-g0]
109-
t.crossruby.ldflags = %w[-Xlinker -zstack-size=16777216]
110-
end
85+
BUILD_TASKS =
86+
BUILDS.map do |params|
87+
name = "#{params[:src]}-#{params[:target]}-#{params[:profile]}"
88+
source = BUILD_SOURCES[params[:src]].merge(name: params[:src])
89+
profile = BUILD_PROFILES[params[:profile]]
90+
options = {
91+
src: source,
92+
target: params[:target],
93+
default_exts: profile[:default_exts]
94+
}
95+
debug = profile[:debug]
96+
RubyWasm::BuildTask.new(name, **options) do |t|
97+
if debug
98+
t.crossruby.debugflags = %w[-g]
99+
t.crossruby.wasmoptflags = %w[-O3 -g]
100+
t.crossruby.ldflags = %w[
101+
-Xlinker
102+
--stack-first
103+
-Xlinker
104+
-z
105+
-Xlinker
106+
stack-size=16777216
107+
]
108+
else
109+
t.crossruby.debugflags = %w[-g0]
110+
t.crossruby.ldflags = %w[-Xlinker -zstack-size=16777216]
111+
end
111112

112-
toolchain = t.toolchain
113-
t.crossruby.user_exts =
114-
profile[:user_exts].map do |ext|
115-
srcdir = File.join(LIB_ROOT, "ext", ext)
116-
RubyWasm::CrossRubyExtProduct.new(srcdir, toolchain)
113+
toolchain = t.toolchain
114+
t.crossruby.user_exts =
115+
profile[:user_exts].map do |ext|
116+
srcdir = File.join(LIB_ROOT, "ext", ext)
117+
RubyWasm::CrossRubyExtProduct.new(srcdir, toolchain)
118+
end
119+
unless TOOLCHAINS.key? toolchain.name
120+
TOOLCHAINS[toolchain.name] = toolchain
117121
end
118-
unless TOOLCHAINS.key? toolchain.name
119-
TOOLCHAINS[toolchain.name] = toolchain
120122
end
121123
end
122-
end
123124

124125
desc "Clean build directories"
125126
task :clean do

tasks/packaging.rake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ NPM_RELEASE_ARTIFACTS = [
100100
"npm-ruby-head-wasm-wasi",
101101
"npm-ruby-3_2-wasm-wasi",
102102
]
103-
RELASE_ARTIFACTS = BUILDS.map do |build|
104-
"ruby-#{build[:src]}-#{build[:target]}-#{build[:profile]}"
105-
end + NPM_RELEASE_ARTIFACTS
103+
RELASE_ARTIFACTS = BUILD_TASKS.map{ |build| build.name } + NPM_RELEASE_ARTIFACTS
106104

107105
def release_note
108106
output = <<EOS

0 commit comments

Comments
 (0)