可執行目標 (exe
繼承自 build_tgt
)
一個可執行檔
由以下項目回傳
可執行目標物件由下列函式和方法回傳
繼承的方法
build_tgt.extract_all_objects()
與 extract_objects
的作用相同,但會回傳此目標產生的所有物件檔案。
預設情況下,僅回傳為此目標建置的物件,以維持與先前版本的向後相容性。recursive
關鍵字參數的預設值最終將在未來版本中更改為 true
。
簽章
# Acts the same as `extract_objects`, but returns all object files generated
extracted_obj extract_all_objects(
recursive : bool # Also return objects passed to the `objects` argument of this target
)
參數
方法 build_tgt.extract_all_objects()
接受以下關鍵字參數
名稱 | 類型 | 說明 | 標籤 |
---|---|---|---|
recursive |
bool |
同時回傳傳遞給此目標的 |
(自 0.46.0 版本起)
|
build_tgt.extract_objects()
回傳代表為這些來源檔案產生的物件檔案的不透明值。這通常用於取得單個物件檔案並將其連結到單元測試,或使用自訂旗標編譯某些來源檔案。若要在另一個建置目標中使用物件檔案,請將 objects:
關鍵字參數用於 build_target()
或 declare_dependency()
,或將其包含在 custom_target()
的命令列中。
簽章
# Returns an opaque value representing the object files generated for those
extracted_obj extract_objects(
str | file source..., # Source filenames for which the built objects should be extracted
)
參數
此方法接受 1
到 無限大
個可變參數 (source...
),類型為
。str
| file
應擷取已建置物件的來源檔案名稱。
build_tgt.found()
永遠回傳 true
。此函式旨在使可執行檔物件的功能與 external_program
物件相容。這簡化了使用可執行檔代替 external_program
的使用案例。
簽章
(自 0.59.0 版本起)
bool found()
build_tgt.full_path()
回傳指向結果目標檔案的完整路徑。注意:在大多數情況下,使用物件本身與此方法的作用相同,並且還允許 Meson 正確設定目標間的相依性。如果這對您不起作用,請提出錯誤報告。
簽章
str full_path()
build_tgt.name()
回傳目標的名稱。
簽章
(自 0.54.0 版本起)
str name()
build_tgt.path()
與 build_tgt.full_path()
的作用完全相同。注意:此函式僅保留用於與 external_program
物件相容。一旦刪除了 external_program
物件中已棄用的對應 path()
函式,此函式也將被移除。
簽章
(自 0.59.0 版本起)
已棄用
於 0.59.0 版本
str path()
build_tgt.private_dir_include()
回傳一個與 include_directories()
類似的值,但指向此目標的私有目錄。通常只有在另一個目標需要存取此目標的一些產生的內部標頭時才需要。
簽章
inc private_dir_include()
搜尋結果為