簡體   English   中英

如何在 Meson.Build 中運行 PowerShell 腳本?

[英]How to run a PowerShell script in Meson.Build?

我正在嘗試通過 meson.build 運行 PowerShell (.ps1) 腳本調用 pkg_gen.ps1,但它沒有運行,我用於此代碼示例的“run_target”表單僅適用於 shell 腳本。 該文件位於腳本文件夾中,使用“pkg_gen”調用,在腳本文件夾中是另一個 meson.build 文件,顯示腳本的正確路徑。

  1. 介子腳本
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)
  1. 腳本\meson.build
if is_windows
 pkg_gen = files('pkg_gen.ps1')
else
 pkg_gen = files('pkg_gen.sh')
endif 
wheel_gen = files('wheel_gen.py')

如果有人知道如何運行 powershell 腳本,我將不勝感激。

好的,這應該工作

package_cmd = [pkg_gen, python3.path()]
run_target('package',command:['powershell'] + package_cmd)

非常感謝我的同事 Vitaut。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM