github.com/metux/go-metabuild@v0.0.0-20240118143255-d9ed5ab697f9/util/compiler/probe/clang.go (about)

     1  package probe
     2  
     3  import (
     4  	cmdrun "github.com/metux/go-metabuild/util/cmd"
     5  	"github.com/metux/go-metabuild/util/compiler/base"
     6  )
     7  
     8  func probeClang(ci *base.CompilerInfo) bool {
     9  	ci.Id = base.CompilerGCC
    10  	ci.Machine = base.ParseMachine(ci.RunCatchOut("-dumpmachine"))
    11  	ci.Version = ci.RunCatchOut("-dumpversion")
    12  	ci.Archiver = cmdrun.StrCmdline(probeArCmd(ci))
    13  	return ci.Version != ""
    14  }