[CMake] Relink to shared libs

Leif Walsh leif.walsh at gmail.com
Thu Oct 25 13:17:23 EDT 2012


Matthew Woehlke <matthew.woehlke at kitware.com> writes:

> I'm not sure that's correct behavior. What if the modification to the 
> .cpp file was to remove the definition of a function declared in a 
> header? Now your executable that was using that function will crash when 
> you try to run it due to a missing symbol. If you had re-linked, you 
> might instead get a link error letting you know something is wrong.

Yes, but this is a very rare thing to do.  And the "failure" result is
just that the problem would be discovered at test time instead of link
time.

What's being proposed here is a massive optimization for the common case
(changing code in a library and not changing the API or tests) by
sacrificing a little bit of latency (the time between link and test) in
the extremely rare case.

I wouldn't think this would be a hard tradeoff to make.  Could it be added
at least as an option?

-- 
Cheers,
Leif


More information about the CMake mailing list