From 8e196c9e39e83084d45d206f51188399d9e6b953 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Fri, 21 Feb 2025 10:51:17 +0100 Subject: [PATCH] Increase concept diagnostic depth to 8 Reading concept errors is sometimes quite hard because they say that the constraint was failing but not why. With a deeper diagnostic stack, it is easier to understand why it was failing. Change-Id: I863a23457bea390f50f9c458b5e82a24e17a26ea Reviewed-by: Cristian Adam --- cmake/QtCreatorAPI.cmake | 6 ++++++ cmake/QtCreatorAPIInternal.cmake | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 4dea5d3a24e..9573ffeed28 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -314,6 +314,8 @@ function(add_qtc_library name) qtc_enable_sanitize("${name}" ${SANITIZE_FLAGS}) endif() + qtc_deeper_concept_diagnostic_depth("${name}") + if (NAMELINK_OPTION AND NOT QTC_STATIC_BUILD) install(TARGETS ${name} LIBRARY @@ -534,6 +536,8 @@ function(add_qtc_plugin target_name) qtc_enable_sanitize("${name}" ${SANITIZE_FLAGS}) endif() + qtc_deeper_concept_diagnostic_depth("${name}") + extend_qtc_target(${target_name} INCLUDES ${_arg_INCLUDES} SYSTEM_INCLUDES ${_arg_SYSTEM_INCLUDES} @@ -762,6 +766,8 @@ function(add_qtc_executable name) qtc_enable_sanitize("${name}" ${SANITIZE_FLAGS}) endif() + qtc_deeper_concept_diagnostic_depth("${name}") + extend_qtc_target("${name}" INCLUDES "${CMAKE_BINARY_DIR}/src" ${_arg_INCLUDES} DEFINES ${default_defines_copy} ${TEST_DEFINES} ${_arg_DEFINES} diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index 65533395bf4..37e0f017b3d 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -195,6 +195,12 @@ function(qtc_enable_sanitize _target _sanitize_flags) endif() endfunction() +function(qtc_deeper_concept_diagnostic_depth _target) + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options("${_target}" PUBLIC -fconcepts-diagnostics-depth=8) + endif() +endfunction() + function(qtc_add_link_flags_no_undefined target) # needs CheckLinkerFlags if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.18 AND NOT MSVC AND NOT APPLE)