summaryrefslogtreecommitdiffstats
path: root/Source/cmcldeps.cxx
diff options
context:
space:
mode:
authorPeter Kuemmel <syntheticpp@gmx.net>2012-06-09 11:52:20 (GMT)
committerPeter Kuemmel <syntheticpp@gmx.net>2012-06-09 12:12:11 (GMT)
commitdb607dea8dbb0d16e75e5ae1e764002e4ce8e605 (patch)
tree04cbcb2e2f9e33c5b2d4013992c2364590ac7ae4 /Source/cmcldeps.cxx
parent7553a3799a188594ee0bda46b18095479e3ee54b (diff)
downloadCMake-db607dea8dbb0d16e75e5ae1e764002e4ce8e605.zip
CMake-db607dea8dbb0d16e75e5ae1e764002e4ce8e605.tar.gz
CMake-db607dea8dbb0d16e75e5ae1e764002e4ce8e605.tar.bz2
Ninja: don't use cmcldeps for try_compile
Diffstat (limited to 'Source/cmcldeps.cxx')
-rw-r--r--Source/cmcldeps.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx
index 48f2cfd..d6cafc5 100644
--- a/Source/cmcldeps.cxx
+++ b/Source/cmcldeps.cxx
@@ -52,6 +52,8 @@ struct Subprocess {
const string& GetOutput() const;
+ int ExitCode() const { return exit_code_; }
+
private:
Subprocess();
bool Start(struct SubprocessSet* set, const string& command);
@@ -69,6 +71,7 @@ struct Subprocess {
OVERLAPPED overlapped_;
char overlapped_buf_[4 << 10];
bool is_reading_;
+ int exit_code_;
#else
int fd_;
pid_t pid_;
@@ -189,7 +192,7 @@ void Win32Fatal(const char* function) {
} // anonymous namespace
-Subprocess::Subprocess() : child_(NULL) , overlapped_(), is_reading_(false) {
+Subprocess::Subprocess() : child_(NULL) , overlapped_(), is_reading_(false), exit_code_(1) {
}
Subprocess::~Subprocess() {
@@ -338,7 +341,7 @@ ExitStatus Subprocess::Finish() {
CloseHandle(child_);
child_ = NULL;
-
+ exit_code_ = exit_code;
return exit_code == 0 ? ExitSuccess :
exit_code == CONTROL_C_EXIT ? ExitInterrupted :
ExitFailure;
@@ -606,8 +609,9 @@ int main() {
}
bool success = subproc->Finish() == ExitSuccess;
- string output = subproc->GetOutput();
+ int exit_code = subproc->ExitCode();
+ string output = subproc->GetOutput();
delete subproc;
// process the include directives and output everything else
@@ -635,7 +639,7 @@ int main() {
}
if (!success)
- return 3;
+ return exit_code;
// don't update .d until/unless we succeed compilation
outputDepFile(dfile, objfile, includes);