#Linking Libs

1 messages · Page 1 of 1 (latest)

outer night
#

I am building a tiny engine on top of raylib, and I am confused about how I would need to link libs.
currently my structure is as follows:

engine/
- libs/
--- raylib/
--- app/
--- ecs/
--- render/
- src/

both app as well as render are zig-libs, and both depend on raylib.
but adding @import("../raylib") doesn't seem to be allowed.
Do I need to clone raylib in both app as well as render folders? Or is there another way?

#

well, thinking about it, if both are supposed to be usable individually, they both do need their own copy.

dark rapids
#

Should work if you do all your building from the top-level? so engine/build.zig would build either of your libs and provide them with raylib?

#

Each lib might have their own build.zig that have functions for building their components, with options to pass in any other dependencies.

wraith tartan
#

If u will place build.zig above src folder everything should work

#

Also, use exe.addPackagePath for pure zig libs

#

For import aliasing, if speaking simple

outer night
#

there might be build steps involved in the libs build.zig that are not apparent from the src/main.zig alone.
unless it automatically looks for a build.zig for that main.zig?

wraith tartan