[Cmake-commits] CMake branch, next, updated. v3.8.0-762-gf22cd6f

Kitware Robot kwrobot at kitware.com
Thu Apr 13 15:55:02 EDT 2017


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  f22cd6fb2c2ff43f4d2b07c7349672581e39d247 (commit)
       via  d2b0a47c6fc4f3f4c9c869111c0750f6d5a9d574 (commit)
      from  d28b86948c2e63628cfabc682616f5672efce457 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f22cd6fb2c2ff43f4d2b07c7349672581e39d247
commit f22cd6fb2c2ff43f4d2b07c7349672581e39d247
Merge: d28b869 d2b0a47
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 13 19:53:36 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Apr 13 15:53:52 2017 -0400

    Stage topic 'iwyu-mapping'
    
    Topic-id: 23607
    Topic-url: https://gitlab.kitware.com/cmake/cmake/merge_requests/692


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d2b0a47c6fc4f3f4c9c869111c0750f6d5a9d574
commit d2b0a47c6fc4f3f4c9c869111c0750f6d5a9d574
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Tue Apr 11 22:56:50 2017 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Thu Apr 13 16:04:10 2017 +0200

    Add include-what-you-use mapping

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed5de10..545177b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -226,6 +226,17 @@ option(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
 mark_as_advanced(CMAKE_USE_FOLDERS)
 
 
+option(CMake_RUN_IWYU "Run include-what-you-use with the compiler." OFF)
+if(CMake_RUN_IWYU)
+  find_program(IWYU_COMMAND NAMES include-what-you-use iwyu)
+  if(NOT IWYU_COMMAND)
+    message(FATAL_ERROR "CMake_RUN_IWYU is ON but include-what-you-use is not found!")
+  endif()
+  set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
+    "${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp")
+endif()
+
+
 #-----------------------------------------------------------------------
 # a macro that only sets the FOLDER target property if it's
 # "appropriate"
diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp
new file mode 100644
index 0000000..cfa90cc
--- /dev/null
+++ b/Utilities/IWYU/mapping.imp
@@ -0,0 +1,136 @@
+[
+  # C++ alternatives to C standard headers
+  { include: [ "<assert.h>", public, "<cassert>", public ] },
+  { include: [ "<complex.h>", public, "<ccomplex>", public ] },
+  { include: [ "<ctype.h>", public, "<cctype>", public ] },
+  { include: [ "<errno.h>", public, "<cerrno>", public ] },
+  { include: [ "<float.h>", public, "<cfloat>", public ] },
+  { include: [ "<iso646.h>", public, "<ciso646>", public ] },
+  { include: [ "<limits.h>", public, "<climits>", public ] },
+  { include: [ "<locale.h>", public, "<clocale>", public ] },
+  { include: [ "<math.h>", public, "<cmath>", public ] },
+  { include: [ "<setjmp.h>", public, "<csetjmp>", public ] },
+  { include: [ "<signal.h>", public, "<csignal>", public ] },
+  { include: [ "<stdarg.h>", public, "<cstdarg>", public ] },
+  { include: [ "<stddef.h>", public, "<cstddef>", public ] },
+  { include: [ "<stdio.h>", public, "<cstdio>", public ] },
+  { include: [ "<stdlib.h>", public, "<cstdlib>", public ] },
+  { include: [ "<string.h>", public, "<cstring>", public ] },
+  { include: [ "<time.h>", public, "<ctime>", public ] },
+  { include: [ "<wchar.h>", public, "<cwchar>", public ] },
+  { include: [ "<wctype.h>", public, "<cwctype>", public ] },
+
+  # HACK: check whether this can be removed with next iwyu release.
+  { include: [ "<bits/time.h>", private, "<time.h>", public ] },
+  { include: [ "<bits/types/clock_t.h>", private, "<time.h>", public ] },
+  { include: [ "<bits/types/struct_timespec.h>", private, "<time.h>", public ] },
+  { include: [ "<bits/types/struct_timeval.h>", private, "<time.h>", public ] },
+  { include: [ "<bits/types/struct_tm.h>", private, "<time.h>", public ] },
+  { include: [ "<bits/types/time_t.h>", private, "<time.h>", public ] },
+
+  # HACK: check whether this can be removed with next iwyu release.
+  { symbol: [ "__GLIBC__", private, "<stdlib.h>", public ] },
+  { symbol: [ "_Noreturn", private, "<stdlib.h>", public ] },
+
+  # HACK: iwyu wrongly thinks that including <iosfwd> is sufficient.
+  { symbol: [ "std::stringstream", private, "<sstream>", public ] },
+  { symbol: [ "std::istringstream", private, "<sstream>", public ] },
+  { symbol: [ "std::ostringstream", private, "<sstream>", public ] },
+
+  # HACK: iwyu suggests those two files each time vector[] is used.
+  # https://github.com/include-what-you-use/include-what-you-use/issues/166
+  { include: [ "<ext/alloc_traits.h>", private, "<vector>", public ] },
+  { include: [ "<memory>", public, "<vector>", public ] },
+
+  # TODO: enable this block and remove some <utility> includes?
+  #{ symbol: [ "std::pair", private, "<utility>", public ] },
+  #{ symbol: [ "std::pair", private, "<map>", public ] },
+  #{ symbol: [ "std::pair", private, "<set>", public ] },
+
+  # Wrappers for headers added in TR1 / C++11
+  # { include: [ "<array>", public, "\"cm_array.hxx\"", public ] },
+  # { include: [ "<functional>", public, "\"cm_functional.hxx\"", public ] },
+  # { include: [ "<memory>", public, "\"cm_memory.hxx\"", public ] },
+  { include: [ "<unordered_map>", public, "\"cm_unordered_map.hxx\"", public ] },
+  { include: [ "<unordered_set>", public, "\"cm_unordered_set.hxx\"", public ] },
+  # { include: [ "<tr1/array>", public, "\"cm_array.hxx\"", public ] },
+  # { include: [ "<tr1/functional>", public, "\"cm_functional.hxx\"", public ] },
+  # { include: [ "<tr1/memory>", public, "\"cm_memory.hxx\"", public ] },
+  { include: [ "<tr1/unordered_map>", public, "\"cm_unordered_map.hxx\"", public ] },
+  { include: [ "<tr1/unordered_set>", public, "\"cm_unordered_set.hxx\"", public ] },
+
+  # KWIML
+  { include: [ "<stdint.h>", public, "\"cm_kwiml.h\"", public ] },
+  { include: [ "<inttypes.h>", public, "\"cm_kwiml.h\"", public ] },
+
+  # Self-sufficient wrapper for <sys/stat.h>
+  { include: [ "<sys/stat.h>", public, "\"cm_sys_stat.h\"", public ] },
+  { symbol: [ "mode_t", private, "\"cm_sys_stat.h\"", public ] },
+
+  # TODO: remove once TR1 / C++11 is required.
+  { include: [ "\"cmsys/hash_fun.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] },
+  { include: [ "\"cmsys/hash_fun.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] },
+  { include: [ "\"cmsys/hash_map.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] },
+  { include: [ "\"cmsys/hash_set.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] },
+  { include: [ "\"cmsys/hashtable.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] },
+  { include: [ "\"cmsys/hashtable.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] },
+
+  # Wrappers for 3rd-party libraries used from the system.
+  { include: [ "<archive.h>", private, "\"cm_libarchive.h\"", public ] },
+  { include: [ "<archive_entry.h>", private, "\"cm_libarchive.h\"", public ] },
+  { include: [ "@<curl/.+\\.h>", private, "\"cm_curl.h\"", public ] },
+  { include: [ "<expat.h>", private, "\"cm_expat.h\"", public ] },
+  { include: [ "<expat_external.h>", private, "\"cm_expat.h\"", public ] },
+  { include: [ "<json/reader.h>", private, "\"cm_jsoncpp_reader.h\"", public ] },
+  { include: [ "<json/value.h>", private, "\"cm_jsoncpp_value.h\"", public ] },
+  { include: [ "<json/writer.h>", private, "\"cm_jsoncpp_writer.h\"", public ] },
+  { include: [ "<rhash.h>", private, "\"cm_rhash.h\"", public ] },
+  { include: [ "<uv.h>", private, "\"cm_uv.h\"", public ] },
+  { include: [ "@<uv-.+\\.h>", private, "\"cm_uv.h\"", public ] },
+  { include: [ "<kwiml/abi.h>", private, "\"cm_kwiml.h\"", public ] },
+  { include: [ "<kwiml/int.h>", private, "\"cm_kwiml.h\"", public ] },
+  { include: [ "<xmlrpc.h>", private, "\"cm_xmlrpc.h\"", public ] },
+  { include: [ "<xmlrpc_client.h>", private, "\"cm_xmlrpc.h\"", public ] },
+  { include: [ "@<xmlrpc-c/.+\\.h>", private, "\"cm_xmlrpc.h\"", public ] },
+  { include: [ "<zconf.h>", private, "\"cm_zlib.h\"", public ] },
+  { include: [ "<zlib.h>", private, "\"cm_zlib.h\"", public ] },
+
+  # Wrappers for bundled 3rd-party libraries.
+  { include: [ "\"cmlibarchive/libarchive/archive.h\"", private, "\"cm_libarchive.h\"", public ] },
+  { include: [ "\"cmlibarchive/libarchive/archive_entry.h\"", private, "\"cm_libarchive.h\"", public ] },
+  { include: [ "@\"cmcurl/include/curl/.+\\.h\"", private, "\"cm_curl.h\"", public ] },
+  { include: [ "\"cmexpat/lib/expat.h\"", private, "\"cm_expat.h\"", public ] },
+  { include: [ "\"cmexpat/lib/expat_external.h\"", private, "\"cm_expat.h\"", public ] },
+  { include: [ "\"cmjsoncpp/include/json/reader.h\"", private, "\"cm_jsoncpp_reader.h\"", public ] },
+  { include: [ "\"cmjsoncpp/include/json/value.h\"", private, "\"cm_jsoncpp_value.h\"", public ] },
+  { include: [ "\"cmjsoncpp/include/json/writer.h\"", private, "\"cm_jsoncpp_writer.h\"", public ] },
+  { include: [ "\"cmlibrhash/librhash/rhash.h\"", private, "\"cm_rhash.h\"", public ] },
+  { include: [ "\"cmlibuv/include/uv.h\"", private, "\"cm_uv.h\"", public ] },
+  { include: [ "@\"cmlibuv/include/uv-.+\\.h\"", private, "\"cm_uv.h\"", public ] },
+  { include: [ "\"KWIML/include/kwiml/abi.h\"", private, "\"cm_kwiml.h\"", public ] },
+  { include: [ "\"KWIML/include/kwiml/int.h\"", private, "\"cm_kwiml.h\"", public ] },
+  { include: [ "\"cmzlib/cm_zlib_mangle.h\"", private, "\"cm_zlib.h\"", public ] },
+  { include: [ "\"cmzlib/zconf.h\"", private, "\"cm_zlib.h\"", public ] },
+  { include: [ "\"cmzlib/zlib.h\"", private, "\"cm_zlib.h\"", public ] },
+
+  { symbol: [ "std::ifstream", private, "\"cmsys/FStream.hxx\"", public ] },
+  { symbol: [ "std::ofstream", private, "\"cmsys/FStream.hxx\"", public ] },
+  { symbol: [ "cmsys::ifstream", private, "\"cmsys/FStream.hxx\"", public ] },
+  { symbol: [ "cmsys::ofstream", private, "\"cmsys/FStream.hxx\"", public ] },
+
+  { include: [ "<istream>", public, "\"cmsys/FStream.hxx\"", public ] },
+  { include: [ "<ostream>", public, "\"cmsys/FStream.hxx\"", public ] },
+  { include: [ "<fstream>", public, "\"cmsys/FStream.hxx\"", public ] },
+
+  # major and minor are used as macro arguments. Those are false matches.
+  { symbol: [ "major", private, "\"cm_kwiml.h\"", public ] },
+  { symbol: [ "minor", private, "\"cm_kwiml.h\"", public ] },
+  { symbol: [ "major", private, "\"cmVersion.h\"", public ] },
+  { symbol: [ "minor", private, "\"cmVersion.h\"", public ] },
+
+  { include: [ "<curses.h>", private, "\"cmCursesStandardIncludes.h\"", public ] },
+  { include: [ "\"form.h\"", private, "\"cmCursesStandardIncludes.h\"", public ] },
+  { include: [ "<form.h>", private, "\"cmCursesStandardIncludes.h\"", public ] },
+]
+
+# vim: set ft=toml:

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

Summary of changes:
 CMakeLists.txt             |   11 ++++
 Utilities/IWYU/mapping.imp |  136 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 147 insertions(+)
 create mode 100644 Utilities/IWYU/mapping.imp


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list