[Github-comments] [geany/geany] WIP: Meson build system (#2761)
Eli Schwartz
notifications at xxxxx
Sun Jan 23 23:31:54 UTC 2022
@eli-schwartz commented on this pull request.
> + dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c',
+ 'pluginsymbols.c',
+ 'stash-example.c',
+ 'stash-gui-example.c'])
+
+ custom_target('doxygen.stamp',
+ input: dox,
+ output: ['doxygen.stamp'],
+ command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
+ depends: libgeany,
+ build_by_default: true)
+ doxy_xml = custom_target('doxygen-gi.stamp',
+ input: doxgi,
+ output: ['doxygen-gi.stamp'],
+ command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Please do not pass arguments by embedding them inside a shell script. There is no `shellquote('@OUTPUT@')`, you cannot guarantee it has a shell-safe name like that.
Instead, use
```meson
command: [sh, '-c', 'doxygen "$1" && touch "$2"', '_argv0', '@INPUT@', '@OUTPUT@'],
```
Which will safely pass the filenames as command line *arguments*, and allow the shell to reference those filenames using variables, since variables can be safely quoted regardless of their content.
This *also* means that meson has a much more accurate understanding of how to replace those strings.
Specifically, you cannot replace both INPUT and OUTPUT in the *same* string. https://github.com/mesonbuild/meson/issues/1864
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2761#discussion_r790346896
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/2761/review/860387876 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20220123/68843550/attachment-0001.htm>
More information about the Github-comments
mailing list