[Cmake-commits] CMake branch, next, updated. v2.8.8-3195-gc380831
Peter Kuemmel
syntheticpp at gmx.net
Fri Jun 15 13:02:21 EDT 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via c38083148dea10f00da9ca41d3aff2d9628f9eae (commit)
via f1abdce1cc7df4ace0a15c9fb0c62d975f92fa3a (commit)
from 23fa3a7ac3e71d3a1184f84bad39ff853e5a771c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c38083148dea10f00da9ca41d3aff2d9628f9eae
commit c38083148dea10f00da9ca41d3aff2d9628f9eae
Merge: 23fa3a7 f1abdce
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Fri Jun 15 13:02:19 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jun 15 13:02:19 2012 -0400
Merge topic 'ninja-cldeps' into next
f1abdce Ninja: some bytes of the rc files couldn't be piped correctly
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f1abdce1cc7df4ace0a15c9fb0c62d975f92fa3a
commit f1abdce1cc7df4ace0a15c9fb0c62d975f92fa3a
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Fri Jun 15 18:56:34 2012 +0200
Commit: Peter Kuemmel <syntheticpp at gmx.net>
CommitDate: Fri Jun 15 18:56:34 2012 +0200
Ninja: some bytes of the rc files couldn't be piped correctly
Write to a file again but generate it in the object dir
diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx
index 85fed5d..962acdb 100644
--- a/Source/cmcldeps.cxx
+++ b/Source/cmcldeps.cxx
@@ -58,7 +58,7 @@ struct Subprocess {
private:
Subprocess();
- bool Start(struct SubprocessSet* set, const string& command);
+ bool Start(struct SubprocessSet* set, const string& command, const string& dir);
void OnPipeReady();
string buf_;
@@ -89,7 +89,7 @@ struct SubprocessSet {
SubprocessSet();
~SubprocessSet();
- Subprocess* Add(const string& command);
+ Subprocess* Add(const string& command, const string& dir);
bool DoWork();
Subprocess* NextFinished();
void Clear();
@@ -244,7 +244,8 @@ HANDLE Subprocess::SetupPipe(HANDLE ioport) {
return output_write_child;
}
-bool Subprocess::Start(SubprocessSet* set, const string& command) {
+bool Subprocess::Start(SubprocessSet* set, const string& command,
+ const string& dir) {
HANDLE child_pipe = SetupPipe(set->ioport_);
SECURITY_ATTRIBUTES security_attributes;
@@ -273,7 +274,7 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
// lines greater than 8,191 chars.
if (!CreateProcessA(NULL, (char*)command.c_str(), NULL, NULL,
/* inherit handles */ TRUE, CREATE_NEW_PROCESS_GROUP,
- NULL, NULL,
+ NULL, (dir.empty() ? NULL : dir.c_str()),
&startup_info, &process_info)) {
DWORD error = GetLastError();
if (error == ERROR_FILE_NOT_FOUND) {
@@ -388,9 +389,9 @@ BOOL WINAPI SubprocessSet::NotifyInterrupted(DWORD dwCtrlType) {
return FALSE;
}
-Subprocess *SubprocessSet::Add(const string& command) {
+Subprocess *SubprocessSet::Add(const string& command, const string& dir) {
Subprocess *subprocess = new Subprocess;
- if (!subprocess->Start(this, command)) {
+ if (!subprocess->Start(this, command, dir)) {
delete subprocess;
return 0;
}
@@ -615,10 +616,11 @@ static int process( const string& srcfilename,
const string& objfile,
const string& prefix,
const string& cmd,
+ const string& dir = "",
bool quiet = false) {
SubprocessSet subprocs;
- Subprocess* subproc = subprocs.Add(cmd);
+ Subprocess* subproc = subprocs.Add(cmd, dir);
if(!subproc)
return 2;
@@ -700,11 +702,18 @@ int main() {
// rc: src\x\x.rc -> cl: /Tc src\x\x.rc
clrest = replace(clrest, srcfile, "/Tc " + srcfile);
- cl = "\"" + cl + "\" /EP /DRC_INVOKED ";
+ cl = "\"" + cl + "\" /P /DRC_INVOKED ";
+
+ // call cl in object dir so the .i is generated there
+ string objdir;
+ std::string::size_type pos = objfile.rfind("\\");
+ if (pos != string::npos) {
+ objdir = objfile.substr(0, pos);
+ }
// extract dependencies with cl.exe
process(srcfilename, dfile, objfile,
- prefix, cl + nol + show + clrest, true);
+ prefix, cl + nol + show + clrest, objdir, true);
// compile rc file with rc.exe
return process(srcfilename, "" , objfile, prefix, binpath + " " + rest);
-----------------------------------------------------------------------
Summary of changes:
Source/cmcldeps.cxx | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list