[CMake] completely static build on linux

William A. Hoffman billlist at nycap.rr.com
Fri Apr 7 10:00:08 EDT 2006


At 09:36 AM 4/7/2006, John Biddiscombe wrote:
>I think this topic has come up before, but I caouldn't find if was there a definitive answer on how to get a completely static build - including all std libraries etc.
>
>Is there a reliable technique?

You can add a -static flag into your CMAKE_C_FLAGS.  However, many compilers do not
really allow a completely static build as things like libc may not even be static,
or if you call dlopen it will not work.

-Bill



More information about the CMake mailing list