builder: print compiler commands while building a library
We should have been doing this all along and makes it easier to debug things that go wrong while compiling a library.
Этот коммит содержится в:
родитель
666ead3996
коммит
2001c44ed3
1 изменённых файлов: 6 добавлений и 0 удалений
|
@ -242,6 +242,9 @@ func (l *Library) load(config *compileopts.Config, tmpdir string) (job *compileJ
|
||||||
var compileArgs []string
|
var compileArgs []string
|
||||||
compileArgs = append(compileArgs, args...)
|
compileArgs = append(compileArgs, args...)
|
||||||
compileArgs = append(compileArgs, "-o", objpath, srcpath)
|
compileArgs = append(compileArgs, "-o", objpath, srcpath)
|
||||||
|
if config.Options.PrintCommands != nil {
|
||||||
|
config.Options.PrintCommands("clang", compileArgs...)
|
||||||
|
}
|
||||||
err := runCCompiler(compileArgs...)
|
err := runCCompiler(compileArgs...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &commandError{"failed to build", srcpath, err}
|
return &commandError{"failed to build", srcpath, err}
|
||||||
|
@ -268,6 +271,9 @@ func (l *Library) load(config *compileopts.Config, tmpdir string) (job *compileJ
|
||||||
}
|
}
|
||||||
tmpfile.Close()
|
tmpfile.Close()
|
||||||
compileArgs = append(compileArgs, "-o", tmpfile.Name(), srcpath)
|
compileArgs = append(compileArgs, "-o", tmpfile.Name(), srcpath)
|
||||||
|
if config.Options.PrintCommands != nil {
|
||||||
|
config.Options.PrintCommands("clang", compileArgs...)
|
||||||
|
}
|
||||||
err = runCCompiler(compileArgs...)
|
err = runCCompiler(compileArgs...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &commandError{"failed to build", srcpath, err}
|
return &commandError{"failed to build", srcpath, err}
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче