Compiler defaults to .o when output name isn't specified
This commit is contained in:
parent
15e418d8c1
commit
00110039e2
|
@ -34,12 +34,16 @@ func (this *Compiler) CompileUnit (address entity.Address) error {
|
|||
// if the format isn't specified, try to get it from the filename
|
||||
// extension of the input. if that isn't specified, default to .o
|
||||
if this.Filetype == FiletypeUnknown {
|
||||
var ok bool
|
||||
this.Filetype, ok = FiletypeFromExt (
|
||||
*this.Target,
|
||||
filepath.Ext(this.Output))
|
||||
if !ok {
|
||||
if this.Output == "" {
|
||||
this.Filetype = FiletypeObject
|
||||
} else {
|
||||
var ok bool
|
||||
this.Filetype, ok = FiletypeFromExt (
|
||||
*this.Target,
|
||||
filepath.Ext(this.Output))
|
||||
if !ok {
|
||||
this.Filetype = FiletypeObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue