build: add the Exercise.addExecutable method

Currently addExecutable is called 3 times, unnecessarily making the code
more complex.

The method takes as argument the path to the exercises directory.

Additionally, use the new std.Build.ExecutableOptions.link_libc field.
The new field was added in ziglang/zig@adc9b77d5f on 2023-04-13.

Update the required Zig compiler version.
Note that I added the **current** zig version to the changelog, since
the reason for the change is known only to the person updating the
version.
This commit is contained in:
Manlio Perillo 2023-04-30 17:47:16 +02:00
parent 423cb5057e
commit 370337998e
3 changed files with 21 additions and 23 deletions

View file

@ -15,7 +15,7 @@ const print = if (@hasDecl(debug, "print")) debug.print else debug.warn;
// When changing this version, be sure to also update README.md in two places:
// 1) Getting Started
// 2) Version Changes
const needed_version_str = "0.11.0-dev.2560";
const needed_version_str = "0.11.0-dev.2704";
fn isCompatible() bool {
if (!@hasDecl(builtin, "zig_version") or !@hasDecl(std, "SemanticVersion")) {