{"id":24503980,"url":"https://github.com/rrrinav/b_ldr","last_synced_at":"2025-07-29T09:39:14.449Z","repository":{"id":270949737,"uuid":"907208765","full_name":"Rrrinav/B_ldr","owner":"Rrrinav","description":"A build sytem written in C++ that just requires a Cpp Compiler and uses C++ as script.","archived":false,"fork":false,"pushed_at":"2025-04-01T11:59:37.000Z","size":290,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T12:47:38.774Z","etag":null,"topics":["build","build-system","build-tool","builder","cplusplus","cplusplus-11","cplusplus-17","cpp","nobuild"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rrrinav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-23T04:39:23.000Z","updated_at":"2025-04-01T11:59:40.000Z","dependencies_parsed_at":"2025-03-22T12:35:05.309Z","dependency_job_id":"46a9dc6e-591f-4c45-8c02-366863122b53","html_url":"https://github.com/Rrrinav/B_ldr","commit_stats":null,"previous_names":["rrrinav/b_ldr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rrrinav/B_ldr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rrrinav%2FB_ldr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rrrinav%2FB_ldr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rrrinav%2FB_ldr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rrrinav%2FB_ldr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rrrinav","download_url":"https://codeload.github.com/Rrrinav/B_ldr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rrrinav%2FB_ldr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267664900,"owners_count":24124414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","build-system","build-tool","builder","cplusplus","cplusplus-11","cplusplus-17","cpp","nobuild"],"created_at":"2025-01-21T23:19:21.725Z","updated_at":"2025-07-29T09:39:14.442Z","avatar_url":"https://github.com/Rrrinav.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Builder (bld)\n\nA simple C++ build system that uses C++ as the scripting language thus doesn't need any new tools to be installed.\nMoreover, it is easier because well, it uses C++ as a scripting language.\n\nBecause [Tsoding](github.com/tsoding) said you should write your own build system.\n\n\n## Features\n\n- **Command Execution**: Execute system commands and shell commands with ease.\n- **Logging**: Log messages with different severity levels (INFO, WARNING, ERROR).\n- **Process Management**: Wait for processes to complete and handle their exit statuses.\n- **Output Handling**: Capture and read the output of executed commands.\n- **System Metadata**: Print system metadata including OS, compiler, and architecture information.\n\n\n## Installation\n\nTo use `bld` in your project, include the `bld.hpp` header file and define `B_LDR_IMPLEMENTATION` in one of your source files to include the implementation.\n\n```cpp\n#define B_LDR_IMPLEMENTATION\n#include \"bld.hpp\"\n```\n\n## Usage\n\n### Logging\n\nLog messages with different severity levels:\n\n```cpp\nbld::log(bld::Log_type::INFO, \"This is an info message.\");\nbld::log(bld::Log_type::WARNING, \"This is a warning message.\");\nbld::log(bld::Log_type::ERROR, \"This is an error message.\");\n```\n\n### Command Execution\n\nCreate and execute commands:\n\n```cpp\nbld::Command cmd(\"ls\", \"-la\");\nint result = bld::execute(cmd);\n```\n\nExecute shell commands:\n\n```cpp\nstd::string shell_cmd = \"echo Hello, World!\";\nint result = bld::execute_shell(shell_cmd);\n```\n\n### Process Output\n\nCapture the output of a command:\n\n```cpp\nstd::string output;\nbld::Command cmd(\"ls\", \"-la\");\nbool success = bld::read_process_output(cmd, output);\n```\n\nCapture the output of a shell command:\n\n```cpp\nstd::string output;\nstd::string shell_cmd = \"echo Hello, World!\";\nbool success = bld::read_shell_output(shell_cmd, output);\n```\n\n### incremental\n\n```cpp\nint main(int argc, char *argv[])\n{\n  BLD_REBUILD_YOURSELF_ONCHANGE();\n\n  bld::Dep_graph dg;\n\n  dg.add_dep({\"main\",\n             {\"main.cpp\", \"./foo.o\", \"./bar.o\"},\n             {\"g++\", \"main.cpp\", \"-o\", \"main\", \"foo.o\", \"bar.o\"}});\n\n  dg.add_dep({\"./foo.o\",\n             {\"foo.cpp\"},\n             {\"g++\", \"-c\", \"foo.cpp\", \"-o\", \"foo.o\"}});\n\n  dg.add_dep({\"./bar.o\",\n             {\"bar.cpp\"},\n             {\"g++\", \"-c\", \"bar.cpp\", \"-o\", \"bar.o\"}});\n\n  dg.build_all();\n\n  return 0;\n}\n```\n```bash\n$ls\nmain.cpp foo.cpp foo.hpp bar.cpp bar.hpp\n\n```\n\n### File System\n\nCheck if an executable is up-to-date with it's file:\n    This specific example tracks it's own executable file.\n\n```cpp\n // Requires arguments for main function\nint main(int argc, char *argv[])\n{\n  // Check if the executable needs to be rebuilt and restart if necessary\n  BLD_REBUILD_YOURSELF_ONCHANGE();\n}\n```\n\n### System Metadata\n\nPrint system metadata:\n\n```cpp\nbld::print_metadata();\n```\n\n## TODO\n\n- [X] Parallel incremental builds\n- [ ] Fully cross-platform functions\n\n## Author\n\nRinav (GitHub: [rrrinav](https://github.com/rrrinav))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frrrinav%2Fb_ldr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frrrinav%2Fb_ldr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frrrinav%2Fb_ldr/lists"}