summaryrefslogtreecommitdiffstats
path: root/configure.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-10-02 18:24:32 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-10-06 10:07:10 +0200
commit2354274f39934b94383923834479901106489def (patch)
tree5c509bbf04b5301c4866492b6f4dfb83e5668675 /configure.cmake
parent98bea5857a0b63925ebab160a717105ad6ee9445 (diff)
CMake: Allow embedding debug info in object files with MSVC
Introduce a new feature called 'FEATURE_msvc_obj_debug_info' which should allow usage of sccache for Windows MSVC configs. Enabling the feature will replace the default '/Zi' compile flag that CMake sets in Windows-MSVC.cmake with '/Z7'. This ensures that the debug info is placed into the compiled object file instead of placing it in the compilation .pdb file via mspdbsrv.exe. The final pdb file will still be created for shared libraries and executables due to the linker '/debug' flag. Static libraries will not have a .pdb file, instead the debug info being embeeded in the .lib file. The downsides of using '/Z7' are more disk space usage, slower link times, more memory used for linking because the linker needs to deal with more symbols. The upside is that caching each indepedent cl.exe call is possible. This is what Chromium uses with goma, and Firefox with sccache. We're not enabling the feature by default to allow easier testing (and switching it off) in the CI if it proves not to be feasible. It will probably have to be disabled at least for building qtwebengine due to high memory requirements. Task-number: QTQAINFRA-3934 Change-Id: I89e0e57995e938a780be318d1faec700194aa93f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'configure.cmake')
-rw-r--r--configure.cmake6
1 files changed, 6 insertions, 0 deletions
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"