[CMake] Fake dependencies of executables to static libs

Stephan Menzel stephan.menzel at gmail.com
Fri Apr 5 01:32:10 EDT 2019


Hello Francis,

On Thu, Apr 4, 2019 at 6:49 PM Francis Giraldeau <
francis.giraldeau at gmail.com> wrote:

> Maybe the problem is related to Cotire? I see that it is used in
> mredis. I tried to reproduce the issue, and it behaves correctly. You
> might want to try to reproduce using the following minimal repo:


Alas, I can safely rule out cotire. I only included it a few months ago and
the issue was already ages old by then. Also, it is optional and some use
it, some don't.

What comes to mind now as a possible explanation, as I just a minute ago
noticed is what button to press. Perhaps it is a Visual Studio thing. When
I, for example, work on the mredis lib I do that test driven using the
various testing tools.

Now in order to do this, I generally set the testing suite as "StartUp
Project", as VC calls the currently active target. Then I press 'build
target' (as opposed to 'build solution') or simply just "Debug", the green
play button to run a test.

When the source to the testing suite is changed, both operations cause
build and link of the tool and then run it as they should. When I change a
source in the lib they do not.

However, when I press 'build solution', all dependent binaries do seem to
be relinked. I just tested this. It's simply that I normally don't do this
for low level testing builds because I don't need to build the whole
solution just for one test. Interesting. I never noticed that.
May this shed some light on the issue?

Cheers,
Stephan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190405/419e9210/attachment.html>


More information about the CMake mailing list