summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/QtFlagHandlingHelpers.cmake11
-rw-r--r--configure.cmake6
2 files changed, 17 insertions, 0 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake
index 4dd37b35f7..b65bee2df6 100644
--- a/cmake/QtFlagHandlingHelpers.cmake
+++ b/cmake/QtFlagHandlingHelpers.cmake
@@ -832,6 +832,17 @@ function(qt_internal_set_up_config_optimizations_like_in_qmake)
IN_CACHE)
endif()
+ # Allow opting into generating debug info in object files with a fake feature.
+ # This would allow us to enable caching with sccache.
+ # See QTQAINFRA-3934 for details.
+ if(MSVC AND QT_FEATURE_msvc_obj_debug_info)
+ qt_internal_replace_compiler_flags(
+ "/Zi" "/Z7"
+ CONFIGS RELWITHDEBINFO DEBUG
+ TYPES ${target_link_types}
+ IN_CACHE)
+ endif()
+
if(QT_DEBUG_OPTIMIZATION_FLAGS)
message(STATUS "")
message(STATUS "DEBUG: Modified optimization flags to mirror qmake mkspecs.\n")
diff --git a/configure.cmake b/configure.cmake
index 46a6c776c0..57cd7baf39 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -437,6 +437,12 @@ qt_feature("optimize_full"
AUTODETECT OFF
)
qt_feature_config("optimize_full" QMAKE_PRIVATE_CONFIG)
+qt_feature("msvc_obj_debug_info"
+ LABEL "Embed debug info in object files (MSVC)"
+ CONDITION MSVC
+ AUTODETECT OFF
+)
+qt_feature_config("msvc_obj_debug_info" QMAKE_PRIVATE_CONFIG)
# special case end
qt_feature("pkg-config" PUBLIC
LABEL "Using pkg-config"