Tool to create an amalgamation/combine all source files of a library into one for C/C++?

build, c, c++

Solution

try this https://github.com/vinniefalco/Amalgamate/ may be it can help...

Problem

SQLite and googletest come with a very easy-to-use, single-file version which makes it a breeze to use it in other projects, as you just need to add a single source file. Both of them use home-brew tools to create the combined source file, so I wonder if there is a more generic tool for this? It should take a list of implementation/header files and spit out a combined header/source, and fix up the local includes. I'm fine if it doesn't handle conditional includes/includes with different `#defines` before them like Boost.Tuple/MPL uses them. A typical target library would be something like ICU.

Original source