diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-06-21 23:18:37 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-06-22 10:49:08 +0000 |
commit | 61e0d4df7e322d096649dd8d19c173a05655aa9b (patch) | |
tree | 7305a6dfed7371a23c54ec481b46a0f28296c1c4 /sources | |
parent | 56ff122f06418f437a1e8c950f76e7f504d1bef0 (diff) |
Allow building just QtCore bindings
This change introduces tracking of modules for which bindings will not
be built. This allows us to add conditions on disabled modules,
and thus disable certain tests.
Thus we disable pysidetest test when its dependencies are not met.
Due to this, we can now builtd bindings only for QtCore,
allowing faster development iteration when touching only QtCore.
Note that this only affects which module bindings will be created.
Shiboken itself still requires QtCore, QtXml and QtXmlPatterns,
as does pyside2-rcc.
Change-Id: I75084a1741e7f4c3594e43af0fd9668a0e969c56
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/pyside2/CMakeLists.txt | 15 | ||||
-rw-r--r-- | sources/pyside2/tests/CMakeLists.txt | 4 |
2 files changed, 18 insertions, 1 deletions
diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt index 1958c79a2..358c119ae 100644 --- a/sources/pyside2/CMakeLists.txt +++ b/sources/pyside2/CMakeLists.txt @@ -405,6 +405,9 @@ if (NOT MODULES) set(MODULES "${ALL_ESSENTIAL_MODULES};${ALL_OPTIONAL_MODULES}") endif() +# This will contain the set of modules for which bindings are not built. +set(DISABLED_MODULES "${ALL_ESSENTIAL_MODULES};${ALL_OPTIONAL_MODULES}") + # Removing from the MODULES list the items that were defined with # -DSKIP_MODULES on command line if (SKIP_MODULES) @@ -415,8 +418,20 @@ endif() foreach(m ${MODULES}) COLLECT_MODULE_IF_FOUND(${m}) + list(FIND all_module_shortnames ${m} is_module_collected) + # If the module was collected, remove it from disabled modules list. + if (NOT is_module_collected EQUAL -1) + list(REMOVE_ITEM DISABLED_MODULES ${m}) + endif() endforeach() +# Mark all non-collected modules as disabled. This is used for disabling tests +# that depend on the disabled modules. +foreach(m ${DISABLED_MODULES}) + set(DISABLE_Qt${m} 1) +endforeach() + + string(REGEX MATCHALL "[0-9]+" qt_version_helper "${Qt5Core_VERSION}") list(GET qt_version_helper 0 QT_VERSION_MAJOR) diff --git a/sources/pyside2/tests/CMakeLists.txt b/sources/pyside2/tests/CMakeLists.txt index 199192b3c..2386950e9 100644 --- a/sources/pyside2/tests/CMakeLists.txt +++ b/sources/pyside2/tests/CMakeLists.txt @@ -49,7 +49,9 @@ else() ENVIRONMENT "PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH};PYSIDE_DISABLE_INTERNAL_QT_CONF=1;QT_NO_GLIB=1") endmacro() - add_subdirectory(pysidetest) + if (NOT DISABLE_QtCore AND NOT DISABLE_QtGui AND NOT DISABLE_QtWidgets) + add_subdirectory(pysidetest) + endif() add_subdirectory(registry) add_subdirectory(signals) |