more make improvements

--HG--
branch : pmacs2
This commit is contained in:
moculus 2007-10-17 21:59:08 +00:00
parent 757926196b
commit 7882a8dd7e
1 changed files with 12 additions and 9 deletions

View File

@ -256,16 +256,19 @@ class CMake(method.Method):
p = popen2.Popen4(w.mode.makecmd)
p.tochild.close()
output = p.fromchild.read()
result = p.wait()
status = os.WEXITSTATUS(result)
if not os.WIFEXITED(result):
sig = os.WTERMSIG(result)
w.application.data_buffer("*CMake*", output, switch_to=True)
w.set_error("make: killed by signal %r" % sig)
err = True
errmsg = "make: killed by signal %r" % os.WTERMSIG(result)
elif status != 0:
err = True
errmsg = "make: failed with status %r" % status
else:
status = os.WEXITSTATUS(result)
if status == 0:
w.set_error("make: OK")
else:
w.application.data_buffer("*CMake*", output, switch_to=True)
w.set_error("make: failed with status %r" % status)
err = False
errmsg = "make: OK (output in *CMake*)"
w.application.data_buffer("*CMake*", output, switch_to=err)
w.set_error(errmsg)