我试图通过PowerShell (.ps1)脚本通过meson.build调用pkg_gen.ps1,但它没有运行,我在这个代码示例中使用的"run_target“表单只适用于shell脚本。该文件位于脚本文件夹中,并使用"pkg_gen“进行调用,脚本文件夹中的另一个meson.build文件显示了脚本的正确路径。
subdir('scripts')
subdir('include')
subdir('src')
subdir('samples')
subdir('lib')
install_subdir('doc', install_dir : '.')
install_data('README', install_dir : '.')
install_data('LICENSE', install_dir : '.')
install_data('install/meson_options.txt', install_dir : '.')
run_target('package',command:[pkg_gen, python3.path()])
#run_command(pkg_gen)
if is_windows
pkg_gen = files('pkg_gen.ps1')
else
pkg_gen = files('pkg_gen.sh')
endif
wheel_gen = files('wheel_gen.py')
如果有人知道如何运行powershell脚本,我将非常感激。
发布于 2021-03-24 05:37:05
好吧,这应该管用
package_cmd = [pkg_gen, python3.path()]
run_target('package',command:['powershell'] + package_cmd)
多亏了我的同事维托。
https://stackoverflow.com/questions/66774150
复制