2016-05-29 06:08:45 +03:00
|
|
|
# frozen_string_literal: false
|
2016-05-29 18:10:44 +03:00
|
|
|
def auto_ext(feat = $0[%r[/ext/(-test-/.*)/extconf.rb\z], 1], inc: false)
|
2016-05-29 06:08:45 +03:00
|
|
|
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)" if inc
|
|
|
|
$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
|
|
|
|
inits = $srcs.map {|s| File.basename(s, ".*")}
|
|
|
|
inits.delete("init")
|
|
|
|
inits.map! {|s|"X(#{s})"}
|
|
|
|
$defs << "-DTEST_INIT_FUNCS(X)=\"#{inits.join(' ')}\""
|
2021-08-24 07:15:47 +03:00
|
|
|
create_header
|
2016-05-29 06:08:45 +03:00
|
|
|
create_makefile(feat)
|
|
|
|
end
|