class

Quartz::Build::Compiler

Inherits Reference < Object

Compiles one source file at a time via arm-none-eabi-gcc/g++/as. Object files land under out_dir/ named after the source's basename + a short content hash so two sources with the same name don't collide.

Incrementality: an object is considered fresh when its mtime is newer than the source and the cached args-hash sidecar matches the current args. When either check fails we recompile.

Constructors

new(toolchain : Toolchain, opts : SdkOpts, sdk_root : String | Path, out_dir : String | Path, runner : Runner | Nil = nil)
Source

Instance methods

command_for(file : Sources::File) : Tuple(String, Array(String))

Build the full (program, args) pair for a source. Exposed for tests that want to assert flag composition without running anything.

Source
compile(file : Sources::File) : String

Compile one source → returns path to its .o. Raises CompileFailed on non-zero exit. Idempotent: no-op if the cached object is fresh.

Source
compile_all(files : Array(Sources::File)) : Array(String)

Compile all files in bulk. Stops on first failure.

Source
object_path_for(file : Sources::File) : String

out_dir/<basename>-<sha8>.o — short hash guards against name collisions between e.g. foo/util.c and bar/util.c.

Source
opts
Source
out_dir
Source
sdk_root
Source
toolchain
Source

Nested types