[Cmake-commits] CMake branch, master, updated. v3.9.1-516-g774d649
Kitware Robot
kwrobot at kitware.com
Mon Aug 21 08:55:11 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, master has been updated
via 774d649126d32f1acbf4c9d10771e337c63cef7d (commit)
via c1f3eb9f2d628b2911aa17f65012fab0befc4b87 (commit)
via e488c7f9ee438e8b076d5e56a5f21ab3fd892508 (commit)
via fd4fd9a276126a1b1044d57a064c3b8201a91a33 (commit)
from a1b84ac2a6eec367a8a56f4a0f811e78f5d60fab (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=774d649126d32f1acbf4c9d10771e337c63cef7d
commit 774d649126d32f1acbf4c9d10771e337c63cef7d
Merge: c1f3eb9 e488c7f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 21 12:47:12 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Aug 21 08:51:06 2017 -0400
Merge topic 'bootstrap-grep-solaris'
e488c7f9 bootstrap: Restore output redirection instead of "grep -q"
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1144
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1f3eb9f2d628b2911aa17f65012fab0befc4b87
commit c1f3eb9f2d628b2911aa17f65012fab0befc4b87
Merge: a1b84ac fd4fd9a
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 21 12:46:51 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Aug 21 08:48:24 2017 -0400
Merge topic 'require-c++11'
fd4fd9a2 Require C++11 to build CMake itself
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1132
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e488c7f9ee438e8b076d5e56a5f21ab3fd892508
commit e488c7f9ee438e8b076d5e56a5f21ab3fd892508
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Aug 16 11:06:40 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Aug 16 11:09:39 2017 -0400
bootstrap: Restore output redirection instead of "grep -q"
This reverts commit 567bac890c (bootstrap: use "grep -q" instead of
output redirection, 2017-06-07). On Solaris `grep -q` does not exist.
diff --git a/bootstrap b/bootstrap
index 9d73233..a7b5cfb 100755
--- a/bootstrap
+++ b/bootstrap
@@ -80,7 +80,7 @@ cmake_sphinx_build=""
cmake_sphinx_flags=""
# Determine whether this is a Cygwin environment.
-if echo "${cmake_system}" | grep -q CYGWIN; then
+if echo "${cmake_system}" | grep CYGWIN >/dev/null 2>&1; then
cmake_system_cygwin=true
cmake_doc_dir_keyword="CYGWIN"
cmake_man_dir_keyword="CYGWIN"
@@ -89,21 +89,21 @@ else
fi
# Determine whether this is a MinGW environment.
-if echo "${cmake_system}" | grep -q 'MINGW\|MSYS'; then
+if echo "${cmake_system}" | grep 'MINGW\|MSYS' >/dev/null 2>&1; then
cmake_system_mingw=true
else
cmake_system_mingw=false
fi
# Determine whether this is OS X
-if echo "${cmake_system}" | grep -q Darwin; then
+if echo "${cmake_system}" | grep Darwin >/dev/null 2>&1; then
cmake_system_darwin=true
else
cmake_system_darwin=false
fi
# Determine whether this is BeOS
-if echo "${cmake_system}" | grep -q BeOS; then
+if echo "${cmake_system}" | grep BeOS >/dev/null 2>&1; then
cmake_system_beos=true
cmake_doc_dir_keyword="HAIKU"
cmake_man_dir_keyword="HAIKU"
@@ -112,7 +112,7 @@ else
fi
# Determine whether this is Haiku
-if echo "${cmake_system}" | grep -q Haiku; then
+if echo "${cmake_system}" | grep Haiku >/dev/null 2>&1; then
cmake_system_haiku=true
cmake_doc_dir_keyword="HAIKU"
cmake_man_dir_keyword="HAIKU"
@@ -121,14 +121,14 @@ else
fi
# Determine whether this is OpenVMS
-if echo "${cmake_system}" | grep -q OpenVMS; then
+if echo "${cmake_system}" | grep OpenVMS >/dev/null 2>&1; then
cmake_system_openvms=true
else
cmake_system_openvms=false
fi
# Determine whether this is HP-UX
-if echo "${cmake_system}" | grep -q HP-UX; then
+if echo "${cmake_system}" | grep HP-UX >/dev/null 2>&1; then
die 'CMake no longer compiles on HP-UX. See
https://gitlab.kitware.com/cmake/cmake/issues/17137
@@ -140,7 +140,7 @@ else
fi
# Determine whether this is Linux
-if echo "${cmake_system}" | grep -q Linux; then
+if echo "${cmake_system}" | grep Linux >/dev/null 2>&1; then
cmake_system_linux=true
else
cmake_system_linux=false
@@ -151,11 +151,11 @@ else
# may falsely detect parisc on HP-UX m68k
cmake_machine_parisc=false
if ${cmake_system_linux}; then
- if uname -m | grep -q parisc; then
+ if uname -m | grep parisc >/dev/null 2>&1; then
cmake_machine_parisc=true
fi
elif ${cmake_system_hpux}; then
- if uname -m | grep -q ia64; then : ; else
+ if uname -m | grep ia64 >/dev/null 2>&1; then : ; else
cmake_machine_parisc=true
fi
fi
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd4fd9a276126a1b1044d57a064c3b8201a91a33
commit fd4fd9a276126a1b1044d57a064c3b8201a91a33
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Aug 11 13:19:05 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Aug 16 10:13:38 2017 -0400
Require C++11 to build CMake itself
CMake can now compile as C++11 on all supported platforms. Check that
std::unique_ptr is available and fail early if missing. This will allow
us to use C++11 more broadly in CMake's implementation (previously it
was restricted to the serve mode implementation).
Co-Author: Daniel Pfeifer <daniel at pfeifer-mail.de>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e60dc78..bebb000 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -80,6 +80,10 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
# check for available C++ features
include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake)
+
+ if(NOT CMake_HAVE_CXX_UNIQUE_PTR)
+ message(FATAL_ERROR "The C++ compiler does not support C++11 (e.g. std::unique_ptr).")
+ endif()
endif()
# set the internal encoding of CMake to UTF-8
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 16a9252..b40a884 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -23,20 +23,18 @@ format only a subset of files, such as those that are locally modified.
C++ Subset Permitted
====================
-CMake supports compiling as C++98 in addition to C++11 and C++14.
-In order to support building on older toolchains some constructs
-need to be handled with care:
+CMake requires compiling as C++11 or above. However, in order to support
+building on older toolchains some constructs need to be handled with care:
-* Use ``CM_AUTO_PTR`` instead of ``std::auto_ptr``.
+* Do not use ``CM_AUTO_PTR`` or ``std::auto_ptr``.
- The ``std::auto_ptr`` template is deprecated in C++11. We want to use it
- so we can build on C++98 compilers but we do not want to turn off compiler
- warnings about deprecated interfaces in general. Use the ``CM_AUTO_PTR``
- macro instead.
+ The ``std::auto_ptr`` template is deprecated in C++11. The ``CM_AUTO_PTR``
+ macro remains leftover from C++98 support until its uses can be ported to
+ ``std::unique_ptr``. Do not add new uses of the macro.
* Use ``CM_EQ_DELETE;`` instead of ``= delete;``.
- Defining functions as *deleted* is not supported in C++98. Using
+ Older C++11 compilers do not support deleting functions. Using
``CM_EQ_DELETE`` will delete the functions if the compiler supports it and
give them no implementation otherwise. Calling such a function will lead
to compiler errors if the compiler supports *deleted* functions and linker
diff --git a/Help/release/dev/require-c++11.rst b/Help/release/dev/require-c++11.rst
new file mode 100644
index 0000000..7b849e7
--- /dev/null
+++ b/Help/release/dev/require-c++11.rst
@@ -0,0 +1,5 @@
+require-c++11
+-------------
+
+* Support for building CMake itself with C++98 compilers was dropped.
+ CMake is now implemented using C++11.
diff --git a/README.rst b/README.rst
index 0946b70..3cef06d 100644
--- a/README.rst
+++ b/README.rst
@@ -51,7 +51,7 @@ Building CMake from Scratch
UNIX/Mac OSX/MinGW/MSYS/Cygwin
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-You need to have a compiler and a make installed.
+You need to have a C++ compiler (supporting C++11) and a ``make`` installed.
Run the ``bootstrap`` script you find in the source directory of CMake.
You can use the ``--help`` option to see the supported options.
You may use the ``--prefix=<install_prefix>`` option to specify a custom
diff --git a/bootstrap b/bootstrap
index 9d73233..aee210f 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1004,58 +1004,45 @@ fi
# Check if C++ compiler works
TMPFILE=`cmake_tmp_file`
echo '
-#if defined(TEST1)
-# include <iostream>
-#else
-# include <iostream.h>
-#endif
+#include <iostream>
+#include <memory>
#if __cplusplus >= 201103L && defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 C++ 11 mode not supported due to bug in move semantics."
#endif
-class NeedCXX
+class Class
{
public:
- NeedCXX() { this->Foo = 1; }
- int GetFoo() { return this->Foo; }
+ int Get() const { return this->Member; }
private:
- int Foo;
+ int Member = 1;
};
int main()
{
- NeedCXX c;
-#ifdef TEST3
- cout << c.GetFoo() << endl;
-#else
- std::cout << c.GetFoo() << std::endl;
-#endif
+ auto const c = std::unique_ptr<Class>(new Class);
+ std::cout << c->Get() << std::endl;
return 0;
}
' > "${TMPFILE}.cxx"
-for a in ${cmake_cxx_compilers}; do
- for b in 1 2 3; do
- if [ -z "${cmake_cxx_compiler}" ] && \
- cmake_try_run "${a}" "${cmake_cxx_flags} -DTEST${b}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
- cmake_cxx_compiler="${a}"
- fi
- done
-done
-for std in 14 11 98; do
+for std in 17 14 11; do
try_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" CXX \"${std}\"`"
- for flag in $try_flags; do
- echo "Checking for wheter ${cmake_cxx_flags} supports ${flag}" >> cmake_bootstrap.log 2>&1
- if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags} ${flag} -DTEST1" \
- "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
- cmake_cxx_flags="${cmake_cxx_flags} ${flag} "
- break 2
- fi
+ for compiler in ${cmake_cxx_compilers}; do
+ for flag in '' $try_flags; do
+ echo "Checking whether '${compiler} ${cmake_cxx_flags} ${flag}' works." >> cmake_bootstrap.log 2>&1
+ if cmake_try_run "${compiler}" "${cmake_cxx_flags} ${flag}" \
+ "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
+ cmake_cxx_compiler="${compiler}"
+ cmake_cxx_flags="${cmake_cxx_flags} ${flag} "
+ break 3
+ fi
+ done
done
done
rm -f "${TMPFILE}.cxx"
if [ -z "${cmake_cxx_compiler}" ]; then
- cmake_error 7 "Cannot find appropriate C++ compiler on this system.
+cmake_error 7 "Cannot find a C++ compiler supporting C++11 on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted."
fi
-----------------------------------------------------------------------
Summary of changes:
CMakeLists.txt | 4 ++
Help/dev/source.rst | 16 ++++----
Help/release/dev/require-c++11.rst | 5 +++
README.rst | 2 +-
bootstrap | 71 +++++++++++++++---------------------
5 files changed, 46 insertions(+), 52 deletions(-)
create mode 100644 Help/release/dev/require-c++11.rst
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list