[Cmake-commits] CMake branch, next, updated. v2.8.8-3090-g0f6284a
Peter Kuemmel
syntheticpp at gmx.net
Sat Jun 9 08:13:37 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 0f6284aa7a356a6b321e72911e34f6cec93fb70b (commit)
via db607dea8dbb0d16e75e5ae1e764002e4ce8e605 (commit)
via 7553a3799a188594ee0bda46b18095479e3ee54b (commit)
via 8b27a94f2879b3ea1c00e1e0e4bef7cc77fd2cb6 (commit)
via 64c5752d938457be411e3a9d781d4441e6634743 (commit)
from 0a80d9c45650b7425c24595ed14c0c55ae0a8b36 (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=0f6284aa7a356a6b321e72911e34f6cec93fb70b
commit 0f6284aa7a356a6b321e72911e34f6cec93fb70b
Merge: 0a80d9c db607de
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Sat Jun 9 08:13:33 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Jun 9 08:13:33 2012 -0400
Merge topic 'ninja-cldeps' into next
db607de Ninja: don't use cmcldeps for try_compile
7553a37 Ninja: fix ModuleNoticies test
8b27a94 Ninja: don't set cmcldeps vars to empty string when they are not defined
64c5752 Ninja: add copyright and description
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db607dea8dbb0d16e75e5ae1e764002e4ce8e605
commit db607dea8dbb0d16e75e5ae1e764002e4ce8e605
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Sat Jun 9 13:52:20 2012 +0200
Commit: Peter Kuemmel <syntheticpp at gmx.net>
CommitDate: Sat Jun 9 14:12:11 2012 +0200
Ninja: don't use cmcldeps for try_compile
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 75b3929..40fdc8b 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -331,13 +331,25 @@ cmNinjaTargetGenerator
vars.TargetPDB = "$TARGET_PDB";
cmMakefile* mf = this->GetMakefile();
+ bool useClDeps = false;
const char* clDepsBinary = mf->GetDefinition("CMAKE_CMCLDEPS_EXECUTABLE");
const char* clShowPrefix = mf->GetDefinition("CMAKE_CL_SHOWINCLUDE_PREFIX");
+ const char* projectName = mf->GetProjectName();
+ if (clDepsBinary && clShowPrefix)
+ {
+ useClDeps = true;
+ if (projectName && std::string(projectName) == "CMAKE_TRY_COMPILE")
+ {
+ // don't wrap for try_compile, TODO but why doesn't it work with cmcldeps?
+ useClDeps = false;
+ }
+ }
+
std::string depfile;
std::string depfileFlagsName = "CMAKE_DEPFILE_FLAGS_" + language;
const char *depfileFlags = mf->GetDefinition(depfileFlagsName.c_str());
- if (depfileFlags || (clDepsBinary && clShowPrefix)) {
+ if (depfileFlags || useClDeps) {
std::string depfileFlagsStr = depfileFlags ? depfileFlags : "";
depfile = "$out.d";
cmSystemTools::ReplaceString(depfileFlagsStr, "<DEPFILE>",
@@ -366,7 +378,7 @@ cmNinjaTargetGenerator
std::string cmdLine =
this->GetLocalGenerator()->BuildCommandLine(compileCmds);
- if(clDepsBinary && clShowPrefix)
+ if(useClDeps)
{
std::string prefix = clShowPrefix;
cmdLine = "\"" + std::string(clDepsBinary) + "\" $in $out.d $out \"" + prefix + "\" " + cmdLine;
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);
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7553a3799a188594ee0bda46b18095479e3ee54b
commit 7553a3799a188594ee0bda46b18095479e3ee54b
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Sat Jun 9 12:38:12 2012 +0200
Commit: Peter Kuemmel <syntheticpp at gmx.net>
CommitDate: Sat Jun 9 12:38:12 2012 +0200
Ninja: fix ModuleNoticies test
diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake
index 9c49169..6815e2b 100644
--- a/Modules/CMakeClDeps.cmake
+++ b/Modules/CMakeClDeps.cmake
@@ -1,3 +1,4 @@
+
#=============================================================================
# Copyright 2012 Kitware, Inc.
#
@@ -8,6 +9,8 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
#
# When using Ninja cl.exe is wrapped by cmcldeps to extract the included
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b27a94f2879b3ea1c00e1e0e4bef7cc77fd2cb6
commit 8b27a94f2879b3ea1c00e1e0e4bef7cc77fd2cb6
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Sat Jun 9 11:36:53 2012 +0200
Commit: Peter Kuemmel <syntheticpp at gmx.net>
CommitDate: Sat Jun 9 12:10:52 2012 +0200
Ninja: don't set cmcldeps vars to empty string when they are not defined
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 7a17e18..ded8cf6 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -49,7 +49,5 @@ SET(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@")
SET(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
-IF(MSVC_CXX_ARCHITECTURE_ID)
- SET(CMAKE_CMCLDEPS_EXECUTABLE "@CMAKE_CMCLDEPS_EXECUTABLE@")
- SET(CMAKE_CL_SHOWINCLUDE_PREFIX "@CMAKE_CL_SHOWINCLUDE_PREFIX@")
-ENDIF()
+ at SET_CMAKE_CMCLDEPS_EXECUTABLE@
+ at SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index 49a54d0..5b6376a 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -50,7 +50,5 @@ SET(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@")
SET(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
-IF(MSVC_CXX_ARCHITECTURE_ID)
- SET(CMAKE_CMCLDEPS_EXECUTABLE "@CMAKE_CMCLDEPS_EXECUTABLE@")
- SET(CMAKE_CL_SHOWINCLUDE_PREFIX "@CMAKE_CL_SHOWINCLUDE_PREFIX@")
-ENDIF()
+ at SET_CMAKE_CMCLDEPS_EXECUTABLE@
+ at SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake
index 1d3e986..9c49169 100644
--- a/Modules/CMakeClDeps.cmake
+++ b/Modules/CMakeClDeps.cmake
@@ -17,7 +17,7 @@
# in front of each include path, so it can remove it.
#
-IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER)
+IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
STRING(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
FILE(WRITE ${showdir}/foo.h "\n")
@@ -29,5 +29,6 @@ IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPIL
STRING(TOLOWER ${header1} header2)
STRING(REPLACE ${header2} "" showOut2 ${showOut1})
STRING(REPLACE "\n" "" showOut3 ${showOut2})
- SET(CMAKE_CL_SHOWINCLUDE_PREFIX ${showOut3} CACHE STRING "cl.exe's /showInclides prefix" FORCE)
+ SET(SET_CMAKE_CMCLDEPS_EXECUTABLE "SET(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
+ SET(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "SET(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")")
ENDIF()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=64c5752d938457be411e3a9d781d4441e6634743
commit 64c5752d938457be411e3a9d781d4441e6634743
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Sat Jun 9 10:43:23 2012 +0200
Commit: Peter Kuemmel <syntheticpp at gmx.net>
CommitDate: Sat Jun 9 10:43:23 2012 +0200
Ninja: add copyright and description
diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake
index 9fac729..1d3e986 100644
--- a/Modules/CMakeClDeps.cmake
+++ b/Modules/CMakeClDeps.cmake
@@ -1,3 +1,22 @@
+#=============================================================================
+# Copyright 2012 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+#
+# When using Ninja cl.exe is wrapped by cmcldeps to extract the included
+# headers for dependency tracking.
+#
+# cmcldeps path is set, and cmcldeps needs to know the localized string
+# in front of each include path, so it can remove it.
+#
+
IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER)
STRING(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
-----------------------------------------------------------------------
Summary of changes:
Modules/CMakeCCompiler.cmake.in | 6 ++----
Modules/CMakeCXXCompiler.cmake.in | 6 ++----
Modules/CMakeClDeps.cmake | 27 +++++++++++++++++++++++++--
Source/cmNinjaTargetGenerator.cxx | 16 ++++++++++++++--
Source/cmcldeps.cxx | 12 ++++++++----
5 files changed, 51 insertions(+), 16 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list