aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/CMakeLists.txt
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-11-01 17:15:47 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-11-03 12:35:09 +0000
commit2bbe2cdb20cc6ee77bb69a0130cd74a161601861 (patch)
tree618e45038b82865c58f5100b272944cda9caf252 /sources/pyside2/PySide2/CMakeLists.txt
parent13874d8c67a4d4b2cca08fb2f4c96173a6c0c512 (diff)
PySide2: Run shiboken2 with a single Qt module header
Create a per-module header including pyside2_global.h and the module header only instead of passing a global header including all Qt modules. This reduces the amount of code shiboken2 has to parse and minimizes warnings. Change-Id: If3ab8fdf6cabe17b4add65f1e4a0f2e1464ab164 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2/CMakeLists.txt')
-rw-r--r--sources/pyside2/PySide2/CMakeLists.txt15
1 files changed, 10 insertions, 5 deletions
diff --git a/sources/pyside2/PySide2/CMakeLists.txt b/sources/pyside2/PySide2/CMakeLists.txt
index 601c43ed6..0b8210359 100644
--- a/sources/pyside2/PySide2/CMakeLists.txt
+++ b/sources/pyside2/PySide2/CMakeLists.txt
@@ -30,15 +30,20 @@ else()
"${CMAKE_CURRENT_BINARY_DIR}/support/signature/backport_inspect.py" COPYONLY)
endif()
-# Add the collected includes to the global include
-file(READ "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h.add" GLOBAL_APPEND)
-file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h" "${GLOBAL_APPEND}")
-file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h.add")
-
# now compile all modules.
+file(READ "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h" pyside2_global_contents)
+
foreach(shortname IN LISTS all_module_shortnames)
set(name "Qt5${shortname}")
HAS_QT_MODULE(${name}_FOUND Qt${shortname})
+
+ # Create a module header consisting of pyside2_global.h and the module
+ # include. Note: The contents of pyside2_global.h must be copied instead of
+ # just #including it since shiboken will otherwise generate an
+ # #include <pyside2_global.h> for the the type entries originating from it
+ # (cf AbstractMetaBuilderPrivate::setInclude()).
+ set(module_header "${CMAKE_CURRENT_BINARY_DIR}/Qt${shortname}_global.h")
+ file(WRITE ${module_header} "${pyside2_global_contents}\n#include <Qt${shortname}/Qt${shortname}>\n")
endforeach()
# install