{"modulePath":"github.com/Highload-fun/builders","version":"v0.1.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cpp\n\nPackage cpp provides a C++ builder that uses system-installed g++ and clang++ compilers.\n\nUnlike other builders that download compiler toolchains, this package discovers compilers already present on the host (e.g. /usr/bin/g++-13, /usr/bin/clang++-18) and mounts them into the sandbox for compilation.\n\nVersion IDs follow the format \"g++\\\u003csemver\u003e\" or \"clang++\\\u003csemver\u003e\", for example \"g++13.3.0\" or \"clang++18.1.3\". The default version is \"g++13.3.0\".\n\nImport this package for its side effects to register the builder:\n\n\timport _ \"github.com/Highload-fun/builders/cpp\"\n\n## Constants\n\n```go\nconst BuilderId = \"cpp\"\n```\nBuilderId is the identifier used to register and look up this builder.\n\n## Types\n\n```go\ntype Cpp struct {\n\t// contains filtered or unexported fields\n}\n```\nCpp implements the builders.Builder interface for C++ using system-installed g++ and clang++ compilers.\n\n```go\nfunc (c *Cpp) Build(ctx context.Context, sb *sandbox.Sandbox, version string, flags []string) error\n```\nBuild compiles main.cpp inside the sandbox using the specified compiler version. If version is empty, \"g++13.3.0\" is used. If flags is empty, \"-O2 -std=c++17\" is used. The compiled binary is written to /out/main.\n\n```go\nfunc (c *Cpp) GetVersions(_ context.Context) ([]builders.Version, error)\n```\nGetVersions discovers available C++ compilers by scanning /usr/bin for g++-\\* and clang++-\\* binaries, running --version on each to extract the version string. Results are cached for 1 hour.\n\n","path":"github.com/Highload-fun/builders/cpp","name":"cpp","synopsis":"Package cpp provides a C++ builder that uses system-installed g++ and clang++ compilers.","isRedistributable":true}
