[Cmake-commits] CMake branch, next, updated. v3.3.2-3071-g7850cfe

Brad King brad.king at kitware.com
Fri Sep 18 10:06:58 EDT 2015


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  7850cfecff44ecdf0f8cefcc5f0d15b68df2941f (commit)
       via  109a7a245acf0c367ac092f6c9a20661e7a31529 (commit)
       via  828c05b9f567e0652ebbee6df2799a189ff586fe (commit)
       via  c73fbda66b5985e4ba99499f871ffd19bcf32aaa (commit)
      from  ab2c1d35afa9e7263a390d44b7bc614a013057bf (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=7850cfecff44ecdf0f8cefcc5f0d15b68df2941f
commit 7850cfecff44ecdf0f8cefcc5f0d15b68df2941f
Merge: ab2c1d3 109a7a2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 18 10:06:57 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Sep 18 10:06:57 2015 -0400

    Merge topic 'ninja-refactor-msvc-deps' into next
    
    109a7a24 Ninja: Detect MSVC /showIncludes prefix with compiler flags (#15596)
    828c05b9 Ninja: Refactor lookup of cmcldeps location
    c73fbda6 CMakeDetermineCompilerId: Drop unused code path


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=109a7a245acf0c367ac092f6c9a20661e7a31529
commit 109a7a245acf0c367ac092f6c9a20661e7a31529
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 18 09:09:07 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 18 10:02:53 2015 -0400

    Ninja: Detect MSVC /showIncludes prefix with compiler flags (#15596)
    
    Move detection over to the compiler id logic where we have already
    constructed the list of compiler flags from ARG1 and CMAKE_<LANG>_FLAGS.
    Pass the flags when we execute "cl" with "/showIncludes".  Also pass "/c"
    because we only need to compile, not link.  Check the compiler process
    exit code before trusting its output.

diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 00c6fdf..c72e338 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -53,11 +53,14 @@ if(CMAKE_C_LIBRARY_ARCHITECTURE)
   set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
 endif()
 
+set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "@CMAKE_C_CL_SHOWINCLUDES_PREFIX@")
+if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
+  set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
+endif()
+
 @CMAKE_C_SYSROOT_FLAG_CODE@
 @CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
 
 set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
 set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
 set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
-
- at SET_CMAKE_CL_SHOWINCLUDES_PREFIX@
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index e4e1257..52e44f6 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -54,11 +54,14 @@ if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
   set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
 endif()
 
+set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "@CMAKE_CXX_CL_SHOWINCLUDES_PREFIX@")
+if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
+  set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
+endif()
+
 @CMAKE_CXX_SYSROOT_FLAG_CODE@
 @CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
 
 set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
 set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
 set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
-
- at SET_CMAKE_CL_SHOWINCLUDES_PREFIX@
diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake
deleted file mode 100644
index 2794123..0000000
--- a/Modules/CMakeClDeps.cmake
+++ /dev/null
@@ -1,32 +0,0 @@
-
-#=============================================================================
-# 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.
-#=============================================================================
-# (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
-# 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(CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
-  set(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
-  file(WRITE ${showdir}/foo.h "\n")
-  file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
-  execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
-                  WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE outLine)
-  string(REGEX MATCH "\n([^:]*:[^:]*:[ \t]*)" tmp "${outLine}")
-  set(localizedPrefix "${CMAKE_MATCH_1}")
-  set(SET_CMAKE_CL_SHOWINCLUDES_PREFIX "set(CMAKE_CL_SHOWINCLUDES_PREFIX \"${localizedPrefix}\")")
-endif()
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 9bd1d67..4b0d278 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -173,7 +173,6 @@ endif ()
 
 include(CMakeFindBinUtils)
 if(MSVC_C_ARCHITECTURE_ID)
-  include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
   set(SET_MSVC_C_ARCHITECTURE_ID
     "set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
 endif()
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index f25a2db..680356d 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -171,7 +171,6 @@ endif ()
 
 include(CMakeFindBinUtils)
 if(MSVC_CXX_ARCHITECTURE_ID)
-  include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
   set(SET_MSVC_CXX_ARCHITECTURE_ID
     "set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
 endif()
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index b73996b..df6daf3 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -75,6 +75,12 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
     set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
   endif()
 
+  if(CMAKE_GENERATOR STREQUAL "Ninja" AND MSVC_${lang}_ARCHITECTURE_ID)
+    CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX(${lang})
+  else()
+    set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "")
+  endif()
+
   # Display the final identification result.
   if(CMAKE_${lang}_COMPILER_ID)
     if(CMAKE_${lang}_COMPILER_VERSION)
@@ -99,6 +105,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
   set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
   set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
     PARENT_SCOPE)
+  set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX}" PARENT_SCOPE)
   set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
   set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE)
   set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE)
