mkvtoolnix/rake.d/library.rb
Moritz Bunkus 7e600c7e70 build system: centralize runq output
That way adjusting to a uniform width is easier.
2016-03-26 12:34:52 +01:00

30 lines
744 B
Ruby

class Library < Target
def initialize(name)
super name
@build_dll = false
end
def build_dll(build_dll_as_well = true)
@build_dll = build_dll_as_well
self
end
def create_specific
file "#{@target}.a" => @objects do |t|
FileUtils.rm_f t.name
runq "ar", t.name, "#{c(:AR)} rc #{t.name} #{@objects.join(" ")}"
runq "ranlib", t.name, "#{c(:RANLIB)} #{t.name}"
end
return self unless @build_dll
file "#{@target}.dll" => @objects do |t|
runq "link", t.name, <<-COMMAND
#{c(:CXX)} #{$flags[:ldflags]} #{$system_libdirs} -shared -Wl,--export-all -Wl,--out-implib=#{t.name}.a -o #{t.name} #{@objects.join(" ")} #{@libraries.join(" ")}
COMMAND
end
self
end
end