Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*options)
func WithCFlags ¶
WithCFlags flags passed to the compiler, may contain quoted arguments. These flags are specified will append at the end of the compile arguments. That means, if some input flags are dupilicated with the standard flags, it will be ignored.
func WithCompiler ¶
func WithInclude ¶
WithInclude add the specified directory to the search path for include files
func WithOutputDir ¶
WithOutputDir the output directory. This function will try to create the output directory if specified. Please note that, the input path should contain only the directory WITHOUT the output filename. If you want to specify the output filename, you need to use WithOutputName option.
Default: . (current directory)
func WithOutputName ¶
WithOutputName is the expected (base) filename produced from the source.
func WithOutputType ¶
func WithOutputType(typ OutputType) Option
WithOutputType determine the type of output. If the input type as OutputTypeSource, this function will run as -E flag (C-Preprocessor) Available options: OutputTypeObject, OutputTypeSource
Default: OutputTypeObject
func WithTargetArch ¶
WithTargetAch this not actually impact to the outputs format. Instead, this option will attach a -D__TARGET_ARCH_<linux_arch> into the compile args. If not specified, the compiler will try to resolve the linux arch by runtime.GOARCH
type OutputType ¶
type OutputType string
const ( OutputTypeObject OutputType = "o" OutputTypeSource OutputType = "c" )
func (OutputType) IsValid ¶
func (typ OutputType) IsValid() bool