zig icon indicating copy to clipboard operation
zig copied to clipboard

add documentation for the zig build system

Open andrewrk opened this issue 6 years ago • 6 comments

extracted from #367

  • explain purpose, it's supposed to replace make/cmake
  • example of building a zig executable
  • example of building a C library
  • go over all the API in std/build.zig and make sure it's all documented
  • fix #1035

andrewrk avatar Sep 13 '18 19:09 andrewrk

After reviewing #4402 I realized this is actually a rather difficult issue, and so removed the "contributor friendly" label. Sorry about that.

andrewrk avatar Mar 09 '20 17:03 andrewrk

If we could document at least the bare minimum things people might want to be able to do, that would be cool.

  • build an executable
  • build a zig library
  • build an executable that depends on a zig library somewhere else
  • build an executable that depends on a header not in a standard path
  • link to a library that is not in a standard path

matjam avatar Jun 11 '20 05:06 matjam

@MasterQ32 has a "zig build explained" series at https://zig.news/xq/zig-build-explained-part-1-59lf which I think the contents should be moved, with @MasterQ32's permission, to either a page on ziglang.org or added to the language reference depending on length. I lean towards having it a separate page because it documents the tool more than the language.

paulespinosa avatar Sep 12 '21 05:09 paulespinosa

Does this resolve the issue? https://ziglang.org/learn/build-system/

janie314 avatar Feb 13 '24 14:02 janie314

It does for me. Awesome work! Thank you!

matjam avatar Feb 13 '24 20:02 matjam

  • How to execute an external shell command?

If the purpose is to replace make, I believe this is a missing point. I don't yet know how to spawn a child-process with zig.

Also, inevitably, the build system relates to the dependency management system. The reason I want to execute an external command is to git clone an external dependency as an automated build-step.

carlosneves0 avatar Apr 19 '24 18:04 carlosneves0