From 19b69494f03d659afe8260820600f3f4c733c0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Sun, 3 Dec 2023 16:56:55 +0100 Subject: [PATCH] headersclean: Refactor order of compiler arguments Merge different lists, and make order of compiler options more consistent. Change-Id: I3a760d581cc2062f97d519c7316b77cbc9992203 Reviewed-by: Alexey Edelev --- cmake/QtHeadersClean.cmake | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/cmake/QtHeadersClean.cmake b/cmake/QtHeadersClean.cmake index 5f1cc9fd0c9..9082f258d87 100644 --- a/cmake/QtHeadersClean.cmake +++ b/cmake/QtHeadersClean.cmake @@ -101,20 +101,20 @@ function(qt_internal_add_headersclean_target module_target module_headers) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang|IntelLLVM") - # Turn on some extra warnings not found in -Wall -Wextra. - set(hcleanFLAGS -Wall -Wextra -Werror -Woverloaded-virtual -Wshadow -Wundef -Wfloat-equal - -Wnon-virtual-dtor -Wpointer-arith -Wformat-security -Wno-long-long -Wno-variadic-macros - -fno-operator-names - -pedantic-errors) + # Compile header in strict C++20 mode. Enable further warnings. + set(hcleanFLAGS -std=c++2a + -Wall -Wextra -Werror -pedantic-errors + -Woverloaded-virtual -Wshadow -Wundef -Wfloat-equal + -Wnon-virtual-dtor -Wpointer-arith -Wformat-security + -Wchar-subscripts -Wold-style-cast + -Wno-long-long -Wno-variadic-macros + -fno-operator-names) if(QT_FEATURE_reduce_relocations AND UNIX) list(APPEND hcleanFLAGS -fPIC) endif() - # options accepted by GCC and Clang - list(APPEND hcleanFLAGS -Wchar-subscripts -Wold-style-cast) - if (NOT ((TEST_architecture_arch STREQUAL arm) OR (TEST_architecture_arch STREQUAL mips))) list(APPEND hcleanFLAGS -Wcast-align) @@ -134,9 +134,6 @@ function(qt_internal_add_headersclean_target module_target module_headers) list(APPEND hcleanFLAGS -Wshorten-64-to-32) endif() - # Use strict mode C++20, with no GNU extensions (see -pedantic-errors above). - list(APPEND hcleanFLAGS -std=c++2a) - separate_arguments(cxx_flags NATIVE_COMMAND ${CMAKE_CXX_FLAGS}) if(APPLE AND CMAKE_OSX_SYSROOT)