2023-10-31 12:57:26 +08:00
|
|
|
get_option('html-docs').require(
|
|
|
|
run_command(prog_python, '-c',
|
|
|
|
'''
|
|
|
|
try:
|
|
|
|
from packaging.version import Version
|
|
|
|
except:
|
|
|
|
from distutils.version import StrictVersion as Version
|
|
|
|
import hawkmoth
|
|
|
|
assert Version(hawkmoth.__version__) >= Version("0.16.0")
|
|
|
|
''', check: false).returncode() == 0,
|
|
|
|
error_message: 'hawkmoth >= 0.16.0 required'
|
|
|
|
)
|
|
|
|
|
2021-06-21 19:07:54 +08:00
|
|
|
html_docs = custom_target(
|
|
|
|
'html',
|
2021-08-16 23:10:59 +08:00
|
|
|
depfile: 'docs.d',
|
2021-06-21 19:07:54 +08:00
|
|
|
depend_files: files('conf.py'),
|
2021-08-16 23:10:59 +08:00
|
|
|
command: [sphinx, '-b', 'html', '-q',
|
|
|
|
'-Ddepfile=@DEPFILE@',
|
|
|
|
meson.current_source_dir(), '@OUTPUT@'],
|
2021-06-21 19:07:54 +08:00
|
|
|
output: 'html',
|
|
|
|
build_by_default: get_option('html-docs').enabled(),
|
|
|
|
)
|
|
|
|
|
2023-05-23 15:56:20 +08:00
|
|
|
html_docs_path = get_option('html-docs-path')
|
|
|
|
if html_docs_path == ''
|
|
|
|
html_docs_path = join_paths(get_option('datadir'), 'doc', 'mesa')
|
|
|
|
endif
|
|
|
|
|
2021-06-21 19:07:54 +08:00
|
|
|
install_subdir(html_docs.full_path(),
|
2023-05-23 15:56:20 +08:00
|
|
|
install_dir: html_docs_path,
|
2021-06-21 19:07:54 +08:00
|
|
|
exclude_files: ['.buildinfo'],
|
|
|
|
exclude_directories: ['.doctrees'],
|
|
|
|
strip_directory: true
|
|
|
|
)
|