-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build.zig: Add ability to install a shared library
Initial build.zig only installed a static library. This is fine for Zig itself but not sufficient for other ecosystems. Current patch doesn't break backwards compatibility but does a little refactoring where the old function addRaylib uses the newly added function addRaylibTo, which is more flexible. addRaylib still generates a static library, whereas the new addRaylibTo allows to choose the desired artifact and only applies necessary build steps to that artifact. Additionally, since a dynamic library is also a common artifact, build.zig also installs it to a default location of zig-out/lib/libraylib.dll. Example code how to generate a shared library artifact in Zig: const libraylib = b.addSharedLibrary(.{ .name = "raylib", .target = target, .optimize = optimize, }); raylib.addRaylibTo(b, libraylib, target, .{});
- Loading branch information
Showing
1 changed file
with
105 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters