-
Notifications
You must be signed in to change notification settings - Fork 117
Generator config section
There goes the documentation for the GENERATOR
section of config manifest.
An example configuration piece:
GENERATOR:
PackageName: vorbis
PackageDescription: "Package vorbis provides Go bindings for OggVorbis implementation by the Xiph.Org Foundation"
PackageLicense: "THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS."
PkgConfigOpts: [ogg, vorbis]
Includes: ["ogg/ogg.h", "vorbis/codec.h"]
Specifies the package name for the generated code. A directory with that name will be created in the -out
prefix (.
by default) provided for the cgogen executable.
Examples: PackageName: vorbis
, PackageName: pm
, etc.
Specifies the package description that will be written into doc.go
and act as a short description in GoDoc.
Specify a license for the generated code. I prefer delegating all the rights to the robots.
An optional parameter that leverages pkg-config if the library you are binding have any .pc
manifests. Firstly, the parser module will be configured by cgogen main routine to use the specified include search paths, it does so by parsing *.pc
files with github.com/xlab/pkgconfig/pkg. Secondly, the generator will write a CGo header that the Go toolchain respects, so at compiling and linking stages it will find all required include files and shared objects.
#cgo pkg-config: ogg vorbis
Example: PkgConfigOpts: [ogg, vorbis]
or multiline:
PkgConfigOpts:
- ogg
- vorbis
The list of include files that generator must write in the resulting files so CGo will find all the symbols used.
#include "ogg/ogg.h"
#include "vorbis/codec.h"
Example: Includes: ["ogg/ogg.h", "vorbis/codec.h"]
or multiline:
Includes:
- ogg/ogg.h
- vorbis/vorbis.h
These files are part of the distribution so the paths are relative. Consider SysIncludes if you're expecting the system to have these headers. Be aware that system headers and the generated bindings must be compatible, any missing declarations will fail the build.
The same as Includes, but results in:
#include <ogg/ogg.h>
#include <vorbis/codec.h>