[Cmake-commits] CMake branch, next, updated. v3.3.0-1611-g967364d
Brad King
brad.king at kitware.com
Fri Jul 31 09:50:46 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 967364dea4fb2a13bfe22f73d8343bccf15d3883 (commit)
via 5d0a8b1abc3f8a6d8d23772251b4ef2758d2def6 (commit)
via afb674ab46a7d6ff3d1801315f3d852bdba79d0c (commit)
via 1c46b6aed0db88c97189713f291164f98df780a9 (commit)
from fb65bd6b653a30e83faf97c73e0de1961f6e5c7e (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=967364dea4fb2a13bfe22f73d8343bccf15d3883
commit 967364dea4fb2a13bfe22f73d8343bccf15d3883
Merge: fb65bd6 5d0a8b1
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Jul 31 09:50:45 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jul 31 09:50:45 2015 -0400
Merge topic 'GetPrerequisites-updates' into next
5d0a8b1a GetPrerequisites: Optionally filter "objdump" output for speed
afb674ab GetPrerequisites: Add error checks for execute_process() calls
1c46b6ae FindMPI: Drop unnecessary and incorrect use of GetPrerequisites
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d0a8b1abc3f8a6d8d23772251b4ef2758d2def6
commit 5d0a8b1abc3f8a6d8d23772251b4ef2758d2def6
Author: Bill Somerville <bill at classdesign.com>
AuthorDate: Wed Jul 29 17:36:38 2015 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Jul 31 09:50:32 2015 -0400
GetPrerequisites: Optionally filter "objdump" output for speed
As dumpbin.exe is no longer reliable for gcc libraries on MinGW because
it crashes on many common libraries like libgcc_s and libgfortran it is
now necessary too resort to using objdump for DLL dependency walking.
Using objdump has a secondary problem in that it generates a lot of
output for large libraries and causes fixup_bundle() to take many
minutes to process what took fractions of a second with
"dumpbin.exe /dependents".
Add a 'grep' pre-filter in the execute_process() command pipeline to
reduce this output to a minimum for a several orders of magnitude speed
up. If grep is not available just use the full output.
As there does not seem to be a reliable way of detecting MinGW, callers
of fixup_bundle() may have to set the variable gp_tool to "objdump" if
dumpbin.exe is installed on the build machine to stop it using the
broken MS dumpbin.exe for library dependency walking.
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index a359d2c..e4018b6 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -700,6 +700,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
return()
endif()
+ set(gp_cmd_maybe_filter) # optional command to pre-filter gp_tool results
+
if(gp_tool STREQUAL "ldd")
set(gp_cmd_args "")
set(gp_regex "^[\t ]*[^\t ]+ => ([^\t\(]+) .*${eol_char}$")
@@ -724,6 +726,11 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
set(gp_regex_error "")
set(gp_regex_fallback "")
set(gp_regex_cmp_count 1)
+ # objdump generaates copious output so we create a grep filter to pre-filter results
+ find_program(gp_grep_cmd grep)
+ if(gp_grep_cmd)
+ set(gp_cmd_maybe_filter COMMAND ${gp_grep_cmd} "^[[:blank:]]*DLL Name: ")
+ endif()
else()
message(STATUS "warning: gp_tool='${gp_tool}' is an unknown tool...")
message(STATUS "CMake function get_prerequisites needs more code to handle '${gp_tool}'")
@@ -780,6 +787,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
#
execute_process(
COMMAND ${gp_cmd} ${gp_cmd_args} ${target}
+ ${gp_cmd_maybe_filter}
RESULT_VARIABLE gp_rv
OUTPUT_VARIABLE gp_cmd_ov
ERROR_VARIABLE gp_ev
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=afb674ab46a7d6ff3d1801315f3d852bdba79d0c
commit afb674ab46a7d6ff3d1801315f3d852bdba79d0c
Author: Bill Somerville <bill at classdesign.com>
AuthorDate: Wed Jul 29 17:05:51 2015 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Jul 31 09:50:32 2015 -0400
GetPrerequisites: Add error checks for execute_process() calls
Add return status checks to external command invocations so that they do
not fail silently producing incomplete install packages.
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 23d486e..a359d2c 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -229,9 +229,14 @@ function(is_file_executable file result_var)
if(file_cmd)
execute_process(COMMAND "${file_cmd}" "${file_full}"
+ RESULT_VARIABLE file_rv
OUTPUT_VARIABLE file_ov
+ ERROR_VARIABLE file_ev
OUTPUT_STRIP_TRAILING_WHITESPACE
)
+ if(NOT file_rv STREQUAL "0")
+ message(FATAL_ERROR "${file_cmd} failed: ${file_rv}\n${file_ev}")
+ endif()
# Replace the name of the file in the output with a placeholder token
# (the string " _file_full_ ") so that just in case the path name of
@@ -543,11 +548,21 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
if(CYGPATH_EXECUTABLE)
execute_process(COMMAND ${CYGPATH_EXECUTABLE} -W
+ RESULT_VARIABLE env_rv
OUTPUT_VARIABLE env_windir
+ ERROR_VARIABLE env_ev
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(NOT env_rv STREQUAL "0")
+ message(FATAL_ERROR "${CYGPATH_EXECUTABLE} -W failed: ${env_rv}\n${env_ev}")
+ endif()
execute_process(COMMAND ${CYGPATH_EXECUTABLE} -S
+ RESULT_VARIABLE env_rv
OUTPUT_VARIABLE env_sysdir
+ ERROR_VARIABLE env_ev
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(NOT env_rv STREQUAL "0")
+ message(FATAL_ERROR "${CYGPATH_EXECUTABLE} -S failed: ${env_rv}\n${env_ev}")
+ endif()
string(TOLOWER "${env_windir}" windir)
string(TOLOWER "${env_sysdir}" sysroot)
@@ -765,8 +780,18 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
#
execute_process(
COMMAND ${gp_cmd} ${gp_cmd_args} ${target}
+ RESULT_VARIABLE gp_rv
OUTPUT_VARIABLE gp_cmd_ov
+ ERROR_VARIABLE gp_ev
)
+ if(NOT gp_rv STREQUAL "0")
+ if(gp_tool STREQUAL "dumpbin")
+ # dumpbin error messages seem to go to stdout
+ message(FATAL_ERROR "${gp_cmd} failed: ${gp_rv}\n${gp_ev}\n${gp_cmd_ov}")
+ else()
+ message(FATAL_ERROR "${gp_cmd} failed: ${gp_rv}\n${gp_ev}")
+ endif()
+ endif()
if(gp_tool STREQUAL "ldd")
set(ENV{LD_LIBRARY_PATH} "${old_ld_env}")
@@ -791,8 +816,13 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if(gp_tool STREQUAL "otool")
execute_process(
COMMAND otool -D ${target}
+ RESULT_VARIABLE otool_rv
OUTPUT_VARIABLE gp_install_id_ov
+ ERROR_VARIABLE otool_ev
)
+ if(NOT otool_rv STREQUAL "0")
+ message(FATAL_ERROR "otool -D failed: ${otool_rv}\n${otool_ev}")
+ endif()
# second line is install name
string(REGEX REPLACE ".*:\n" "" gp_install_id "${gp_install_id_ov}")
if(gp_install_id)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c46b6aed0db88c97189713f291164f98df780a9
commit 1c46b6aed0db88c97189713f291164f98df780a9
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Jul 31 09:42:25 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Jul 31 09:50:31 2015 -0400
FindMPI: Drop unnecessary and incorrect use of GetPrerequisites
Since commit v2.8.5~121^2~2 (FindMPI: Handle multiple languages,
2010-12-29) we called the GetPrerequisites is_file_executable function
but passed the name of a CMake variable instead of its value. Therefore
the function has always failed and caused the search for the compiler
name to run even with an absolute path. Switch to using if(IS_ABSOLUTE)
instead and drop use of GetPrerequisites.
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 06ecfaa..48adf3c 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -102,7 +102,6 @@
# include this to handle the QUIETLY and REQUIRED arguments
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-include(${CMAKE_CURRENT_LIST_DIR}/GetPrerequisites.cmake)
#
# This part detects MPI compilers, attempting to wade through the mess of compiler names in
@@ -578,14 +577,13 @@ foreach (lang C CXX Fortran)
if (CMAKE_${lang}_COMPILER_WORKS)
# If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler.
if (MPI_${lang}_COMPILER)
- is_file_executable(MPI_${lang}_COMPILER MPI_COMPILER_IS_EXECUTABLE)
- if (NOT MPI_COMPILER_IS_EXECUTABLE)
+ if (NOT IS_ABSOLUTE "${MPI_${lang}_COMPILER}")
# Get rid of our default list of names and just search for the name the user wants.
set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER})
set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
- # If the user specifies a compiler, we don't want to try to search libraries either.
- set(try_libs FALSE)
endif()
+ # If the user specifies a compiler, we don't want to try to search libraries either.
+ set(try_libs FALSE)
else()
set(try_libs TRUE)
endif()
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list