main: configure default GC in target JSON file
Этот коммит содержится в:
родитель
05d70d288d
коммит
e817bd38ec
2 изменённых файлов: 7 добавлений и 0 удалений
3
main.go
3
main.go
|
@ -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
|
||||
}
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче