summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/QtInternalTargets.cmake4
-rw-r--r--cmake/configure-cmake-mapping.md2
-rw-r--r--configure.cmake6
-rwxr-xr-xutil/cmake/configurejson2cmake.py1
4 files changed, 11 insertions, 2 deletions
diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake
index e59e075d32..fb64b0fbab 100644
--- a/cmake/QtInternalTargets.cmake
+++ b/cmake/QtInternalTargets.cmake
@@ -221,6 +221,10 @@ elseif(QT_FEATURE_use_lld_linker)
target_link_options(PlatformCommonInternal INTERFACE "-fuse-ld=lld")
endif()
+if(QT_FEATURE_enable_gdb_index)
+ target_link_options(PlatformCommonInternal INTERFACE "-Wl,--gdb-index")
+endif()
+
function(qt_get_implicit_sse2_genex_condition out_var)
set(is_shared_lib "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>")
set(is_static_lib "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>")
diff --git a/cmake/configure-cmake-mapping.md b/cmake/configure-cmake-mapping.md
index c113f4bceb..357c52a51b 100644
--- a/cmake/configure-cmake-mapping.md
+++ b/cmake/configure-cmake-mapping.md
@@ -32,7 +32,7 @@ The effort of this is tracked in QTBUG-85373 and QTBUG-85349.
| -optimized-tools | n/a | This affects only host tools. |
| -force-debug-info | Use the RelWithDebInfo build config. | |
| -separate-debug-info | -DFEATURE_separate_debug_info=ON | |
-| -gdb-index | | |
+| -gdb-index | -DFEATURE_enable_gdb_index=ON | |
| -strip | | |
| -gc-binaries | -DFEATURE_gc_binaries=ON | |
| -force-asserts | | |
diff --git a/configure.cmake b/configure.cmake
index a45c8431d2..a824ce467d 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -622,6 +622,12 @@ qt_feature("ltcg"
CONDITION CMAKE_INTERPROCEDURAL_OPTIMIZATION
)
qt_feature_config("ltcg" QMAKE_PRIVATE_CONFIG)
+qt_feature("enable_gdb_index"
+ LABEL "Generating GDB index"
+ AUTODETECT QT_FEATURE_developer_build
+ CONDITION GCC AND NOT CLANG AND ( QT_FEATURE_debug OR QT_FEATURE_force_debug_info OR QT_FEATURE_debug_and_release ) AND TEST_gdb_index
+)
+qt_feature_config("enable_gdb_index" QMAKE_PRIVATE_CONFIG)
qt_feature("reduce_exports" PRIVATE
LABEL "Reduce amount of exported symbols"
CONDITION NOT WIN32 AND CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py
index 7fa19166d5..aff840f850 100755
--- a/util/cmake/configurejson2cmake.py
+++ b/util/cmake/configurejson2cmake.py
@@ -897,7 +897,6 @@ def get_feature_mapping():
"condition": "CMAKE_BUILD_TYPE STREQUAL Debug OR Debug IN_LIST CMAKE_CONFIGURATION_TYPES"
},
"dlopen": {"condition": "UNIX"},
- "enable_gdb_index": None,
"enable_new_dtags": None,
"force_debug_info": {
"autoDetect": "CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo OR RelWithDebInfo IN_LIST CMAKE_CONFIGURATION_TYPES"