summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-12-11 09:24:55 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-12-11 09:18:28 +0000
commitbe44e04d6ab219ba70decbe6f7f8e33293c49418 (patch)
treed06e943badc72119c1f69dd628e9317148003304
parentbdc292a4ec2b0fea2da06f08e9d10073f95fc5c3 (diff)
generate_pyi.py: Add --quiet option
Task-number: PYSIDE-735 Change-Id: I864270454bf4f7eee1a28b55ed06ffbf1c60d74d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--sources/pyside2/PySide2/support/generate_pyi.py3
-rw-r--r--sources/pyside2/cmake/Macros/PySideModules.cmake12
2 files changed, 11 insertions, 4 deletions
diff --git a/sources/pyside2/PySide2/support/generate_pyi.py b/sources/pyside2/PySide2/support/generate_pyi.py
index 256f303a..44ccd71d 100644
--- a/sources/pyside2/PySide2/support/generate_pyi.py
+++ b/sources/pyside2/PySide2/support/generate_pyi.py
@@ -307,6 +307,7 @@ if __name__ == "__main__":
description="This script generates the .pyi file for all PySide modules.")
parser_run.add_argument("--skip", action="store_true",
help="skip existing files")
+ parser_run.add_argument("--quiet", action="store_true", help="Run quietly")
parser_run.add_argument("--outpath",
help="the output directory (default = binary location)")
parser_run.add_argument("--sys-path", nargs="+",
@@ -315,6 +316,8 @@ if __name__ == "__main__":
help="a list of strings prepended to LD_LIBRARY_PATH (unix) or PATH (windows)")
options = parser.parse_args()
if options.command == "run":
+ if options.quiet:
+ logger.setLevel(logging.WARNING)
outpath = options.outpath
if outpath and not os.path.exists(outpath):
os.makedirs(outpath)
diff --git a/sources/pyside2/cmake/Macros/PySideModules.cmake b/sources/pyside2/cmake/Macros/PySideModules.cmake
index 42ba8e8a..98efd8c7 100644
--- a/sources/pyside2/cmake/Macros/PySideModules.cmake
+++ b/sources/pyside2/cmake/Macros/PySideModules.cmake
@@ -157,12 +157,16 @@ macro(create_pyside_module)
create_generator_target(${module_NAME})
# build type hinting stubs
+ set(generate_pyi_options run --skip --sys-path "${CMAKE_BINARY_DIR}"
+ "${CMAKE_BINARY_DIR}/../shiboken2/shibokenmodule"
+ --lib-path "${CMAKE_BINARY_DIR}/libpyside"
+ "${CMAKE_BINARY_DIR}/../shiboken2/libshiboken")
+ if (QUIET_BUILD)
+ list(APPEND generate_pyi_options "--quiet")
+ endif()
add_custom_command( TARGET ${module_NAME} POST_BUILD
COMMAND "${SHIBOKEN_PYTHON_INTERPRETER}"
- "${CMAKE_CURRENT_SOURCE_DIR}/../support/generate_pyi.py" run --skip
- --sys-path "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/../shiboken2/shibokenmodule"
- --lib-path "${CMAKE_BINARY_DIR}/libpyside" "${CMAKE_BINARY_DIR}/../shiboken2/libshiboken"
- )
+ "${CMAKE_CURRENT_SOURCE_DIR}/../support/generate_pyi.py" ${generate_pyi_options})
# install
install(TARGETS ${module_NAME} LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}/PySide2")