Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Carlisle <carlisle.b3d@gmail.com>2021-08-06 20:54:49 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2021-08-06 20:55:14 +0300
commitd245782b80a63f9ff56ea49660cc9c287eb1bbd6 (patch)
tree24edc5ea56d7f4db63305f54104f1e23ba552bd3 /build_files/windows/doc_py.cmd
parent3fab16fe8eb4a99607e00d5716ba88bf24020354 (diff)
Windows: Add support to compile python api docs from make file
This adds support to compile the html python api docs from the command line by running `make doc_py` matching support between windows and unix. This patch also makes it so the compiler is not needed if you set the `blender_bin` variable, this affects icon generation as well. In the future, I want to move away from generating the build output in the build directory but that can come in a later change. Reviewed By: LazyDodo Differential Revision: https://developer.blender.org/D12144
Diffstat (limited to 'build_files/windows/doc_py.cmd')
-rw-r--r--build_files/windows/doc_py.cmd34
1 files changed, 34 insertions, 0 deletions
diff --git a/build_files/windows/doc_py.cmd b/build_files/windows/doc_py.cmd
new file mode 100644
index 00000000000..d33a0289083
--- /dev/null
+++ b/build_files/windows/doc_py.cmd
@@ -0,0 +1,34 @@
+set SOURCEDIR=%BLENDER_DIR%/doc/python_api/sphinx-in
+set BUILDDIR=%BLENDER_DIR%/doc/python_api/sphinx-out
+if "%BF_LANG%" == "" set BF_LANG=en
+set SPHINXOPTS=-j auto -D language=%BF_LANG%
+
+call "%~dp0\find_sphinx.cmd"
+
+if EXIST "%SPHINX_BIN%" (
+ goto detect_sphinx_done
+)
+
+echo unable to locate sphinx-build, run "set sphinx_BIN=full_path_to_sphinx-build.exe"
+exit /b 1
+
+:detect_sphinx_done
+
+call "%~dp0\find_blender.cmd"
+
+if EXIST "%BLENDER_BIN%" (
+ goto detect_blender_done
+)
+
+echo unable to locate blender, run "set BLENDER_BIN=full_path_to_blender.exe"
+exit /b 1
+
+:detect_blender_done
+
+%BLENDER_BIN% ^
+ --background -noaudio --factory-startup ^
+ --python %BLENDER_DIR%/doc/python_api/sphinx_doc_gen.py
+
+"%SPHINX_BIN%" -b html %SPHINXOPTS% %O% %SOURCEDIR% %BUILDDIR%
+
+:EOF