C ++ dependency handling (cross platform)

I got the impression that this question was asked as a hundred times, but never fully answered.

I am working on a small project, which at some point should be released for the three large PC platforms (Windows, Mac and GNU / Linux), so locking myself up early on technology is a bad idea. Fortunately, but unfortunately, so far, during the early development, we focus only on 32-bit Windows.

At the code level, cross-platform development is relatively simple if you choose the right libraries. In addition, creating software on several platforms is relatively straightforward; I am studying the use of GYP or CMake.

The problem is dependencies. To create a project you will need: SDL, SDL_image, SDL_ttf, iconv, libxml2, libxmlmm, sigC ++, wxWidgets, glew, bullet, openALsoft and, possibly, later.

So far I have found three options:

  • check sources and build them as part of the project
  • check binary files
  • manage dependencies outside the source tree

The first seems redundant since you basically need to maintain your library fork and your custom build system.

The second option sounds like a thing to do when your goal is only one or two platforms. But if you consider all the different goals, including the 32/64 bit options, it also starts to go into something barely manageable.

The third option depends on the environment. If you let your developers manually handle the dependencies, you'll never sleep almost. Just getting every addiction built and ready to use is hardly possible. Not to mention that you cannot guarantee that every developer uses the correct version.

If you look at other languages, they solve the problem in different ways. On systems like npm, marvin or phing, you only support a certain configuration file in the project, and the tools then retrieve any dependencies.

I was thinking of creating dependencies centrally, packing them into zip / deb / rpm / whatever packages and putting them in the repository. Then, each developer will copy the dependencies for their platform to the repository (but not check them) before creating. This will preferably be done automatically as a pre-assembly step.

I especially don't need an extra build system. I looked around, and the only thing that remotely does what I want to be maybe Ivy. But either I missed something, or Ivy completely finished this problem. Is there something simple to solve this problem?

I am developing my own.

+8
c ++ build-automation dependencies
source share
1 answer

I would recommend not creating your own.

We use ant / ivy / Hudson to automate cross-platform builds (Windows and Linux). We also use Nexus (Maven) as our artifact repository, which contains an assembly of third-party libraries, as well as our own application. Hudson integrates with Perforce (our software repository).

We also create separate 32-bit and 64-bit artifacts of everything and ant / ivy will make it much easier.

This is great for us.

+3
source share

All Articles