如何将预构建文件打包到 conan 包中,然后在安装过程中只获取某些文件?
How do I package pre-built files into a conan package and then during install only get certain files?
我正在制作一个包含预建 windows 和 linux 文件的柯南包。我如何确保在 conan install
期间,根据调用 conan install
命令的平台,仅从包中获取 windows 或 linux 文件。
除非提供标志 --build
,否则 conan install
不会调用 package()
。那么我是否只添加 --build
标志,然后在 package()
函数中根据平台复制相关文件?我并没有真正构建任何东西,只是“提供”一个具有预构建文件的包,我没有兴趣通过柯南构建这些文件。
lib
目录基本上有一个 windows 和一个 linux 子目录,它们分别包含平台特定文件:
lib/windows/*
lib/linux/*
我将尝试带有 --build
标志的选项,看看我能取得什么结果,但我想知道是否有不同的解决方案,我对柯南没有太多经验,仍在试验中.
I am making a conan package which has pre-built windows and linux files. How do I make sure that during conan install, depending on the platform on which the conan install command is called, only gets either the windows or the linux files from the package
由package ID。每个包都由其设置、选项和依赖项制定。因此,如果您为 Linux 或 Window 执行此操作,它们将是不同的包。
conan install doesn't call package() unless the flag --build is supplied.
install --build 仅在您要从源构建时使用,否则,Conan 将为您下载预构建的包,这是常规流程。
So do I just add the --build flag and then in the package() function copy relevant files depending on the platform? I am not really building anything, just "serving" a package that has pre-built files and I have no interest in building these via conan.
Docs 上有一个关于 packaging binaries 的很好的部分,看看那里。
此外,Conan Center has official recipes which only distribute pre-built, like nodejs 食谱。
我正在制作一个包含预建 windows 和 linux 文件的柯南包。我如何确保在 conan install
期间,根据调用 conan install
命令的平台,仅从包中获取 windows 或 linux 文件。
--build
,否则 conan install
不会调用 package()
。那么我是否只添加 --build
标志,然后在 package()
函数中根据平台复制相关文件?我并没有真正构建任何东西,只是“提供”一个具有预构建文件的包,我没有兴趣通过柯南构建这些文件。
lib
目录基本上有一个 windows 和一个 linux 子目录,它们分别包含平台特定文件:
lib/windows/*
lib/linux/*
我将尝试带有 --build
标志的选项,看看我能取得什么结果,但我想知道是否有不同的解决方案,我对柯南没有太多经验,仍在试验中.
I am making a conan package which has pre-built windows and linux files. How do I make sure that during conan install, depending on the platform on which the conan install command is called, only gets either the windows or the linux files from the package
由package ID。每个包都由其设置、选项和依赖项制定。因此,如果您为 Linux 或 Window 执行此操作,它们将是不同的包。
conan install doesn't call package() unless the flag --build is supplied.
install --build 仅在您要从源构建时使用,否则,Conan 将为您下载预构建的包,这是常规流程。
So do I just add the --build flag and then in the package() function copy relevant files depending on the platform? I am not really building anything, just "serving" a package that has pre-built files and I have no interest in building these via conan.
Docs 上有一个关于 packaging binaries 的很好的部分,看看那里。
此外,Conan Center has official recipes which only distribute pre-built, like nodejs 食谱。