Add Size builder - close #143
This commit is contained in:
1 parent
a316c4f922
commit
610b8f1266
6 files changed
+65
No files matched your search
@@ -33,6 +33,7 @@ module Rscons
|
||||
:Program,
|
||||
:SharedLibrary,
|
||||
:SharedObject,
|
||||
:Size,
|
||||
]
|
||||
|
||||
# Class to represent a fatal error during an Rscons operation.
|
||||
@@ -146,6 +147,7 @@ require_relative "rscons/builders/program"
|
||||
require_relative "rscons/builders/shared_library"
|
||||
require_relative "rscons/builders/shared_object"
|
||||
require_relative "rscons/builders/simple_builder"
|
||||
require_relative "rscons/builders/size"
|
||||
|
||||
# language support
|
||||
require_relative "rscons/builders/lang/asm"
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
module Rscons
|
||||
module Builders
|
||||
# Run the "size" utility on an executable and store its results in the
|
||||
# target file.
|
||||
# input file.
|
||||
#
|
||||
# Examples::
|
||||
# env.Size("^/project.size", "^/project.elf")
|
||||
class Size < Builder
|
||||
|
||||
# Run the builder to produce a build target.
|
||||
def run(options)
|
||||
if @command
|
||||
finalize_command
|
||||
else
|
||||
@vars["_SOURCES"] = @sources
|
||||
command = @env.build_command("${SIZECMD}", @vars)
|
||||
standard_command("Size <source>#{Util.short_format_paths(@sources)}<reset> => <target>#{@target}<reset>", command, stdout: @target)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -80,6 +80,9 @@ module Rscons
|
||||
"SHLIBLINKPREFIX" => "-l",
|
||||
"SHLIBPREFIX" => on_windows ? "" : "lib",
|
||||
"SHLIBSUFFIX" => on_windows ? ".dll" : ".so",
|
||||
"SIZE" => "size",
|
||||
"SIZECMD" => %w[${SIZE} ${SIZEFLAGS} ${_SOURCES}],
|
||||
"SIZEFLAGS" => [],
|
||||
"YACC" => "bison",
|
||||
"YACCSUFFIX" => %w[.y .yy],
|
||||
"YACC_CMD" => %w[${YACC} ${YACC_FLAGS} -o ${_TARGET} ${_SOURCES}],
|
||||
|
||||
Reference in new issue
Block a user