Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate building more ports #7343

Closed
mcandre opened this issue Dec 8, 2020 · 2 comments
Closed

Automate building more ports #7343

mcandre opened this issue Dec 8, 2020 · 2 comments
Milestone

Comments

@mcandre
Copy link

mcandre commented Dec 8, 2020

I am excited to build as many ports of my applications as possible using zig's powerful cross-compilation system. As a Go programmer, I am used to tools like gox, goxcart, and xgo that automate the process of looping over available target triples, producing many different ports all at once.

What do you think of offering this functionality in the Zig build CLI? A flag like --all-targets or such would be helpful for quickly generating several binary ports. Ideally this would target only the stable target triples documented online.

https://github.com/ziglang/zig-bootstrap#supported-triples

Alternatively, the targets subcommand could be expanded to accept an optional --stable flag, which would limit the results to the stable triples.

Meanwhile, I could take a stab at writing a goxcart equivalent for Zig as a proof of concept. It's really just a for loop.

@ikskuh
Copy link
Contributor

ikskuh commented Dec 8, 2020

You can just do that with the zig build system already ;)

const targets = [_]std.zig.CrossTarget {
    …
};
for(targets) |target| {
    const exe = b.addExecutable("foo", "bar.zig");
    exe.setTarget(target);
    exe.install();
}

@andrewrk
Copy link
Member

andrewrk commented Dec 8, 2020

Sounds like a dupe of #3028

@andrewrk andrewrk closed this as completed Dec 8, 2020
@andrewrk andrewrk added this to the 0.8.0 milestone Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants