gpt4 book ai didi

c++ - 如何处理跨平台 C++ 项目中的依赖关系?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:52:18 24 4
gpt4 key购买 nike

这是我在跨平台项目中以自动化方式处理外部库的方式。 (为什么没有跨平台包管理器?)

  • 将已编译的二进制文件添加 到存储库。 (这是行不通的,因为平台和构建配置各不相同,并且可能会出现新的环境。)
  • 编写下载脚本以从互联网上获取源代码。我可以考虑从 Github 或通过 HTTP 从项目网站克隆库。 (下载链接更改时会中断。此外,我不知道如何自动构建所有库。)
  • 将所有依赖项的源代码包含到存储库中,或者作为子存储库。 (问题仍然是找到一种自动编译它们的方法。而且它需要大量空间。)

在跨平台 C++ 项目中处理外部库的工作流程是什么?那里有很多大项目,我想一定出现了一个。如果不是,我可以根据哪些标准来选择合理的方式?

最佳答案

尝试 CMAKE

CMake, is a cross-platform, open-source build system. CMake is a family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice.

关于c++ - 如何处理跨平台 C++ 项目中的依赖关系?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20387734/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com