From 1826cba8d8f1316b83bb5864b9a61d756fe7f0ea Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sat, 11 Oct 2025 15:23:49 -0400 Subject: Add local_program() function --- docs/markdown/snippets/local_program.md | 13 ++++++++++++ docs/yaml/functions/local_program.yaml | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 docs/markdown/snippets/local_program.md create mode 100644 docs/yaml/functions/local_program.yaml (limited to 'docs') diff --git a/docs/markdown/snippets/local_program.md b/docs/markdown/snippets/local_program.md new file mode 100644 index 000000000..e671efb2c --- /dev/null +++ b/docs/markdown/snippets/local_program.md @@ -0,0 +1,13 @@ +## New [[local_program]] function + +Similar to [[find_program]], but only work with a program that exists in +source tree, or a built target. Meson will not look for the program in the +system or in a subproject. + +In addition, `depends` keyword argument can be specified in case the program +depends on built targets, for example a Python script could require a compiled +C module. If any such dependency is present, the program can only be used in +build-time commands (e.g. [[custom_target]]). + +The program can be passed to [[meson.override_find_program]] and used in +subprojects. diff --git a/docs/yaml/functions/local_program.yaml b/docs/yaml/functions/local_program.yaml new file mode 100644 index 000000000..d91867b02 --- /dev/null +++ b/docs/yaml/functions/local_program.yaml @@ -0,0 +1,36 @@ +name: local_program +returns: external_program +since: 1.10.0 +description: | + Similar to [[find_program]], but only work with a program that exists in + source tree, or a built target. Meson will not look for the program in the + system or in a subproject. + + In addition, `depends` keyword argument can be specified in case the program + depends on built targets, for example a Python script could require a compiled + C module. If any such dependency is present, the program can only be used in + build-time commands (e.g. [[custom_target]]). + + The program can be passed to [[meson.override_find_program]] and used in + subprojects. + +posargs: + program: + type: str | file | exe | custom_tgt | custom_idx + description: | + A [[@file]] object or the name of a program in the current source directory. + +kwargs: + depend_files: + type: array[str | file] + description: | + files ([[@str]], + [[@file]], or the return value of [[configure_file]] that + this target depends on. Useful for adding regen dependencies. + + depends: + type: array[build_tgt | custom_tgt | custom_idx] + description: | + Specifies that this target depends on the specified + target(s). If specified, this program can only be used at build time, + after those targets have been built. -- cgit v1.2.3