Repository: mesos
Updated Branches:
  refs/heads/master dfd55d2a1 -> 5a5ab96d6


Cause CMake to fail and return error code if C++11 not supported.

The current CMake build system will print a warning that your compiler
doesn't support C++11, but still return exit code 0. (It also returns
a garbled error message.)

This commit will cause it to hard-fail the config step, and return an
error code. It will also generate a non-garbled error message.

Review: https://reviews.apache.org/r/36743


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0765aa61
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0765aa61
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0765aa61

Branch: refs/heads/master
Commit: 0765aa615c93195532ab50d375a7db83b89c6e28
Parents: dfd55d2
Author: Alex Clemmer <[email protected]>
Authored: Thu Jul 23 16:39:45 2015 -0700
Committer: Benjamin Hindman <[email protected]>
Committed: Thu Jul 23 16:39:45 2015 -0700

----------------------------------------------------------------------
 cmake/MesosConfigure.cmake | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0765aa61/cmake/MesosConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/MesosConfigure.cmake b/cmake/MesosConfigure.cmake
index 16b72f1..ee47842 100755
--- a/cmake/MesosConfigure.cmake
+++ b/cmake/MesosConfigure.cmake
@@ -41,6 +41,8 @@ enable_testing()
 
 # CONFIGURE COMPILATION.
 ########################
+string(COMPARE EQUAL ${CMAKE_SYSTEM_NAME} "Linux" LINUX)
+
 if (_DEBUG)
   set(CMAKE_BUILD_TYPE Debug)
 endif (_DEBUG)
@@ -51,9 +53,9 @@ if (COMPILER_SUPPORTS_CXX11)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 else (COMPILER_SUPPORTS_CXX11)
   message(
-    STATUS
-    The compiler ${CMAKE_CXX_COMPILER} does not support the `-std=c++11` flag.
-    Please use a different C++ compiler.)
+    FATAL_ERROR
+    "The compiler ${CMAKE_CXX_COMPILER} does not support the `-std=c++11` 
flag. "
+    "Please use a different C++ compiler.")
 endif (COMPILER_SUPPORTS_CXX11)
 
 # Convenience flags to simplify Windows support in C++ source.

Reply via email to