Commit Graph
5 Commits
Author SHA1 Message Date
sneeker beb29eb0af fix(build): handle assembly and reject sources meowc cannot compile 2022-07-25 11:49:47 +00:00
sneeker 03de4455dc refactor(lib): delete the code nothing reaches 2022-07-24 18:55:09 +00:00
sneeker f3a0b6ca17 feat(run): run blocks for commands the build does not produce 2022-07-21 16:25:46 +00:00
sneeker 38889de6e6 feat(toolchain): cross compile through target triples and sysroots
A triple is set with --target or a target field in the toolchain block, and
everything derived from it follows: platform, arch and the conditionals built
on them come from the triple rather than uname, so a build file can branch on
the platform it is building for instead of the one it is running on.

Tools are taken from the triple prefix when a matching toolchain is installed
(x86_64-w64-mingw32-gcc, -ar, -ranlib) and otherwise the host compiler is
invoked with --target, which covers clang without a prefixed toolchain. An
explicit cc, cxx, ar or ranlib in the build file always wins over the derived
one. --sysroot adds --sysroot to both the compile and link lines.

Each triple gets its own build directory and probe cache under builddir, so a
host tree and a cross tree do not invalidate each other and neither reruns the
other's checks. Probes never execute what they compile, sizeof included, so the
configure stage needed no changes to work against a foreign target.

Executables and shared libraries now take the extension the target platform
uses. Without that the graph expected bin/app while mingw wrote bin/app.exe,
and the link step repeated on every build.

Verified against x86_64-w64-mingw32, which produces a PE32+ binary, and
aarch64-linux-gnu through clang, which produces AArch64 objects.
2022-07-16 01:16:10 +00:00
sneeker 53ac3ffb4c feat(types): define resolved project, target and rule records
Targets carry sources, includes, flags and uses; rule instances carry resolved
inputs and outputs. This is the shape every later stage consumes.
2022-05-26 00:17:18 +00:00