COIN-OR::LEMON - Graph Library

Ticket #615: d6aa3c2ec627.patch

File d6aa3c2ec627.patch, 2.7 KB (added by Alpar Juttner, 3 years ago)
  • CMakeLists.txt

    # HG changeset patch
    # User Alpar Juttner <alpar@cs.elte.hu>
    # Date 1540981897 -3600
    #      Wed Oct 31 11:31:37 2018 +0100
    # Branch 1.3
    # Node ID d6aa3c2ec62726ddaaf1da671bdaf433074513c4
    # Parent  e5af35e6c93ff93f73cbe6ab3eef8e6750518457
    Suppress unused typef warnings (#615)
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    a b  
    148148    "Default MIP solver backend (GLPK, CPLEX or CBC)")
    149149ENDIF()
    150150
     151IF( ( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND
     152      ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL "4.8") )
     153    OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     154    OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
     155    )
     156  SET(LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS TRUE)
     157ENDIF()
    151158
    152159IF(DEFINED ENV{LEMON_CXX_WARNING})
    153160  SET(CXX_WARNING $ENV{LEMON_CXX_WARNING})
    154161ELSE()
    155   IF(CMAKE_COMPILER_IS_GNUCXX)
     162  IF( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
     163      OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     164      OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
     165      )
    156166    SET(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas")
    157167    SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb")
    158168    SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb")
  • lemon/config.h.in

    diff --git a/lemon/config.h.in b/lemon/config.h.in
    a b  
    22#define LEMON_CONFIG_H
    33
    44#define LEMON_VERSION "@PROJECT_VERSION@"
     5
    56#cmakedefine LEMON_HAVE_LONG_LONG 1
    67
    78#cmakedefine LEMON_WIN32 1
     
    2627#cmakedefine LEMON_USE_PTHREAD 1
    2728#cmakedefine LEMON_USE_WIN32_THREADS 1
    2829
     30#cmakedefine LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS 1
     31
    2932#endif
  • lemon/core.h

    diff --git a/lemon/core.h b/lemon/core.h
    a b  
    3333// C4503: 'function' : decorated name length exceeded, name was truncated
    3434// C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
    3535// C4996: 'function': was declared deprecated
     36
     37#include <lemon/config.h>
     38
    3639#ifdef _MSC_VER
    3740#pragma warning( disable : 4250 4267 4355 4503 4800 4996 )
    3841#endif
    3942
    40 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
    41 // Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc 4.8
     43#if LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS
     44// Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc >=4.8 and clang
    4245#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    4346#endif
    4447
    4548#include <vector>
    4649#include <algorithm>
    4750
    48 #include <lemon/config.h>
    4951#include <lemon/bits/enable_if.h>
    5052#include <lemon/bits/traits.h>
    5153#include <lemon/assert.h>