summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-10-12 15:55:13 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-11-13 12:04:00 +0000
commit5b72ec04f8da8d8f7f6988d6fdb49c9df9d069ee (patch)
treed5c7ade596ff6c72f2ee315713ccae5041be5dd0 /mkspecs
parent7db70f1e85f628f78df84eb195473fb315e812fe (diff)
Leave the decision of including RTTI information to the compiler
This change removes the Chromium default of stripping RTTI information from our own cpp files in QtWebEngineCore. This means RTTI information will be emitted based on the compiler's defaults, which follows the same principle as qtbase, which does not explicitly include or exclude the information. A user can still override this by adding CONFIG+=rtti (or rtti_off), which will propagate correctly to GN (but this only really applies to Windows). DLL size difference on a debug build is only 78KiloBytes. Usecase is that RTTI info is currently required by PySide2 for marshalling various QObjects to and from Python, and identifying dynamic types by means of C++'s typeid(). Change-Id: Idb9dacbd1760dbf5b29736b2f2c731b9f6514885 Fixes: PYSIDE-819 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/gn_generator.prf12
1 files changed, 12 insertions, 0 deletions
diff --git a/mkspecs/features/gn_generator.prf b/mkspecs/features/gn_generator.prf
index 88f64fa91..c1399a453 100644
--- a/mkspecs/features/gn_generator.prf
+++ b/mkspecs/features/gn_generator.prf
@@ -208,6 +208,18 @@ GN_CONTENTS += " if (!defined(deps)) {"\
GN_CONTENTS += " ]"
}
+# Remove the default no_rtti config for our own cpp files, thus leaving the decision
+# to the compiler's defaults. This is consistent with how qtbase does it.
+# Unless the user explicitly configured Qt with a different RTTI setting.
+# Windows only for now, because macOS (and presumably Linux) does not support
+# partial rtti info (e.g. rtti info present for derived class, but not base class), and the
+# qtbase rtti feature affects only Windows.
+win32 {
+ GN_CONTENTS += " configs -= [\"//build/config/compiler:no_rtti\"]"
+ CONFIG(rtti_off): GN_CONTENTS += " configs += [\"//build/config/compiler:no_rtti\"]"
+ CONFIG(rtti): GN_CONTENTS += " configs += [\"//build/config/compiler:rtti\"]"
+}
+
GN_CONTENTS += " if (moc_source_h_files != []) {"
GN_CONTENTS += " deps += ["
GN_CONTENTS += " \":generate_h_mocs\","