這是頂層模組,用於建立設定轉換和建構設定描述元,說明規則是哪種建構設定 (如有)。
例如:透過設定 rule()
函式的 build_setting
參數,將下列規則標示為建構設定。具體來說,這是 int
類型的建構設定,也是 flag
,表示這個建構設定可在指令列上呼叫。
my_rule = rule( implementation = _impl, build_setting = config.int(flag = True), ... )
成員
bool
BuildSetting config.bool(flag=False)
參數
參數 | 說明 |
---|---|
flag
|
bool;
default is False Whether or not this build setting is callable on the command line. |
exec
ExecTransitionFactory config.exec(exec_group=None)
參數
參數 | 說明 |
---|---|
exec_group
|
字串;或 None ;
預設為 None 這個轉換作業將使用的執行群組執行平台名稱。如未提供,這項 exec 轉換會使用目標的預設執行平台。 |
int
BuildSetting config.int(flag=False)
參數
參數 | 說明 |
---|---|
flag
|
bool;
default is False Whether or not this build setting is callable on the command line. |
無
transition config.none()
字串
BuildSetting config.string(flag=False, allow_multiple=False)
參數
參數 | 說明 |
---|---|
flag
|
bool;
default is False Whether or not this build setting is callable on the command line. |
allow_multiple
|
bool;
預設為 False 已淘汰,請改用 string_list 設定和 repeatable = True 。如果已設定,則允許在指令列上多次設定這個標記。在轉場效果和建構設定實作函式中存取的旗標值會是字串清單。系統會保留插入順序和重複值。如要採用不同行為,可以在建構設定實作函式中後續處理這份清單。
|
string_list
BuildSetting config.string_list(flag=False, repeatable=False)
--//my/setting=foo,bar
。
參數
參數 | 說明 |
---|---|
flag
|
bool;
default is False Whether or not this build setting is callable on the command line. |
repeatable
|
bool;
預設值為 False 如果設定這個標記,指令列上可以多次設定這個標記,每個值都會視為單一字串,並加入清單值,而非以半形逗號分隔的值。系統會保留插入順序和重複值。如要採用不同行為,可以在建構設定實作函式中後續處理這份清單。 |
目標
transition config.target()
attr.label()
中的 cfg = "target"
。