Examples
These examples all use the current v2 API and match the files shipped in the repository.
Basic
A minimal executable target with one explicit entry source.
ib_target* target = ib_project_add_target(project, "main", IB_TARGET_EXECUTABLE);
ib_target_set_entry(target, "main.c");
ib_project_build(project, IB_MODE_DEBUG);
Multi-file
A target with one entry source plus additional shared sources discovered from the current directory.
ib_target* target = ib_project_add_target(project, "app", IB_TARGET_EXECUTABLE);
ib_target_set_entry(target, "main.c");
ib_project_scan_shared_dir(project, ".", false);
ib_project_build(project, IB_MODE_DEBUG);
Logging
Context-based diagnostics, log levels, and verbose command output.
ib_context_set_verbose(ctx, true);
ib_context_set_log_level(ctx, IB_DIAG_DEBUG);
ib_project_build(project, IB_MODE_DEBUG);
Custom Limits
V2 does not rely on fixed-size project arrays. The example exists to show that the runtime now grows its internal lists dynamically.
puts("IncludeBuild v2 grows lists dynamically.");
ib_project_build(project, IB_MODE_DEBUG);
Game
A Raylib-based example with platform-specific link flags and support for either vendored or system Raylib libraries.
ib_target_add_include_dir(target, "vendor/raylib/include");
#ifdef _WIN32
ib_target_add_link_flags(target, "-lraylib -lopengl32 -lgdi32 -lwinmm");
#elif defined(__APPLE__)
ib_target_add_link_flags(target, "-lraylib -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo");
#else
ib_target_add_link_flags(target, "-lraylib -lGL -lm -lpthread -ldl -lrt -lX11");
#endif