summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2016-10-01 15:06:27 +0100
committerSimon McVittie <smcv@debian.org>2016-10-13 17:20:40 +0100
commit748689933112e43cad710654849d77864f9471d6 (patch)
treea140c04c94aa5539b1043149e60a254c45efccc8 /cmake
parentb6caf69d469a4dae8bed2092cc5e32d25192ecf4 (diff)
Revert "Keep cmake gcc builds in sync with autotools warnings."
When reviewing this commit, I said Looks OK, although this is going to become impossible if we start using the externally-curated list of warnings from <https://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html>, which I've been quite tempted to do. That time has now come. I think it's more valuable to have comprehensive warnings under our primary build system, Autotools, than to have some fairly elaborate CMake scripting to pick up the same compiler warnings in both build systems; the CMake build system is primarily there to give us the ability to compile with MSVC, which has orthogonal compiler warning options anyway. This reverts commit 41427560af2c9923a48e50ddbf72e53aad5b2983. Signed-off-by: Simon McVittie <smcv@debian.org> Acked-by: Ralf Habacker <ralf.habacker@freenet.de> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CMakeLists.txt4
-rw-r--r--cmake/modules/MacrosAutotools.cmake65
2 files changed, 2 insertions, 67 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 4dc5653f..fda69a64 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -206,8 +206,8 @@ if(MSVC)
# 4133 'type' : incompatible types - from 'type1' to 'type2'
set(WARNINGS_ERRORS "4002 4003 4013 4028 4031 4047 4114 4133")
else()
- autocompilerwarnings(WARNINGS WARNINGS_DISABLED)
- set(WARNINGS "${WARNINGS} sign-compare")
+ set(WARNINGS "sign-compare")
+ set(WARNINGS_DISABLED "")
set(WARNINGS_ERRORS "")
endif()
generate_warning_cflags(WARNINGS_CFLAGS "${WARNINGS}" "${WARNINGS_DISABLED}" "${WARNINGS_ERRORS}")
diff --git a/cmake/modules/MacrosAutotools.cmake b/cmake/modules/MacrosAutotools.cmake
index c333308e..8bb83cdf 100644
--- a/cmake/modules/MacrosAutotools.cmake
+++ b/cmake/modules/MacrosAutotools.cmake
@@ -116,71 +116,6 @@ macro(autodefine name)
endforeach()
endmacro()
-#
-# fetch compiler warnings settings from autotools
-#
-# @param target_warnings the variable name which will contain the warnings keys
-# @param target_disabled_warnings the variable name which will contain the disabled warnings keys
-#
-macro(autocompilerwarnings target_warnings target_disabled_warnings)
- set(in_warnings 0)
- set(content)
- # parse configure_ac
- foreach(line ${_configure_ac})
- if(line MATCHES ".*TP_COMPILER_WARNINGS.*")
- set(in_warnings 1)
- string(REGEX REPLACE "^.*TP_COMPILER_WARNINGS\\((.*)$" "\\1" temp ${line})
- set(content "${content}${temp}")
- elseif(in_warnings EQUAL 1)
- if(line MATCHES ".*dnl.*")
- # skip
- elseif(line MATCHES "\\)$")
- string(REGEX REPLACE "(.*)\\)$" "\\1" temp ${line})
- set(content "${content}${temp}")
- set(in_warnings 2)
- else()
- string(STRIP ${line} _line)
- if(NOT _line STREQUAL "")
- set(content "${content}${line}")
- endif()
- endif()
- endif()
- endforeach()
-
- # extract macro parts
- string(REPLACE ";" "#" temp ${content})
- string(REPLACE "[" "" temp ${temp})
- string(REPLACE "]" "" temp ${temp})
- string(REPLACE "," ";" alist ${temp})
- list(GET alist 0 flag_name)
- list(GET alist 2 warnings_flag)
- list(GET alist 3 no_warnings_flag)
- string(REPLACE "#" ";" warnings_list ${warnings_flag})
- string(REPLACE "#" ";" no_warnings_list ${no_warnings_flag})
- list(REMOVE_AT no_warnings_list 0)
-
- set(warnings)
- foreach(warning ${warnings_list})
- string(STRIP ${warning} _warning)
- if(NOT _warning STREQUAL "")
- set(warnings "${warnings} ${_warning}")
- endif()
- endforeach()
- set(${target_warnings} "${warnings}")
-
- set(warnings)
- foreach(warning ${no_warnings_list})
- string(STRIP ${warning} _warning)
- if(NOT _warning STREQUAL "")
- set(warnings "${warnings} ${_warning}")
- endif()
- endforeach()
- set(${target_disabled_warnings} "${warnings}")
- if(DEBUG_MACROS)
- message("autocompilerwarnings returns: warnings: ${${target_warnings}} disabled_warnings: ${${target_disabled_warnings}}")
- endif()
-endmacro()
-
macro(autoheaderchecks config_h_in configure_checks_file config_h_cmake)
file(READ ${configure_checks_file} configure_checks_file_raw)
file(READ ${config_h_in} _config_h_in_raw)