]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
meson: Differentiate top-level and custom targets
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 24 Apr 2026 07:51:09 +0000 (09:51 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 24 Apr 2026 07:51:09 +0000 (09:51 +0200)
We need to create top-level targets to run targets with the ninja
command like `ninja <target_name>`.

Some targets (man, html, ...) have the same target name on both
top-level and custom target.  This creates a confusion for the meson
build:

$ meson compile -C build html

```
ERROR: Can't invoke target `html`: ambiguous name. Add target type
and/or path:
- ./doc/src/sgml/html:custom
- ./doc/src/sgml/html:alias
```

Solve that problem by adding '-custom' suffix to these problematic
targets' custom target names.  Top-level targets can be called with
both meson and ninja now:

$ meson compile -C build html
$ ninja -C build html

Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Suggested-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/5508e572-79ae-4b20-84d0-010a66d077f2%40eisentraut.org

doc/src/sgml/meson.build

index a1ae5c54ed62f0abe46a5383a10c708f55bd155b..8517d837b780a8873fef29c26d1c901094400777 100644 (file)
@@ -137,7 +137,7 @@ endif
 # Full documentation as html, text
 #
 if docs_dep.found()
-  html = custom_target('html',
+  html = custom_target('html-custom',
     input: ['stylesheet.xsl', postgres_full_xml],
     output: 'html',
     depfile: 'html.d',
@@ -146,7 +146,7 @@ if docs_dep.found()
   )
   alldocs += html
 
-  install_doc_html = custom_target('install-html',
+  install_doc_html = custom_target('install-html-custom',
     output: 'install-html',
     command: [
       python, install_files, '--prefix', dir_prefix,
@@ -189,7 +189,7 @@ endif
 #
 if docs_dep.found()
   # FIXME: implement / consider sqlmansectnum logic
-  man = custom_target('man',
+  man = custom_target('man-custom',
     input: ['stylesheet-man.xsl', postgres_full_xml],
     output: ['man1', 'man3', 'man7'],
     depfile: 'man.d',
@@ -198,7 +198,7 @@ if docs_dep.found()
   )
   alldocs += man
 
-  install_doc_man = custom_target('install-man',
+  install_doc_man = custom_target('install-man-custom',
     output: 'install-man',
     input: man,
     command: [