diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index 6410fc3027..cecf7a681f 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -43,6 +43,13 @@ else() set(commandline_files "${MODULE_ROOT}/${commandline_filename}") endif() file(STRINGS "${OPTFILE}" configure_args) + +# list(TRANSFORM ...) unexpectedly removes semicolon escaping in list items. So the list arguments +# seem to be broken. The 'bracket argument' suppresses this behavior. Right before forwarding +# command line arguments to the cmake call, 'bracket arguments' are replaced by escaped semicolons +# back. +list(TRANSFORM configure_args REPLACE ";" "[[;]]") + list(FILTER configure_args EXCLUDE REGEX "^[ \t]*$") list(TRANSFORM configure_args STRIP) list(TRANSFORM configure_args REPLACE "\\\\" "\\\\\\\\") @@ -82,9 +89,7 @@ while(NOT "${configure_args}" STREQUAL "") elseif(arg MATCHES "^-host.*dir") message(FATAL_ERROR "${arg} is not supported anymore.") elseif(arg STREQUAL "--") - # Everything after this argument will be passed to CMake verbatim, - # but we need to escape semi-colons so that lists are preserved. - string(REPLACE ";" "\\;" configure_args "${configure_args}") + # Everything after this argument will be passed to CMake verbatim. list(APPEND cmake_args "${configure_args}") break() else() @@ -821,6 +826,9 @@ endif() push("${MODULE_ROOT}") +# Restore the escaped semicolons in arguments that are lists +list(TRANSFORM cmake_args REPLACE "\\[\\[;\\]\\]" "\\\\;") + execute_process(COMMAND "${CMAKE_COMMAND}" ${cmake_args} COMMAND_ECHO STDOUT RESULT_VARIABLE exit_code) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 9e9b0f1e56..b4ffa54578 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -1185,6 +1185,9 @@ function(__qt_propagate_generated_resource target resource_name generated_source set(resource_target "${target}_resources_${resource_count}") add_library("${resource_target}" OBJECT "${generated_source_code}") + target_compile_definitions("${resource_target}" PRIVATE + "$" + ) set_property(TARGET ${resource_target} APPEND PROPERTY _qt_resource_name ${resource_name}) # Save the path to the generated source file, relative to the the current build dir. diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 858a5084ac..f36a40e5df 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -7314,8 +7314,10 @@ void tst_QObject::checkArgumentsForNarrowing() FITS(ConvertingToDouble, long double); - // no compiler still implements this properly. -#if 0 + // GCC and clang don't implement this properly yet: + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99625 + // https://bugs.llvm.org/show_bug.cgi?id=49676 +#if defined(Q_CC_MSVC) // at least since VS2017 struct ConstructibleFromInt { /* implicit */ ConstructibleFromInt(int) {} }; @@ -7334,7 +7336,9 @@ void tst_QObject::checkArgumentsForNarrowing() class ForwardDeclared; FITS(ForwardDeclared, ForwardDeclared); -#if 0 // waiting for official compiler releases that implement P1957... +#if (defined(Q_CC_EXACTLY_GCC) && Q_CC_EXACTLY_GCC >= 1100) \ + || (defined(Q_CC_CLANG) && Q_CC_CLANG >= 1100) \ + || defined(Q_CC_MSVC) // at least since VS2017 { // wg21.link/P1957 NARROWS(char*, bool);