You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2018/03/19 20:20:42 UTC

[4/9] mesos git commit: CMake: Added `-Wno-unused-local-typedefs` to Boost interface.

CMake: Added `-Wno-unused-local-typedefs` to Boost interface.

As found in the Autotools builds, GCC and Clang will emit an used
local typedef warning for headers including Boost. Since it is
3rdparty code, we disable this warning in its interface.

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


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

Branch: refs/heads/master
Commit: 6613e6a60e746626bd4e81694952103644235f09
Parents: 5cb1017
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Fri Mar 9 10:35:03 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Mon Mar 19 12:34:57 2018 -0700

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt | 6 ++++++
 configure.ac            | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6613e6a6/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index e0c1538..0436c59 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -177,6 +177,12 @@ endfunction()
 EXTERNAL(boost ${BOOST_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
 add_library(boost INTERFACE)
 add_dependencies(boost ${BOOST_TARGET})
+if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
+  # Headers including Boost 1.65.0 fail to compile with GCC 7.2 and
+  # CLang 3.6 without `-Wno-unused-local-typedefs`.
+  # TODO(andschwa): Remove this when Boost has a resolution.
+  target_compile_options(boost INTERFACE -Wno-unused-local-typedefs)
+endif ()
 target_include_directories(boost INTERFACE ${BOOST_ROOT})
 
 ExternalProject_Add(

http://git-wip-us.apache.org/repos/asf/mesos/blob/6613e6a6/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 30fbadc..f3d1169 100644
--- a/configure.ac
+++ b/configure.ac
@@ -540,7 +540,7 @@ AS_CASE($ax_cv_cxx_compiler_vendor,
   [clang], [
     # Check if -Wno-unused-local-typedef is needed by checking a sample
     # compilation which contains a local unused typedef.
-    # This is needed because Boost 1.53.0 fails to compile with upstream
+    # This is needed because Boost 1.65.0 fails to compile with upstream
     # Clang 3.6 without -Wno-unused-local-typedef. Apple LLVM based on
     # Clang 3.6 doesn't have the same behavior.
     AC_LANG_PUSH([C++])
@@ -571,7 +571,7 @@ AS_CASE($ax_cv_cxx_compiler_vendor,
     fi
 
     AC_MSG_NOTICE([Setting up CXXFLAGS for g++ version >= 4.8])
-    # Boost 1.53.0 fails to compile with GCC 4.8 without
+    # Boost 1.65.0 fails to compile with GCC 7.2 without
     # -Wno-unused-local-typedefs, and automake does not recognize the
     # flag.
     # TODO(brenden): Remove this when Boost has a resolution.