Skip to content

Commit a2ffc0c

Browse files
Provide default link.filelist for conventional exts
1 parent dbde834 commit a2ffc0c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Rakefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ namespace :build do
344344
sh "#{build.baseruby_path} #{extconf_args.join(" ")}", chdir: objdir
345345
make_cmd = %Q(make -C "#{objdir}" #{make_args.join(" ")} static)
346346
sh make_cmd
347+
# A ext can provide link args by link.filelist. It contains only built archive file by default.
348+
unless File.exist?("#{objdir}/link.filelist")
349+
File.write("#{objdir}/link.filelist", Dir.glob("#{objdir}/*.a").join("\n"))
350+
end
347351
end
348352
mkdir_p File.dirname(build.extinit_obj)
349353
sh %Q(ruby #{base_dir}/ext/extinit.c.erb #{libs.join(" ")} | #{cc} -c -x c - -o #{build.extinit_obj})

0 commit comments

Comments
 (0)