@@ -298,19 +298,18 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
298298 .flags = raylib_flags_arr .items ,
299299 });
300300
301- if ( options . raygui ) {
302- const raygui_dep = b . dependency ( options . raygui_dependency_name , .{});
301+ return raylib ;
302+ }
303303
304- var gen_step = b .addWriteFiles ();
305- raylib .step .dependOn (& gen_step .step );
304+ pub fn addRaygui (b : * std.Build , raylib : * std.Build.Step.Compile , raygui_dep : * std.Build.Dependency ) void {
305+ var gen_step = b .addWriteFiles ();
306+ raylib .step .dependOn (& gen_step .step );
306307
307- const raygui_c_path = gen_step .add ("raygui.c" , "#define RAYGUI_IMPLEMENTATION\n #include \" raygui.h\" \n " );
308- raylib .addCSourceFile (.{ .file = raygui_c_path , .flags = raylib_flags_arr .items });
309- raylib .addIncludePath (raygui_dep .path ("src" ));
310- raylib .installHeader (raygui_dep .path ("src/raygui.h" ), "raygui.h" );
311- }
308+ const raygui_c_path = gen_step .add ("raygui.c" , "#define RAYGUI_IMPLEMENTATION\n #include \" raygui.h\" \n " );
309+ raylib .addCSourceFile (.{ .file = raygui_c_path });
310+ raylib .addIncludePath (raygui_dep .path ("src" ));
312311
313- return raylib ;
312+ raylib . installHeader ( raygui_dep . path ( "src/raygui.h" ), "raygui.h" ) ;
314313}
315314
316315pub const Options = struct {
@@ -319,23 +318,19 @@ pub const Options = struct {
319318 rshapes : bool = true ,
320319 rtext : bool = true ,
321320 rtextures : bool = true ,
322- raygui : bool = false ,
323321 platform : PlatformBackend = .glfw ,
324322 shared : bool = false ,
325323 linux_display_backend : LinuxDisplayBackend = .Both ,
326324 opengl_version : OpenglVersion = .auto ,
327325 /// config should be a list of space-separated cflags, eg, "-DSUPPORT_CUSTOM_FRAME_CONTROL"
328326 config : []const u8 = &.{},
329327
330- raygui_dependency_name : []const u8 = "raygui" ,
331-
332328 const defaults = Options {};
333329
334330 fn getOptions (b : * std.Build ) Options {
335331 return .{
336332 .platform = b .option (PlatformBackend , "platform" , "Choose the platform backedn for desktop target" ) orelse defaults .platform ,
337333 .raudio = b .option (bool , "raudio" , "Compile with audio support" ) orelse defaults .raudio ,
338- .raygui = b .option (bool , "raygui" , "Compile with raygui support" ) orelse defaults .raygui ,
339334 .rmodels = b .option (bool , "rmodels" , "Compile with models support" ) orelse defaults .rmodels ,
340335 .rtext = b .option (bool , "rtext" , "Compile with text support" ) orelse defaults .rtext ,
341336 .rtextures = b .option (bool , "rtextures" , "Compile with textures support" ) orelse defaults .rtextures ,
0 commit comments