Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
visualfc committed Nov 22, 2022
1 parent c4c89d2 commit 517a160
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions proj.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,19 @@ func execProjDone(base string, flags int, conf *c2goConf) {
err := pkg.WriteDepFile(filepath.Join(dir, "c2go_autogen.go"))
check(err)
}
var cmd *exec.Cmd
var args []string
if (flags&FlagRunTest) != 0 && conf.Target.Name == "main" {
cmd = exec.Command("go", "build", "-o", clangOut, ".")
args = []string{"build", "-o", clangOut}
} else {
cmd = exec.Command("go", "install", ".")
args = []string{"install"}
}
if strings.HasSuffix(clangTarget, "-windows-msvc") {
args = append(args, "-tags", "windows_msvc")
} else if strings.HasSuffix(clangTarget, "-windows-gnu") {
args = append(args, "-tags", "windows_gnu")
}
args = append(args, ".")
cmd := exec.Command("go", args...)
cmd.Dir = dir
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down

0 comments on commit 517a160

Please sign in to comment.