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 = popen2.Popen4(w.mode.makecmd)
p.tochild.close() p.tochild.close()
output = p.fromchild.read() output = p.fromchild.read()
result = p.wait() result = p.wait()
status = os.WEXITSTATUS(result)
if not os.WIFEXITED(result): if not os.WIFEXITED(result):
sig = os.WTERMSIG(result) err = True
w.application.data_buffer("*CMake*", output, switch_to=True) errmsg = "make: killed by signal %r" % os.WTERMSIG(result)
w.set_error("make: killed by signal %r" % sig) elif status != 0:
err = True
errmsg = "make: failed with status %r" % status
else: else:
status = os.WEXITSTATUS(result) err = False
if status == 0: errmsg = "make: OK (output in *CMake*)"
w.set_error("make: OK")
else: w.application.data_buffer("*CMake*", output, switch_to=err)
w.application.data_buffer("*CMake*", output, switch_to=True) w.set_error(errmsg)
w.set_error("make: failed with status %r" % status)