You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ig...@apache.org on 2019/10/04 17:49:07 UTC

[geode-native] branch develop updated: GEODE-7235: Add backwards compatibility for Clang (#533)

This is an automated email from the ASF dual-hosted git repository.

igodwin pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new 80ffee7  GEODE-7235: Add backwards compatibility for Clang (#533)
80ffee7 is described below

commit 80ffee7ad834bd23bfcd2a300e9ad7b08a3d0ca6
Author: Ivan Godwin <ig...@pivotal.io>
AuthorDate: Fri Oct 4 10:49:03 2019 -0700

    GEODE-7235: Add backwards compatibility for Clang (#533)
    
    * GEODE-7235: Support Clang version less than 11
    
    - One of the new flags added for Clang 11 support was not available to earlier versions
    
    Co-authored-by: Michael Oleske <mo...@pivotal.io>
    Co-authored-by: Ivan Godwin <ig...@pivotal.io>
---
 CMakeLists.txt | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0c12822..c1e6b38 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -191,10 +191,6 @@ if (NOT HAVE_STDC_FORMAT_MACROS)
   target_compile_definitions(c++11 INTERFACE __STDC_FORMAT_MACROS)
 endif()
 
-if ("Darwin" STREQUAL ${CMAKE_SYSTEM_NAME} )
-  set(DISABLED_MAC_WARNINGS  -Wno-defaulted-function-deleted -Wno-c++2a-compat)
-endif()
-
 if(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
   # Force linker to error on undefined symbols in shared libraries
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z defs")
@@ -230,6 +226,15 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
   endif()
 
 elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  check_cxx_compiler_flag(-Wno-defaulted-function-deleted CXXFLAGS_NO_DEFAULTED_FUNCTION_DELETED_ALLOWED)
+  if( CXXFLAGS_NO_DEFAULTED_FUNCTION_DELETED_ALLOWED )
+    set(DISABLED_NO_DEFAULTED_FUNCTION_DELETED_ALLOWED -Wno-defaulted-function-deleted)
+  endif()
+
+  check_cxx_compiler_flag(-Wno-c++2a-compat CXXFLAGS_NO_C++2a_COMPAT_ALLOWED)
+  if( CXXFLAGS_NO_C++2a_COMPAT_ALLOWED )
+    set(DISABLED_NO_C++2a_COMPAT_ALLOWED -Wno-c++2a-compat)
+  endif()
   target_compile_options(_WarningsAsError INTERFACE
     -Werror
     -Wall
@@ -270,7 +275,8 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     -Wno-global-constructors
     -Wno-exit-time-destructors
     -Wno-documentation-unknown-command
-    ${DISABLED_MAC_WARNINGS}
+    ${DISABLED_NO_DEFAULTED_FUNCTION_DELETED_ALLOWED}
+    ${DISABLED_NO_C++2a_COMPAT_ALLOWED}
     )
 
   if (USE_CPP_COVERAGE)