On Tue, Mar 2, 2021 at 2:37 PM Ludovic Courtès wrote: > Hi, > > Greg Hogan skribis: > > > The AWS packages (aws-sdk-cpp and dependencies) are currently built as > > static libraries. I would like to build both static and shared but could > > not find an example or simple method for building both using cmake. Do > you > > think it would be worthwhile to extend the cmake-build-system to > optionally > > configure, build, and install static libraries with additional phases? > The > > gnu-build-system makes it easy to inline a new phase into the package > > definition (when the makefile has both 'make' and 'make static' targets) > > but with CMake we are forced to duplicate the configure phase, which is > 44 > > lines of code. > > In general, it’s best to build only shared libraries. That allows for > reduced memory usage, fast security updates via grafts, etc. So if you > could make the AWS packages build as shared libraries only, that’d be > great. > > It’s OK to optionally add static libraries, preferably in a separate > output or even a separate package, but that’s not what should be used by > default. > > Does that make sense? Yes, I would prefer to provide shared as the default output and static as a separate output to the same package. There look to be three options: 1) separate packages (as with boost and boost-static). This is simple but not as elegant (boost-static is the eighth most relevant package when guix search'ing for "boost"). 2) duplicate CMake phases in the package definition (much more verbose than with gnu-build-system). This results in considerable duplication of build system code and is unmaintainable. 3) extend the cmake-build-system to optionally configure, build, and install static libraries with additional phases. The ideal result but requires modification of the cmake-build-system. Thoughts? > Thanks, > Ludo’. >