当前位置: 首页 > news >正文

网站的架设网站模板平台

网站的架设,网站模板平台,老太太做受网站,营销型网站建设 案例创建conan包-工具链 1 Toolchains 本文是基于对conan官方文档Toolchains翻译而来, 更详细的信息可以去查阅conan官方文档。 1 Toolchains Toolchains are the new way to integrate with build systems in Conan. Recipes can define a generate() method that wi…

创建conan包-工具链

  • 1 Toolchains

本文是基于对conan官方文档Toolchains翻译而来, 更详细的信息可以去查阅conan官方文档。

1 Toolchains

Toolchains are the new way to integrate with build systems in Conan. Recipes can define a generate() method that will return an object which can generate files from the current configuration that can be used by the build systems. Conan generators provide information about dependencies, while toolchains provide a “translation” from the Conan settings and options, and the recipe defined configuration to something that the build system can understand. A recipe that does not have dependencies does not need a generator, but can still use a toolchain.
工具链是conan与构建系统集成的新方法。配方可以定义一个 "generate() "方法,该方法将返回一个对象,该对象可以根据当前配置生成可供构建系统使用的文件。conan生成器提供有关依赖关系的信息,而工具链则将conan设置和选项以及配方定义的配置 "翻译 "为构建系统可以理解的内容。没有依赖关系的配方不需要生成器,但仍可使用工具链。

A toolchain can be defined, among the built-ins toolchains, with an attribute with the name of the toolchain class to use.
在内置工具链中,可以定义一个工具链,其属性包含要使用的工具链类的名称。

generators = "<ToolChainClassName>"

For example, for using the CMake toolchain this should be declared in the recipe:
例如,使用 CMake 工具链时,应在配方中声明这一点:

generators = "CMakeToolchain"

Tip
You can explore available toolchains in the new tools section
您可以在新工具部分查看可用的工具链

But in the more general case, and if it needs any specific configuration beyond the default one:
但在更一般的情况下,如果它需要默认配置之外的任何特定配置:

from conan.tools.cmake import CMakeToolchaindef generate(self):tc = CMakeToolchain(self)# customize toolchain "tc"tc.generate()

It is possible to use the generate() method to create your own files, which will typically be deduced from the current configuration of self.settings and self.options.
你可以使用 generate() 方法创建自己的文件,这些文件通常是根据 self.settingsself.options 的当前配置推导出来的。

from conan.tools.files import savedef generate(self):# Based on the self.settings, self.options, the user# can generate their own files:save("mytoolchain.tool", "my own toolchain contents, deduced from the settings and options")# The "mytoolchain.tool" file can be used by the build system to# define the build

And as usual, you can create your own toolchain helpers, put them in a python_requires package and reuse them in all your recipes.
像往常一样,你可以创建自己的工具链辅助工具,将其放入 python_requires 包中,并在所有配方中重复使用。

Toolchains have some important advantages:
工具链有一些重要优势:

  • They execute at conan install time. They generate files, not command line arguments, providing better reproducibility and debugging of builds.
  • 它们在conan安装时执行。它们生成的是文件,而不是命令行参数,从而提供更好的可重复性和构建调试。
  • They provide a better developer experience. The command line used by developers locally, like cmake ... will achieve the same build, with the same flags, as the conan build or the build that is done in the cache with a conan create.
  • 它们为开发人员提供了更好的体验。开发人员在本地使用的命令行,如 “cmake …”,将与 "conan build "或在缓存中使用 "conan create "完成的构建一样,具有相同的标记。
  • They are more extensible and configurable.
  • 它们更具扩展性和可配置性。

The toolchains implement most of the build system logic, leaving the build helpers, like CMake(), doing less work, and acting basically as a high level wrapper of the build system. Many of the existing arguments, attributes or methods of those build helpers will not be available. Check the documentation of each toolchain to check the associated build helper available functionality.
工具链实现了大部分的编译系统逻辑,而像 CMake() 这样的编译助手所做的工作较少,它们基本上充当了编译系统的高级封装器。这些联编助手的许多现有参数、属性或方法将不可用。请查阅每个工具链的文档,查看相关联编助手的可用功能。

from conan.tools.cmake import CMakeToolchain, CMakedef generate(self):tc = CMakeToolchain(self)# customize toolchain "tc"tc.generate()def build(self):# NOTE: This is a simplified helper# Not all arguments attributes and methods might be availablecmake = CMake(self)
http://www.hkea.cn/news/274754/

相关文章:

  • 开发公司成本部职责岗位职责和流程苏州网站建设优化
  • 湛江网站制作系统seo排名需要多少钱
  • 城乡现代社区建设seo关键词推广案例
  • 旅游网站开发外文文献关键洞察力
  • 大学生asp网站开发的实训周长沙百度快速优化
  • 黑龙江省建设网站百度投流运营
  • 网站关键词太多好不好兰州seo整站优化服务商
  • 义乌网站设计网店推广策划方案
  • 无锡网站优化工作室网站关键词排名优化推广软件
  • 长沙做网站的公司亚马逊seo什么意思
  • 仪征建设银行官方网站怎么优化一个网站
  • 那个网站可以查询美做空基金宁波网站推广平台效果好
  • 杨凌企业网站建设天津seo优化
  • 建设网站的工具免费b站在线观看人数在哪儿
  • 毕业设计餐饮网站建设国内前10电商代运营公司
  • 日本b2b网站市场调研的步骤
  • 强企网做网站网店推广有哪些
  • 博物馆网站建设策划书公司如何在百度宣传
  • 做cpa广告网站教程百度sem推广具体做什么
  • 免费网站建站WWW222国际军事最新消息今天
  • 做网站软件miscrosoft云服务器
  • 如何做盗版小说网站最经典的营销案例
  • 设计类的网站和简介关键词优化推广排名多少钱
  • 代理记账网站怎么做北京seo方法
  • cdr做网站企业网站建设的基本流程
  • 网站建设需要哪些硬件百度指数排名
  • 2017年网站开发用什么语言找培训机构的app
  • 澳门响应式网站建设seo入门黑帽培训教程
  • 有哪些网站可以做微商口碑营销案例2021
  • 百度推广要不要建网站网络平台建设及运营方案