aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build_scripts/main.py26
-rw-r--r--build_scripts/options.py2
-rw-r--r--setup.py1
3 files changed, 18 insertions, 11 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py
index 23eb55008..3fe59e065 100644
--- a/build_scripts/main.py
+++ b/build_scripts/main.py
@@ -1079,17 +1079,21 @@ class pyside_build(_build):
if run_process(cmd_make) != 0:
raise DistutilsSetupError("Error compiling {}".format(extension))
- if extension.lower() == "shiboken2":
- try:
- # Check if sphinx is installed to proceed.
- import sphinx
-
- log.info("Generating Shiboken documentation")
- if run_process([self.make_path, "doc"]) != 0:
- raise DistutilsSetupError(
- "Error generating documentation for {}".format(extension))
- except ImportError:
- log.info("Sphinx not found, skipping documentation build")
+ if not OPTION_SKIP_DOCS:
+ if extension.lower() == "shiboken2":
+ try:
+ # Check if sphinx is installed to proceed.
+ import sphinx
+
+ log.info("Generating Shiboken documentation")
+ if run_process([self.make_path, "doc"]) != 0:
+ raise DistutilsSetupError(
+ "Error generating documentation for {}".format(
+ extension))
+ except ImportError:
+ log.info("Sphinx not found, skipping documentation build")
+ else:
+ log.info("Skipped documentation generation")
if not OPTION_SKIP_MAKE_INSTALL:
diff --git a/build_scripts/options.py b/build_scripts/options.py
index 3d02b368f..6472c664d 100644
--- a/build_scripts/options.py
+++ b/build_scripts/options.py
@@ -52,6 +52,8 @@ OPTION_ONLYPACKAGE = has_option("only-package")
OPTION_STANDALONE = has_option("standalone")
OPTION_MAKESPEC = option_value("make-spec")
OPTION_IGNOREGIT = has_option("ignore-git")
+# don't generate documentation
+OPTION_SKIP_DOCS = has_option("skip-docs")
# don't include pyside2-examples
OPTION_NOEXAMPLES = has_option("no-examples")
# number of parallel build jobs
diff --git a/setup.py b/setup.py
index dda7b29a0..bfc9b5a48 100644
--- a/setup.py
+++ b/setup.py
@@ -129,6 +129,7 @@ using `setup.py build`:
arguments, etc.
--sanitize-address will build the project with address sanitizer
enabled (Linux or macOS only).
+ --skip-docs skip the documentation generation.
REQUIREMENTS: