From 2e0e2663b80950a4b4106160a0cc6db12a39a559 Mon Sep 17 00:00:00 2001 From: Stéphane Cerveau Date: Wed, 30 Oct 2024 15:53:52 +0100 Subject: ExternalProgram: add cmd_array to complete the offfering In case of python and especially in the case of pyInstaller where the python command is meson.exe runpython, it should not be full path to be used but cmd_array. Fixing #13834 --- docs/markdown/snippets/add_external-program_cmd-array.md | 11 +++++++++++ docs/yaml/objects/external_program.yaml | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 docs/markdown/snippets/add_external-program_cmd-array.md (limited to 'docs') diff --git a/docs/markdown/snippets/add_external-program_cmd-array.md b/docs/markdown/snippets/add_external-program_cmd-array.md new file mode 100644 index 000000000..f4d7a6c0e --- /dev/null +++ b/docs/markdown/snippets/add_external-program_cmd-array.md @@ -0,0 +1,11 @@ +## Add cmd_array method to ExternalProgram + +Added a new `cmd_array()` method to the `ExternalProgram` object that returns +an array containing the command(s) for the program. This is particularly useful +in cases like pyInstaller where the Python command is `meson.exe runpython`, +and the full path should not be used but rather the command array. + +The method returns a list of strings representing the complete command needed +to execute the external program, which may differ from just the full path +returned by `full_path()` in cases where wrapper commands or interpreters are +involved. diff --git a/docs/yaml/objects/external_program.yaml b/docs/yaml/objects/external_program.yaml index 4c24497a9..db5d39fab 100644 --- a/docs/yaml/objects/external_program.yaml +++ b/docs/yaml/objects/external_program.yaml @@ -56,3 +56,8 @@ methods: ```meson run_command(find_program('foo'), 'arg1', 'arg2') ``` + +- name: cmd_array + returns: array[str] + description: Returns an array containing the command(s) for the program. + since: 1.10.0 -- cgit v1.2.3