[CMake] preventing redundant compilations

Bill O'Hara billtohara at gmail.com
Tue Mar 17 15:43:50 EDT 2009


One of the users I support complained about the following:

add_library(foo a.c b.c)
add_library(bar a.c c.c)

because a.c will be compiled twice (the real case is more complex of course
but essentially the same thing with more files). While its possible to pull
a.c out into a library and link against it, this adds complexity for the end
users who need to think about it while updating the build files.

Is it possible to convince cmake to automatically figure out it doesn't need
to compile a.c twice, or at least to warn about the redundant compilation so
the user can realize what is happening and work around it?

thanks
b.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090317/e5bb1c63/attachment.htm>


More information about the CMake mailing list