aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/command.go
diff options
context:
space:
mode:
Diffstat (limited to 'compiler_wrapper/command.go')
-rw-r--r--compiler_wrapper/command.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler_wrapper/command.go b/compiler_wrapper/command.go
index b1c6f5f0..4e44e1a7 100644
--- a/compiler_wrapper/command.go
+++ b/compiler_wrapper/command.go
@@ -37,6 +37,14 @@ func ensurePathEnv(cmd *exec.Cmd) {
cmd.Env = append(cmd.Env, "PATH=")
}
+func getAbsCmdPath(env env, cmd *command) string {
+ path := cmd.path
+ if !filepath.IsAbs(path) {
+ path = filepath.Join(env.getwd(), path)
+ }
+ return path
+}
+
func newCommandBuilder(env env, cfg *config, cmd *command) (*commandBuilder, error) {
basename := filepath.Base(cmd.path)
nameParts := strings.Split(basename, "-")
@@ -52,7 +60,7 @@ func newCommandBuilder(env env, cfg *config, cmd *command) (*commandBuilder, err
default:
compilerType = gccType
}
- absWrapperDir, err := getAbsWrapperDir(env, cmd.path)
+ absWrapperDir, err := getAbsWrapperDir(env, cmd)
if err != nil {
return nil, err
}