From 05e029619f18e66d587075e929bc2d8c384f367a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 28 Jan 2022 10:37:20 -0800 Subject: [PATCH] CMake: fix running of headersclean targets when CMAKE_CXX_FLAGS is set We were passing the full option from the user as a single string in the command-line to the compiler. clang++ -c "-O3 -g1 -march=tigerlake -mprefer-vector-width=256 -maes" [...] error: invalid integral value '3 -g1 -march=tigerlake -mprefer-vector-width=256 -maes' in '-O3 -g1 -march=tigerlake -mprefer-vector-width=256 -maes' Pick-to: 6.2 6.3 Fixes: QTBUG-100315 Change-Id: I6fcda969a9e9427198bffffd16ce83150d4e4263 Reviewed-by: Qt CI Bot Reviewed-by: Alexandru Croitor --- cmake/QtHeadersClean.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtHeadersClean.cmake b/cmake/QtHeadersClean.cmake index c2b83ccb480..3e6dbd616d6 100644 --- a/cmake/QtHeadersClean.cmake +++ b/cmake/QtHeadersClean.cmake @@ -133,7 +133,7 @@ function(qt_internal_add_headers_clean_target # Use strict mode C++20, with no GNU extensions (see -pedantic-errors above). list(APPEND hcleanFLAGS -std=c++2a) - set(cxx_flags ${CMAKE_CXX_FLAGS}) + separate_arguments(cxx_flags NATIVE_COMMAND ${CMAKE_CXX_FLAGS}) if(APPLE AND CMAKE_OSX_SYSROOT) list(APPEND cxx_flags "${CMAKE_CXX_SYSROOT_FLAG}" "${CMAKE_OSX_SYSROOT}")