xref: /aosp_15_r20/external/mesa3d/docs/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1get_option('html-docs').require(
2  run_command(prog_python, '-c',
3  '''
4try:
5  from packaging.version import Version
6except:
7  from distutils.version import StrictVersion as Version
8import hawkmoth
9assert Version(hawkmoth.__version__) >= Version("0.16.0")
10  ''', check: false).returncode() == 0,
11  error_message: 'hawkmoth >= 0.16.0 required'
12)
13
14html_docs = custom_target(
15  'html',
16  depfile: 'docs.d',
17  depend_files: files('conf.py'),
18  command: [sphinx, '-b', 'html', '-q',
19            '-Ddepfile=@DEPFILE@',
20            meson.current_source_dir(), '@OUTPUT@'],
21  output: 'html',
22  build_by_default: get_option('html-docs').enabled(),
23)
24
25html_docs_path = get_option('html-docs-path')
26if html_docs_path == ''
27  html_docs_path = join_paths(get_option('datadir'), 'doc', 'mesa')
28endif
29
30install_subdir(html_docs.full_path(),
31  install_dir: html_docs_path,
32  exclude_files: ['.buildinfo'],
33  exclude_directories: ['.doctrees'],
34  strip_directory: true
35)
36