產生器物件 (generator
)
此物件由 generator()
回傳,並包含一個產生器,該產生器用於通過可執行檔將檔案從一種型別轉換為另一種型別 (例如,將 idl
檔案轉換為原始碼和標頭)。
由以下項目回傳
產生器物件由以下函式和方法回傳
產生器物件方法
generator.process()
接受檔案列表,使它們被處理並回傳一個包含結果的物件,該物件然後可以例如傳遞到建置目標定義中。
簽章
# Takes a list of files, causes them to be processed and returns an object containing the result
generated_list process(
str | file | custom_tgt | custom_idx | generated_list source..., # List of sources to process
# Keyword arguments:
env : env | list[str] | dict[str] # environment variables to set, such as
extra_args : list[str] # If present, will be used to replace an entry `@EXTRA_ARGS@` in the argument list
preserve_path_from : str # If given, specifies that the output files need to maintain their directory structure
)
引數
該方法接受介於 1
和 infinity
個可變引數 (source...
),型別為
。str
| file
| custom_tgt
| custom_idx
| generated_list
要處理的來源列表。
generator.process()
方法接受以下關鍵字引數
名稱 | 型別 | 描述 | 標籤 |
---|---|---|---|
env |
env | list [str ] | dict [str ] |
要設定的環境變數,例如 |
(自 1.3.0 起) |
extra_args |
list [str ] |
如果存在,將用於替換引數列表中的項目 |
|
preserve_path_from |
str |
如果給定,則指定輸出檔案需要在其目標暫存目錄中保持其目錄結構。此值最常見的值為 |
(自 0.45.0 起) |
搜尋結果為