@@ -638,3 +645,27 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
     endif()
   endforeach()
 endfunction()
+
+function(CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX lang)
+  # Run this MSVC-compatible compiler to detect what the /showIncludes
+  # option displays.  We can use a C source even with the C++ compiler
+  # because MSVC-compatible compilers handle both and show the same output.
+  set(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
+  file(WRITE ${showdir}/foo.h "\n")
+  file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
+  execute_process(
+    COMMAND "${CMAKE_${lang}_COMPILER}"
+            ${CMAKE_${lang}_COMPILER_ID_ARG1}
+            ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
+            /nologo /showIncludes /c main.c
+    WORKING_DIRECTORY ${showdir}
+    OUTPUT_VARIABLE out
+    ERROR_VARIABLE err
+    RESULT_VARIABLE res
+    )
+  if(res EQUAL 0 AND "${out}" MATCHES "\n([^:]*:[^:]*:[ \t]*)")
+    set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_1}" PARENT_SCOPE)
+  else()
+    set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "" PARENT_SCOPE)
+  endif()
+endfunction()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=828c05b9f567e0652ebbee6df2799a189ff586fe
commit 828c05b9f567e0652ebbee6df2799a189ff586fe
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 18 08:47:27 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 18 10:01:25 2015 -0400

    Ninja: Refactor lookup of cmcldeps location
    
    This executable comes with CMake so just compute its location in
    cmSystemTools instead of storing it in compiler information modules.

diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 2ad2f34..00c6fdf 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -60,5 +60,4 @@ set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
 set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
 set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
 
- at SET_CMAKE_CMCLDEPS_EXECUTABLE@
 @SET_CMAKE_CL_SHOWINCLUDES_PREFIX@
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index c6582a7..e4e1257 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -61,5 +61,4 @@ set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
 set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
 set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
 
- at SET_CMAKE_CMCLDEPS_EXECUTABLE@
 @SET_CMAKE_CL_SHOWINCLUDES_PREFIX@
diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake
index b46e7c2..2794123 100644
--- a/Modules/CMakeClDeps.cmake
+++ b/Modules/CMakeClDeps.cmake
@@ -21,7 +21,6 @@
 #
 
 if(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")
   file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
@@ -29,6 +28,5 @@ if(CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
                   WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE outLine)
   string(REGEX MATCH "\n([^:]*:[^:]*:[ \t]*)" tmp "${outLine}")
   set(localizedPrefix "${CMAKE_MATCH_1}")
-  set(SET_CMAKE_CMCLDEPS_EXECUTABLE   "set(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
   set(SET_CMAKE_CL_SHOWINCLUDES_PREFIX "set(CMAKE_CL_SHOWINCLUDES_PREFIX \"${localizedPrefix}\")")
 endif()
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 752c8a7..f46c5b9 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -371,7 +371,7 @@ cmNinjaTargetGenerator
                         mf->GetSafeDefinition("CMAKE_C_COMPILER") :
                         mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
       cldeps =  "\"";
-      cldeps += mf->GetSafeDefinition("CMAKE_CMCLDEPS_EXECUTABLE");
+      cldeps += cmSystemTools::GetCMClDepsCommand();
       cldeps += "\" " + lang + " $in \"$DEP_FILE\" $out \"";
       cldeps += mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDES_PREFIX");
       cldeps += "\" \"" + cl + "\" ";
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 005a803..2675066 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2216,6 +2216,7 @@ static std::string cmSystemToolsCTestCommand;
 static std::string cmSystemToolsCPackCommand;
 static std::string cmSystemToolsCMakeCursesCommand;
 static std::string cmSystemToolsCMakeGUICommand;
+static std::string cmSystemToolsCMClDepsCommand;
 static std::string cmSystemToolsCMakeRoot;
 void cmSystemTools::FindCMakeResources(const char* argv0)
 {
@@ -2308,6 +2309,13 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
     {
     cmSystemToolsCMakeCursesCommand = "";
     }
+  cmSystemToolsCMClDepsCommand = exe_dir;
+  cmSystemToolsCMClDepsCommand += "/cmcldeps";
+  cmSystemToolsCMClDepsCommand += cmSystemTools::GetExecutableExtension();
+  if(!cmSystemTools::FileExists(cmSystemToolsCMClDepsCommand.c_str()))
+    {
+    cmSystemToolsCMClDepsCommand = "";
+    }
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
   // Install tree has "<prefix>/bin/cmake" and "<prefix><CMAKE_DATA_DIR>".
@@ -2375,6 +2383,12 @@ std::string const& cmSystemTools::GetCMakeGUICommand()
 }
 
 //----------------------------------------------------------------------------
+std::string const& cmSystemTools::GetCMClDepsCommand()
+{
+  return cmSystemToolsCMClDepsCommand;
+}
+
+//----------------------------------------------------------------------------
 std::string const& cmSystemTools::GetCMakeRoot()
 {
   return cmSystemToolsCMakeRoot;
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index d14897f..e88170a 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -426,6 +426,7 @@ public:
   static std::string const& GetCMakeCommand();
   static std::string const& GetCMakeGUICommand();
   static std::string const& GetCMakeCursesCommand();
+  static std::string const& GetCMClDepsCommand();
   static std::string const& GetCMakeRoot();
 
   /** Echo a message in color using KWSys's Terminal cprintf.  */

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c73fbda66b5985e4ba99499f871ffd19bcf32aaa
commit c73fbda66b5985e4ba99499f871ffd19bcf32aaa
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 18 09:13:32 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 18 10:01:25 2015 -0400

    CMakeDetermineCompilerId: Drop unused code path
    
    The execute_process command always exists so we never need to fall back on
    exec_program.

diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 81f4ae6..b73996b 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -314,29 +314,17 @@ Id flags: ${testflags}
       endif()
     endif()
   else()
-    if(COMMAND EXECUTE_PROCESS)
-      execute_process(
-        COMMAND "${CMAKE_${lang}_COMPILER}"
-                ${CMAKE_${lang}_COMPILER_ID_ARG1}
-                ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
-                ${testflags}
-                "${src}"
-        WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
-        OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
-        ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
-        RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
-        )
-    else()
-      exec_program(
-        "${CMAKE_${lang}_COMPILER}" ${CMAKE_${lang}_COMPILER_ID_DIR}
-        ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
-             ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
-             ${testflags}
-             \"${src}\"
-        OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
-        RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
-        )
-    endif()
+    execute_process(
+      COMMAND "${CMAKE_${lang}_COMPILER}"
+              ${CMAKE_${lang}_COMPILER_ID_ARG1}
+              ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
+              ${testflags}
+              "${src}"
+      WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
+      OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+      ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+      RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
+      )
   endif()
 
   # Check the result of compilation.

-----------------------------------------------------------------------

Summary of changes:
 Modules/CMakeCCompiler.cmake.in         |    8 ++--
 Modules/CMakeCXXCompiler.cmake.in       |    8 ++--
 Modules/CMakeClDeps.cmake               |   34 ----------------
 Modules/CMakeDetermineCCompiler.cmake   |    1 -
 Modules/CMakeDetermineCXXCompiler.cmake |    1 -
 Modules/CMakeDetermineCompilerId.cmake  |   65 ++++++++++++++++++++-----------
 Source/cmNinjaTargetGenerator.cxx       |    2 +-
 Source/cmSystemTools.cxx                |   14 +++++++
 Source/cmSystemTools.h                  |    1 +
 9 files changed, 68 insertions(+), 66 deletions(-)
 delete mode 100644 Modules/CMakeClDeps.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list