From 6218e9d78fcbb55cb3dea729151f17fd7bc32260 Mon Sep 17 00:00:00 2001
From: Marko Petric <marko.petric@cern.ch>
Date: Mon, 4 Dec 2017 17:48:41 +0100
Subject: [PATCH] Fix logic for ignoring warnings in dictionary creation and
 exclude overlength strings warnings form generated targets

---
 DDCore/include/ROOT/Warnings.h | 23 +++++++++++------------
 cmake/DD4hepBuild.cmake        |  4 ++--
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/DDCore/include/ROOT/Warnings.h b/DDCore/include/ROOT/Warnings.h
index 6b09d0d72..980476064 100644
--- a/DDCore/include/ROOT/Warnings.h
+++ b/DDCore/include/ROOT/Warnings.h
@@ -15,20 +15,19 @@
 //  M.Frank
 //==========================================================================
 
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#pragma GCC diagnostic ignored "-Wdeprecated"
-#pragma GCC diagnostic ignored "-Wunused"
-#pragma GCC diagnostic ignored "-Woverlength-strings"
-
-#elif defined(__llvm__) || defined(__clang__) || defined(__APPLE__)
-
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#pragma clang diagnostic ignored "-Wdeprecated"
-#pragma clang diagnostic ignored "-Wunused"
-#pragma clang diagnostic ignored "-Woverlength-strings"
+#if defined(__clang__)
+  #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+  #pragma clang diagnostic ignored "-Wdeprecated"
+  #pragma clang diagnostic ignored "-Wunused"
+  #pragma clang diagnostic ignored "-Woverlength-strings"
+#elif defined(__GNUC__) || defined(__GNUG__)
+  #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+  #pragma GCC diagnostic ignored "-Wdeprecated"
+  #pragma GCC diagnostic ignored "-Wunused"
+  #pragma GCC diagnostic ignored "-Woverlength-strings"
 #endif
 
+
 #if defined(__CINT__) || defined(__MAKECINT__) || defined(__CLANG__) || defined(__ROOTCLING__)
 #define  DD4HEP_DICTIONARY_MODE 1
 #endif
diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake
index 250ef16d1..668add548 100644
--- a/cmake/DD4hepBuild.cmake
+++ b/cmake/DD4hepBuild.cmake
@@ -1025,7 +1025,7 @@ function( dd4hep_add_library binary building )
         #
         # root-cint produces warnings of type 'unused-function' disable them on generated files
         foreach ( f in  ${ARG_GENERATED} )
-          set_source_files_properties( ${f} PROPERTIES COMPILE_FLAGS -Wno-unused-function GENERATED TRUE )
+          set_source_files_properties( ${f} PROPERTIES COMPILE_FLAGS "-Wno-unused-function -Wno-overlength-strings" GENERATED TRUE )
         endforeach()
         list ( APPEND sources ${ARG_GENERATED} )
       endif()
@@ -1217,7 +1217,7 @@ function ( dd4hep_add_executable binary )
         endif()
         #  Prepare flags for cint generated sources:
         foreach ( f in  ${ARG_GENERATED} )
-          set_source_files_properties( ${f} PROPERTIES COMPILE_FLAGS -Wno-unused-function GENERATED TRUE )
+          set_source_files_properties( ${f} PROPERTIES COMPILE_FLAGS "-Wno-unused-function -Wno-overlength-strings" GENERATED TRUE )
         endforeach()
         #
         set ( sources ${ARG_GENERATED} ${ARG_SOURCES} ${optional_sources} )
-- 
GitLab