#How do I correctly build a zig multi-project

1 messages · Page 1 of 1 (latest)

light dome
#

Hi everyone!

I have a multi-project that consists of 3 projects:

  • libA
  • exeA
  • exeB

Both exeA and exeB depend on libA. libA also depends on some packages from michal-z/zig-gamedev. I want libA to be a shared library that exeA and exeB link against.

Normally with cmake I'd have a build file sitting in the root of each project directory as well as the parent directory. Should I do something similar here? Could you provide an example?

All of the projects are pure zig btw

visual lynx
#

you would have a singular build.zig in the root that has 1 library and 2 executables defined

#

the executable link against the library

#

but in the case of libA being pure zig

#

you dont even create a library

#

you create a "module", that you then add to the executables

#

which pulls it in from source