"Fossies" - the Fresh Open Source Software Archive

Member "mysql-connector-c-6.1.11-src/cmake/maintainer.cmake" (13 Jul 2017, 2056 Bytes) of package /linux/misc/old/mysql-connector-c-6.1.11-src.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) CMake source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "maintainer.cmake": 6.1.10-src_vs_6.1.11-src.

    1 # Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
    2 #
    3 # This program is free software; you can redistribute it and/or modify
    4 # it under the terms of the GNU General Public License as published by
    5 # the Free Software Foundation; version 2 of the License.
    6 #
    7 # This program is distributed in the hope that it will be useful,
    8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   10 # GNU General Public License for more details.
   11 #
   12 # You should have received a copy of the GNU General Public License
   13 # along with this program; if not, write to the Free Software
   14 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
   15 
   16 # Common warning flags for GCC, G++, Clang and Clang++
   17 SET(MY_WARNING_FLAGS "-Wall -Wextra -Wformat-security")
   18 MY_CHECK_C_COMPILER_FLAG("-Wvla" HAVE_WVLA) # Requires GCC 4.3+ or Clang
   19 IF(HAVE_WVLA)
   20   SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wvla")
   21 ENDIF()
   22 
   23 # Common warning flags for GCC and Clang
   24 SET(MY_C_WARNING_FLAGS
   25     "${MY_WARNING_FLAGS} -Wwrite-strings -Wdeclaration-after-statement -Wno-unused-parameter")
   26 
   27 # Common warning flags for G++ and Clang++
   28 SET(MY_CXX_WARNING_FLAGS
   29     "${MY_WARNING_FLAGS} -Woverloaded-virtual -Wno-unused-parameter")
   30 
   31 # Extra warning flags for Clang++
   32 IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
   33   SET(MY_CXX_WARNING_FLAGS
   34       "${MY_CXX_WARNING_FLAGS} -Wno-null-conversion -Wno-unused-private-field")
   35 ENDIF()
   36 
   37 # Turn on Werror (warning => error) when using maintainer mode.
   38 IF(MYSQL_MAINTAINER_MODE)
   39   SET(MY_C_WARNING_FLAGS "${MY_C_WARNING_FLAGS} -Werror")
   40   SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -Werror")
   41 ENDIF()
   42 
   43 # Set warning flags for GCC/Clang
   44 IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
   45   SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_WARNING_FLAGS}")
   46 ENDIF()
   47 # Set warning flags for G++/Clang++
   48 IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
   49   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_WARNING_FLAGS}")
   50 ENDIF()