mirror of
https://github.com/danog/gllvm.git
synced 2024-11-30 06:39:06 +01:00
fix artifacts names producer
This commit is contained in:
parent
d311076075
commit
dfb57d66c9
@ -10,6 +10,7 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"io"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func compile(args []string) {
|
||||
@ -80,7 +81,6 @@ func attachBitcodePathToObject(bcFile, objFile string) {
|
||||
".os",
|
||||
".So",
|
||||
".po":
|
||||
|
||||
// Store bitcode path to temp file
|
||||
var absBcPath, _= filepath.Abs(bcFile)
|
||||
tmpContent := []byte(absBcPath+"\n")
|
||||
@ -163,6 +163,7 @@ func execCompile(compilerExecName string, pr ParserResult) {
|
||||
|
||||
// Executes a command then returns true if there was an error
|
||||
func execCmd(cmdExecName string, args []string) bool {
|
||||
fmt.Println(args)
|
||||
cmd := exec.Command(cmdExecName, args...)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
|
13
parser.go
13
parser.go
@ -4,6 +4,7 @@ import(
|
||||
"fmt"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"crypto/sha256"
|
||||
@ -214,7 +215,7 @@ func parse(argList []string) ParserResult {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fmt.Println(pr)
|
||||
return pr
|
||||
}
|
||||
|
||||
@ -222,16 +223,18 @@ func parse(argList []string) ParserResult {
|
||||
func getArtifactNames(pr ParserResult, srcFileIndex int, hidden bool) (objBase string, bcBase string) {
|
||||
if len(pr.InputFiles) == 1 && pr.IsCompileOnly && len(pr.OutputFilename) > 0 {
|
||||
objBase = pr.OutputFilename
|
||||
bcBase = fmt.Sprintf(".%s.bc", objBase)
|
||||
dir, baseName := path.Split(objBase)
|
||||
bcBaseName := fmt.Sprintf(".%s.bc", baseName)
|
||||
bcBase = path.Join(dir, bcBaseName)
|
||||
} else {
|
||||
srcFile := pr.InputFiles[srcFileIndex]
|
||||
var baseNameWithExt = filepath.Base(srcFile)
|
||||
var dir, baseNameWithExt = path.Split(srcFile)
|
||||
var baseName = strings.TrimSuffix(baseNameWithExt, filepath.Ext(baseNameWithExt))
|
||||
bcBase = fmt.Sprintf(".%s.o.bc", baseName)
|
||||
if hidden {
|
||||
objBase = fmt.Sprintf(".%s.o", baseName)
|
||||
objBase = path.Join(dir, fmt.Sprintf(".%s.o", baseName))
|
||||
} else {
|
||||
objBase = fmt.Sprintf("%s.o", baseName)
|
||||
objBase = path.Join(dir, fmt.Sprintf("%s.o", baseName))
|
||||
}
|
||||
}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user