{"id":23406986,"url":"https://github.com/codecat/qb","last_synced_at":"2025-04-04T11:13:55.248Z","repository":{"id":39116143,"uuid":"278888604","full_name":"codecat/qb","owner":"codecat","description":"Zero-configuration build system to very quickly build C/C++ projects.","archived":false,"fork":false,"pushed_at":"2025-02-11T19:14:33.000Z","size":78,"stargazers_count":212,"open_issues_count":4,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T10:08:18.229Z","etag":null,"topics":["build-tool","cplusplus","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codecat.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"License.txt","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},"funding":{"patreon":"openplanet"}},"created_at":"2020-07-11T15:26:34.000Z","updated_at":"2025-03-27T10:31:00.000Z","dependencies_parsed_at":"2024-02-27T12:44:26.430Z","dependency_job_id":"518da0f7-d025-4ac2-aa89-029b95aed472","html_url":"https://github.com/codecat/qb","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecat%2Fqb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecat%2Fqb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecat%2Fqb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecat%2Fqb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codecat","download_url":"https://codeload.github.com/codecat/qb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166168,"owners_count":20894654,"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","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-tool","cplusplus","hacktoberfest"],"created_at":"2024-12-22T14:16:41.797Z","updated_at":"2025-04-04T11:13:55.232Z","avatar_url":"https://github.com/codecat.png","language":"Go","funding_links":["https://patreon.com/openplanet"],"categories":[],"sub_categories":[],"readme":"# Quickbuild (qb)\n`qb` is a zero-configuration build system to very quickly build C/C++ projects on Linux, Windows, and MacOS.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://4o4.nl/qb.gif\" /\u003e\n\u003c/p\u003e\n\n## Example\nLet's say you have a folder containing some source files:\n\n```c++\n// main.cpp\n#include \"test.h\"\nint main() {\n  test();\n  return 0;\n}\n\n// test.h\nvoid test();\n\n// test.cpp\n#include \u003ccstdio\u003e\nvoid test() {\n  printf(\"Hello, world\\n\");\n}\n```\n\nYou run `qb` in this directory:\n\n```\n~/qbtest $ qb\n22:30:40.363 | main.cpp\n22:30:40.364 | test.cpp\n22:30:40.456 | 👏 qbtest\n22:30:40.456 | ⏳ compile 53.9738ms, link 39.1138ms\n```\n\nAnd you run the resulting binary:\n```\n~/qbtest $ ./qbtest\nHello, world\n```\n\n## Installing\nTo install `qb`, make sure you have [Go](https://go.dev) installed, then run:\n```\ngo install github.com/codecat/qb@master\n```\n\n## Commands\nYou can pass a number of commands to `qb`.\n\n### `qb run`\nRuns the binary after building it.\n\n### `qb clean`\nCleans all output files that qb could generate.\n\n## Optional configuration\nSince `qb` is meant to be a zero configuration tool, you don't have to do any configuration to get going quickly. It will do its best to find appropriate defaults for your setup, you just run `qb` and it builds.\n\nIf you **do** want a little bit more control over what happens, you can either use command line flags or create a configuration file in your source folder.\n\n### Command line options\n```\nqb [--name name]\n   [--out dir]\n   [--type \u003cexe|dll|lib\u003e]\n   [--pkg name]\n   [--static]\n   [--debug]\n   [--verbose]\n   [--strict]\n   [--exceptions \u003cstd|all|min\u003e]\n   [--optimize \u003cdefault|none|size|speed\u003e]\n   [--cppstd \u003clatest|20|17|14\u003e]\n   [--cstd \u003clatest|17|11\u003e]\n   [--include \u003cpath\u003e]\n   [--define \u003cdefine\u003e]\n```\n\n#### `--name`\nSets the name of the project and controls the output filename. You should not provide any file extension here as it will be added automatically.\n\nIf no name is passed, the name of the current directory will be used.\n\nFor example, `--name foo` will produce a binary `foo` on Linux, and `foo.exe` on Windows.\n\n#### `--out`\nSets the output directory for the linker output. If no output directory is passed, the current directory will be used.\n\n#### `--type`\nSets the type of the project, which can be an executable or a (dynamic) library. This is specified using the keywords `exe`, `dll`, or `lib`.\n\nFor example, to create a dynamic library, you would pass `--type dll`.\n\n#### `--pkg`\nAdds a package to link to by its name. `qb` will try to resolve the package by itself, using a variety of sources. Listed here are the sources, in the order that they will be searched for:\n\n1. **Local configuration**: If you have a `qb.toml` file, this will check for packages defined there.\n   ```toml\n   [package.sfml]\n   includes = [ \"D:\\\\Libs\\\\SFML-2.5.1\\\\include\\\\\" ]\n   linkdirs = [ \"D:\\\\Libs\\\\SFML-2.5.1\\\\lib\\\\\" ]\n   links = [\n     \"sfml-main.lib\",\n     \"sfml-graphics-s.lib\",\n     \"sfml-system-s.lib\",\n     \"sfml-window-s.lib\",\n     \"opengl32.lib\",\n     \"winmm.lib\",\n     \"gdi32.lib\",\n   ]\n   defines = [ \"SFML_STATIC\" ]\n   ```\n2. **pkgconfig**: If you have `pkg-config` installed on your system, it will be checking for packages from there.\n3. Nothing else yet, but the following is planned: global configuration (like local, but system-wide), and vcpkg (for Windows).\n\nFor example, to link with SFML, we can add `--pkg sfml`, as long as `sfml` can be resolved by one of the package sources.\n\nAdditionally, if [Conan](https://conan.io/) is installed, it may be used as a way to manage packages. If a `conanfile.txt` exists, it will run `conan install .` (unless `conanbuildfile.txt` already exists). Then `conanbuildfile.txt` is used to properly compile \u0026 link to any dependencies in the Conanfile.\n\n#### `--static`\nLinks statically in order to create a standalone binary that does not perform any loading of dynamic libraries.\n\n#### `--debug`\nProduces debug information for the resulting binary. On Windows that means a `.pdb` file, on Linux that means embedding debug information into the binary itself so that it can be used with gdb, and on Mac that means a `.dSYM` bundle.\n\n#### `--verbose`\nMakes it so that all compiler and linker commands will be printed to the log. Useful for debugging `qb` itself.\n\n#### `--strict`\nMakes the compiler more strict with its warnings.\n\n#### `--exceptions`\nSets the way that the compiler's runtime will handle exceptions. Can either be `standard` (`std`), `all`, or `minimal` (`min`). The default is `standard`.\n\nThis only makes a difference on Windows, where setting this to `all` will allow the runtime to catch certain access violation and other exceptions. When it's `minimal` or `min`, the minimal amount of exception handling will be done, which is similar to `all`, but there is no stack unwinding.\n\n#### `--optimize`\nSets whether to use optimization. Can either be `default`, `none`, `size`, or `speed`. The default is `default`.\n\nWhen this option is set to `default`, whether the binary will be optimized is defined by whether it's a debug build or not. For example, when building with `qb --debug`, you will get an unoptimized binary, but by building without any options (by just running `qb`) it will produce an optimized build.\n\n#### `--cppstd`\nSets which C++ standard to use. Can either be `latest`, `20`, `17`, or `14`. The default is `latest`.\n\n#### `--cstd`\nSets which C standard to use. Can either be `latest`, `17`, or `11`. The default is `latest`.\n\n#### `--include`\nAdds a directory to the include path. For example, to add the folders `foo` and `bar` to the include path, you would run `qb --include foo --include bar`.\n\n#### `--define`\nAdds a precompiler definition. For example, to define `FOO` and `BAR` in the preprocessor when compiling, you would run `qb --define FOO --define BAR`.\n\n### Configuration file\nIt's possible to create a `qb.toml` file (in the folder you're running `qb`) to specify your configuration options as well. This is handy if you build a lot but don't want to pass the command line options every time.\n\nThe configuration file works the same as the command line options, except they are in a toml file. Values not defined in the file will remain as their defaults. For example, to make `qb` always build as a dynamic library with the name `libfoo`, you would put this in `qb.toml`:\n\n```toml\nname = \"libfoo\"\ntype = \"dll\"\n```\n\nTo make a statically linked debug binary, you can put this in the configuration file:\n\n```toml\nstatic = true\ndebug = true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecat%2Fqb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodecat%2Fqb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecat%2Fqb/lists"}