在Windows上管理用于C ++开发的库集合

时间:2022-03-10 00:16:53

I'm responsible for developing a set of C++ libraries and programs. Currently building on Linux and MacOS, but Windows support is also a requirement. We will need to support VS2010 and VS2012, and in the future will also include VS2013 and maybe also MinGW. We're using cmake for building, so our code should build on all the platforms without issues; my problem is how to manage all the dependencies on Windows in order to be able to build in the first place, and keeping it up-to-date over time. At the moment, we have one virtual machine per visual studio version as a jenkins slave, so parallel builds of all the variants is fairly easy, but managing it is not.

我负责开发一套C ++库和程序。目前在Linux和MacOS上构建,但Windows支持也是一项要求。我们需要支持VS2010和VS2012,并且将来还将包括VS2013和MinGW。我们正在使用cmake进行构建,因此我们的代码应该在所有平台上构建而不会出现问题;我的问题是如何管理Windows上的所有依赖项,以便能够在第一时间构建,并随着时间的推移使其保持最新。目前,我们每个visual studio版本都有一个虚拟机作为jenkins slave,因此所有变体的并行构建相当容易,但管理它并非如此。

The problem is the number of variants this requires building. If we consider only VS2010 and VS2012, with debug/release and i386/x64 builds, that's already 8 copies of each library; 16 if we include the other compilers. We will need all the libraries our code depends on, which will include at a minimum boost, qt, xerces+xalan, zlib, icu, libpng/tiff/jpeg, hdf5 and more, plus python, and all their dependencies. And as new upstream releases are made, we'll need to keep the entire collection up-to-date and consistent for all the build/arch/compiler variants.

问题是这需要构建的变体数量。如果我们只考虑VS2010和VS2012,使用调试/发布和i386 / x64版本,那么每个库已经有8个副本; 16如果我们包括其他编译器。我们将需要我们的代码所依赖的所有库,其中包括至少boost,qt,xerces + xalan,zlib,icu,libpng / tiff / jpeg,hdf5等等,以及python及其所有依赖项。并且随着新的上游版本的发布,我们需要使整个集合保持最新并且与所有构建/ arch /编译器变体保持一致。

I don't want to do this by hand, since this really needs automating. However, I'm unaware of any good solution for doing this on Windows. The Windows building guides I've seen for other projects often involve hand-building all the dependencies, and only build for a single variant. On Linux, it's already packaged, you don't need separate debug builds, and the arch variants can be catered for with chroots; on MacOS there's homebrew, macports etc., and it's also fairly simple to automate stuff there as well. Is there any equivalent for Windows? I've looked at stuff like chocolatey, but it's entirely unsuited to handling libraries, and is pretty poor as a package manager.

我不想手动执行此操作,因为这确实需要自动化。但是,我不知道在Windows上执行此操作的任何好解决方案。我在其他项目中看到的Windows构建指南通常涉及手工构建所有依赖项,并且只构建单个变体。在Linux上,它已经打包,您不需要单独的调试版本,并且可以使用chroot来满足arch变体;在MacOS上有自制软件,macports等,而且在那里自动化东西也相当简单。 Windows是否有任何等价物?我看过像巧克力这样的东西,但它完全不适合处理库,并且作为包管理器很差。

This seems like it should be a common problem for anyone doing C++ development on Windows? Are there any common solutions, tools or methodologies for managing a complex set of libraries and tools for development? How do other developers manage this?

对于在Windows上进行C ++开发的人来说,这似乎应该是一个常见问题?是否有任何通用的解决方案,工具或方法来管理一组复杂的库和开发工具?其他开发人员如何管理这个?

NB. Just for the record, we are not using the visual studio application; we're doing all builds non-interactively via scripts driving the compilers directly with cmake and/or msbuild.

NB。仅供记录,我们不使用visual studio应用程序;我们通过使用cmake和/或msbuild直接驱动编译器的脚本以非交互方式进行所有构建。

Many thanks, Roger

非常感谢,罗杰

2 个解决方案

#1


0  

I worked on large windows C++ project that delivers X86 Release, x86 Debug, x64 Release and x64 debug. Very similarly I used build system that does parallel builds for all target platforms using custom script.

我参与了提供X86 Release,x86 Debug,x64 Release和x64 debug的大型Windows C ++项目。非常类似,我使用构建系统,使用自定义脚本为所有目标平台执行并行构建。

We manage all third party dependency libraries in organized folders. For example x86\release\Zlib.dll x86\Debug\zlib.dll x64\release\zlib.dll x64\zlib.dll

我们管理有组织文件夹中的所有第三方依赖库。例如x86 \ release \ Zlib.dll x86 \ Debug \ zlib.dll x64 \ release \ zlib.dll x64 \ zlib.dll

Custom script is made to pick all these libraries and project source code from configuration management tool. This allows to automatically build the relevant target binaries as needed.

自定义脚本用于从配置管理工具中选择所有这些库和项目源代码。这允许根据需要自动构建相关的目标二进制文件。

any third party libraries change is updated in configuration management tool and then later picked up by the script for the next build.

任何第三方库更改都在配置管理工具中更新,然后由脚本选择以进行下一次构建。

For your question on VS2010 and 2012 support I don't understand importance. Is not one version of VS enough to support for the project?

对于关于VS2010和2012支持的问题,我不了解重要性。是不是VS的一个版本足以支持该项目?

#2


0  

you may take a look at http://www.gisinternals.com/sdk/, and their build system https://github.com/gisinternals/buildsystem

你可以看看http://www.gisinternals.com/sdk/,以及他们的构建系统https://github.com/gisinternals/buildsystem

It's basicly a set of batch and make files calling each others. You still need keep track of lib update manually.

它基本上是一组批处理和make文件相互调用。您仍需要手动跟踪lib更新。

#1


0  

I worked on large windows C++ project that delivers X86 Release, x86 Debug, x64 Release and x64 debug. Very similarly I used build system that does parallel builds for all target platforms using custom script.

我参与了提供X86 Release,x86 Debug,x64 Release和x64 debug的大型Windows C ++项目。非常类似,我使用构建系统,使用自定义脚本为所有目标平台执行并行构建。

We manage all third party dependency libraries in organized folders. For example x86\release\Zlib.dll x86\Debug\zlib.dll x64\release\zlib.dll x64\zlib.dll

我们管理有组织文件夹中的所有第三方依赖库。例如x86 \ release \ Zlib.dll x86 \ Debug \ zlib.dll x64 \ release \ zlib.dll x64 \ zlib.dll

Custom script is made to pick all these libraries and project source code from configuration management tool. This allows to automatically build the relevant target binaries as needed.

自定义脚本用于从配置管理工具中选择所有这些库和项目源代码。这允许根据需要自动构建相关的目标二进制文件。

any third party libraries change is updated in configuration management tool and then later picked up by the script for the next build.

任何第三方库更改都在配置管理工具中更新,然后由脚本选择以进行下一次构建。

For your question on VS2010 and 2012 support I don't understand importance. Is not one version of VS enough to support for the project?

对于关于VS2010和2012支持的问题,我不了解重要性。是不是VS的一个版本足以支持该项目?

#2


0  

you may take a look at http://www.gisinternals.com/sdk/, and their build system https://github.com/gisinternals/buildsystem

你可以看看http://www.gisinternals.com/sdk/,以及他们的构建系统https://github.com/gisinternals/buildsystem

It's basicly a set of batch and make files calling each others. You still need keep track of lib update manually.

它基本上是一组批处理和make文件相互调用。您仍需要手动跟踪lib更新。