Profiles API

警告

此功能是实验性的,可能会发生重大更改。有关更多信息,请参阅 Conan 稳定性 部分。

class ProfilesAPI(conan_api, api_helpers)
get_default_host()
返回:

指向默认“host”配置文件的路径,该文件可能在缓存中,也可能由用户在配置中定义

get_default_build()
返回:

指向默认“build”配置文件的路径,该文件可能在缓存中,也可能由用户在配置中定义

get_profile(profiles, settings=None, options=None, conf=None, cwd=None, context=None)

计算一个 Profile,作为聚合所有用户参数的结果。首先加载“profiles”,按顺序组合它们(最后一个 profile 具有最高优先级),最后添加单独的 settings、options(优先级高于 profiles)

get_path(profile, cwd=None, exists=True)
返回:

给定 profile 名称的解析路径,该路径可能在缓存中,或本地,具体取决于“cwd”

list()

列出缓存中的所有 profile 文件 :return: 默认缓存位置中按字母顺序排列的 profile 文件列表

static detect()
返回:

自动检测的 Profile,对系统设置进行“最佳猜测”