diff options
author | Christian Tismer <[email protected]> | 2024-01-16 13:21:00 +0100 |
---|---|---|
committer | Christian Tismer <[email protected]> | 2024-01-17 14:01:42 +0100 |
commit | 2bb8b0f7bef8521cd8ffc395169d2dd152d59a92 (patch) | |
tree | 4709d10d7b1d339ea7cba959009eda8e4b950012 /build_scripts/main.py | |
parent | 81ae1853d8510909413a46ab0c27c5eb68a7816e (diff) |
shiboken: Allow to disable pyi file generation for debugging
When developing difficult stuff like Lazy Initialization,
it is convenient to have an option that ignores PYI generation.
This way, translation can be successful, and pyi generation
can then be debugged.
Task-number: PYSIDE-2404
Change-Id: I68bd10af3754de3988556c4558d1331564f5dadb
Pick-to: 6.6
Reviewed-by: Friedemann Kleint <[email protected]>
Diffstat (limited to 'build_scripts/main.py')
-rw-r--r-- | build_scripts/main.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py index f60d55176..8d81108f3 100644 --- a/build_scripts/main.py +++ b/build_scripts/main.py @@ -692,12 +692,14 @@ class PysideBuild(_build, CommandMixin, BuildInfoCollectorMixin): "(default yes if applicable, i.e. Python " "version >= 3.8 and release build if on Windows)") + if OPTION["DISABLE_PYI"]: + cmake_cmd.append("-DDISABLE_PYI=yes") + if OPTION["LOG_LEVEL"] == LogLevel.VERBOSE: cmake_cmd.append("-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON") else: cmake_cmd.append("-DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF") - if OPTION['COMPILER_LAUNCHER']: compiler_launcher = OPTION['COMPILER_LAUNCHER'] cmake_cmd.append(f"-DCMAKE_C_COMPILER_LAUNCHER={compiler_launcher}") @@ -856,8 +858,7 @@ class PysideBuild(_build, CommandMixin, BuildInfoCollectorMixin): if OPTION["LOG_LEVEL"] == LogLevel.VERBOSE and self.make_generator == "Ninja": make_doc_cmd.append("-v") if run_process(make_doc_cmd) != 0: - raise SetupError("Error generating documentation " - f"for {extension}") + raise SetupError(f"Error generating documentation for {extension}") else: log.info("Sphinx not found, skipping documentation build") else: @@ -1003,8 +1004,8 @@ class PysideBuild(_build, CommandMixin, BuildInfoCollectorMixin): # (lib/libclang.lib), whereas we want to copy the shared # library (bin/libclang.dll). clang_lib_path = Path(re.sub(r'lib/libclang.lib$', - 'bin/libclang.dll', - clang_lib_path)) + 'bin/libclang.dll', + clang_lib_path)) else: clang_lib_path = Path(clang_lib_path) # shiboken6 links against libclang.so.6 or a similarly @@ -1092,6 +1093,7 @@ class PysideBuild(_build, CommandMixin, BuildInfoCollectorMixin): message = "Patched rpath to '$ORIGIN/' in" if sys.platform.startswith('linux'): + def rpath_cmd(srcpath): final_rpath = '' # Command line rpath option takes precedence over @@ -1110,6 +1112,7 @@ class PysideBuild(_build, CommandMixin, BuildInfoCollectorMixin): elif sys.platform == 'darwin': message = "Updated rpath in" + def rpath_cmd(srcpath): final_rpath = '' # Command line rpath option takes precedence over @@ -1279,7 +1282,7 @@ class PysideBaseDocs(Command, CommandMixin): if self.name == PYSIDE: self.sphinx_src = self.out_dir / "base" example_gallery = config.setup_script_dir / "tools" / "example_gallery" / "main.py" - assert(example_gallery.is_file()) + assert example_gallery.is_file() example_gallery_cmd = [sys.executable, os.fspath(example_gallery)] if OPTION["LOG_LEVEL"] == LogLevel.QUIET: example_gallery_cmd.append("--quiet") |