cc

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binary

type Binary struct {
	Out           core.OutPath
	Srcs          core.Paths
	CompilerFlags core.Flags
	LinkerFlags   core.Flags
	Deps          []Dep
	Script        core.Path
	Toolchain     Toolchain
}

Binary builds and links an executable.

func (Binary) Build

func (bin Binary) Build(ctx core.Context) core.OutPath

Build a Binary.

type Dep

type Dep interface {
	CcLibrary() Library
}

Dep is an interface implemented by dependencies that can be linked into a library.

type GccToolchain

type GccToolchain struct {
	Ar      core.GlobalPath
	As      core.GlobalPath
	Cc      core.GlobalPath
	Cpp     core.GlobalPath
	Cxx     core.GlobalPath
	Objcopy core.GlobalPath

	Includes core.Paths

	CompilerFlags core.Flags
	LinkerFlags   core.Flags

	ArchName   string
	TargetName string
}

Toolchain represents a C++ toolchain.

func (GccToolchain) Binary

func (gcc GccToolchain) Binary(out core.Path, objs core.Paths, alwaysLinkLibs core.Paths, libs core.Paths, flags core.Flags, script core.Path) string

Binary generates the command to build an executable.

func (GccToolchain) EmbeddedBlob

func (gcc GccToolchain) EmbeddedBlob(out core.OutPath, src core.Path) string

func (GccToolchain) ObjectFile

func (gcc GccToolchain) ObjectFile(out core.OutPath, depfile core.OutPath, flags core.Flags, includes core.Paths, src core.Path) string

ObjectFile generates a compile command.

func (GccToolchain) SharedLibrary

func (gcc GccToolchain) SharedLibrary(out core.Path, objs core.Paths) string

SharedLibrary generates the command to build a shared library.

func (GccToolchain) StaticLibrary

func (gcc GccToolchain) StaticLibrary(out core.Path, objs core.Paths) string

StaticLibrary generates the command to build a static library.

type Library

type Library struct {
	Out           core.OutPath
	Srcs          core.Paths
	Objs          core.Paths
	Includes      core.Paths
	CompilerFlags core.Flags
	Deps          []Dep
	Shared        bool
	AlwaysLink    bool
	Toolchain     Toolchain
}

Library builds and links a static C++ library.

func (Library) Build

func (lib Library) Build(ctx core.Context) core.OutPath

Build a Library.

func (Library) CcLibrary

func (lib Library) CcLibrary() Library

CcLibrary for Library is just the identity.

type ObjectFile

type ObjectFile struct {
	Src       core.Path
	Includes  core.Paths
	Flags     core.Flags
	Toolchain Toolchain
}

ObjectFile compiles a single C++ source file.

func (ObjectFile) Build

func (obj ObjectFile) Build(ctx core.Context) core.OutPath

Build an ObjectFile.

type Toolchain

type Toolchain interface {
	ObjectFile(out core.OutPath, depfile core.OutPath, flags core.Flags, includes core.Paths, src core.Path) string
	StaticLibrary(out core.Path, objs core.Paths) string
	SharedLibrary(out core.Path, objs core.Paths) string
	Binary(out core.Path, objs core.Paths, alwaysLinkLibs core.Paths, libs core.Paths, flags core.Flags, script core.Path) string
	EmbeddedBlob(out core.OutPath, src core.Path) string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL