main: allow changing the clang command name

This commit is contained in:
Ayke van Laethem
2019-04-27 17:31:50 +02:00
committed by Ron Evans
parent 5ca2e1322c
commit 1d59a960bc
3 changed files with 12 additions and 4 deletions
+10 -2
View File
@@ -211,7 +211,11 @@ func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, act
// Compile extra files.
for i, path := range spec.ExtraFiles {
outpath := filepath.Join(dir, "extra-"+strconv.Itoa(i)+"-"+filepath.Base(path)+".o")
cmd := exec.Command(spec.Compiler, append(spec.CFlags, "-c", "-o", outpath, path)...)
cmdName := spec.Compiler
if name, ok := commands[cmdName]; ok {
cmdName = name
}
cmd := exec.Command(cmdName, append(spec.CFlags, "-c", "-o", outpath, path)...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Dir = sourceDir()
@@ -227,7 +231,11 @@ func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, act
for _, file := range pkg.CFiles {
path := filepath.Join(pkg.Package.Dir, file)
outpath := filepath.Join(dir, "pkg"+strconv.Itoa(i)+"-"+file+".o")
cmd := exec.Command(spec.Compiler, append(spec.CFlags, "-c", "-o", outpath, path)...)
cmdName := spec.Compiler
if name, ok := commands[cmdName]; ok {
cmdName = name
}
cmd := exec.Command(cmdName, append(spec.CFlags, "-c", "-o", outpath, path)...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Dir = sourceDir()