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 0c6d0cc151a17bf9ecd00d7f98881e56810e6325 (commit) via 62863106f0e03a98d6de2fb8580162dce8702c1a (commit) from 042c07cc4fe301fa38d91549f62133874b2ab353 (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=0c6d0cc151a17bf9ecd00d7f98881e56810e6325 commit 0c6d0cc151a17bf9ecd00d7f98881e56810e6325 Merge: 042c07c 6286310 Author: Brad King <brad.k...@kitware.com> AuthorDate: Mon Jun 9 10:27:26 2014 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Mon Jun 9 10:27:26 2014 -0400 Merge topic 'WriteCompilerDetectionHeader-deprecated-define' into next 62863106 WCDH: Add compatibility defines for deprecation. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=62863106f0e03a98d6de2fb8580162dce8702c1a commit 62863106f0e03a98d6de2fb8580162dce8702c1a Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Wed May 14 22:10:10 2014 +0200 Commit: Brad King <brad.k...@kitware.com> CommitDate: Mon Jun 9 10:28:24 2014 -0400 WCDH: Add compatibility defines for deprecation. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index f80943d..6e64cd2 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -133,16 +133,37 @@ # ``static_assert``, or ignored if using the backward compatibility # implementation. # -# ====================== ================================ =================== -# Feature Define Symbol -# ====================== ================================ =================== -# ``cxx_alignas`` ``<PREFIX>_ALIGNAS`` ``alignas`` -# ``cxx_alignof`` ``<PREFIX>_ALIGNOF`` ``alignof`` -# ``cxx_nullptr`` ``<PREFIX>_NULLPTR`` ``nullptr`` -# ``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT`` ``static_assert`` -# ``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT_MSG`` ``static_assert`` -# ====================== ================================ =================== - +# The ``cxx_attribute_deprecated`` feature provides a macro definition +# ``<PREFIX>_DEPRECATED``, which expands to either the standard +# ``[[deprecated]]`` attribute or a compiler-specific decorator such +# as ``__attribute__((__deprecated__))`` used by GNU compilers. +# +# ============================= ================================ ===================== +# Feature Define Symbol +# ============================= ================================ ===================== +# ``cxx_alignas`` ``<PREFIX>_ALIGNAS`` ``alignas`` +# ``cxx_alignof`` ``<PREFIX>_ALIGNOF`` ``alignof`` +# ``cxx_nullptr`` ``<PREFIX>_NULLPTR`` ``nullptr`` +# ``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT`` ``static_assert`` +# ``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT_MSG`` ``static_assert`` +# ``cxx_attribute_deprecated`` ``<PREFIX>_DEPRECATED`` ``[[deprecated]]`` +# ``cxx_attribute_deprecated`` ``<PREFIX>_DEPRECATED_MSG`` ``[[deprecated]]`` +# ============================= ================================ ===================== +# +# A use-case which arises with such deprecation macros is the deprecation +# of an entire library. In that case, all public API in the library may +# be decorated with the ``<PREFIX>_DEPRECATED`` macro. This results in +# very noisy build output when building the library itself, so the macro +# may be may be defined to empty in that case when building the deprecated +# library: +# +# .. code-block:: cmake +# +# add_library(compat_support ${srcs}) +# target_compile_definitions(compat_support +# PRIVATE +# CompatSupport_DEPRECATED= +# ) #============================================================================= # Copyright 2014 Stephen Kelly <steve...@gmail.com> @@ -402,6 +423,27 @@ function(write_compiler_detection_header # endif \n") endif() + if (feature STREQUAL cxx_attribute_deprecated) + set(def_name ${prefix_arg}_${feature_PP}) + set(def_value "${prefix_arg}_DEPRECATED") + set(file_content "${file_content} +# ifndef ${def_value} +# if ${def_name} +# define ${def_value} [[deprecated]] +# define ${def_value}_MSG(MSG) [[deprecated(MSG)]] +# elif defined(__GNUC__) || defined(__clang__) +# define ${def_value} __attribute__((__deprecated__)) +# define ${def_value}_MSG(MSG) __attribute__((__deprecated__(MSG))) +# elif defined(_MSC_VER) +# define ${def_value} __declspec(deprecated) +# define ${def_value}_MSG(MSG) __declspec(deprecated(MSG)) +# else +# define ${def_value} +# define ${def_value}_MSG(MSG) +# endif +# endif +\n") + endif() endforeach() set(file_content "${file_content}#endif\n") ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits