main: configure default GC in target JSON file

Этот коммит содержится в:
Ayke van Laethem 2018-11-28 17:33:16 +01:00
родитель 05d70d288d
коммит e817bd38ec
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E97FF5335DFDFDED
2 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -36,6 +36,9 @@ type BuildConfig struct {
// Helper function for Compiler object.
func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, action func(string) error) error {
if config.gc == "" && spec.GC != "" {
config.gc = spec.GC
}
compilerConfig := compiler.Config{
Triple: spec.Triple,
GC: config.gc,

Просмотреть файл

@ -21,6 +21,7 @@ type TargetSpec struct {
Inherits []string `json:"inherits"`
Triple string `json:"llvm-target"`
BuildTags []string `json:"build-tags"`
GC string `json:"gc"`
Compiler string `json:"compiler"`
Linker string `json:"linker"`
RTLib string `json:"rtlib"` // compiler runtime library (libgcc, compiler-rt)
@ -44,6 +45,9 @@ func (spec *TargetSpec) copyProperties(spec2 *TargetSpec) {
spec.Triple = spec2.Triple
}
spec.BuildTags = append(spec.BuildTags, spec2.BuildTags...)
if spec2.GC != "" {
spec.GC = spec2.GC
}
if spec2.Compiler != "" {
spec.Compiler = spec2.Compiler
}