-
-
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. In fact, addRaylib is an alias for addStaticRaylib. addRaylib still generates a static library, whereas the newly added addSharedRaylib generates a shared library. Additionally, since a shared 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 = raylib.addSharedRaylib(b, target, optimize, .{}); // Define a USE_LIBTYPE_SHARED macro for your project that is used // in raylib.h when using a shared library. Your project must use // raylib.h in order for this macro to work. It is not necessary // but saves performance when using on Windows. For more see: // #3680 (comment) my_project.defineCMacro("USE_LIBTYPE_SHARED", null);
- Loading branch information
Showing
1 changed file
with
164 additions
and
100 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