snitch-org / snitch

Lightweight C++20 testing framework.
Boost Software License 1.0
257 stars 7 forks source link

`FetchContent` usage results in a project that is always out-of-date #79

Closed jeremyong closed 1 year ago

jeremyong commented 1 year ago

After integrating the project via the CMake instructions (using CMake 3.24, Windows, Ninja generator), the project always reconfigures after each build. Unfortunately, I wasn't able to determine why the generate.stamp file is consistently out-of-date. Do you happen to know if this might be related to some aspect of the snitch CMake setup, or is this possibly an upstream bug? Thanks!

cschreib commented 1 year ago

Hello! I am using the exact code from the Readme to link to snitch in my personal projects, and never experienced this problem. However I exclusively compile these projects on linux with make, so there could be a problem with Microsoft-based toolchains.

I just tried compiling one of these projects (observable_unique_ptr) on a Windows machine. With the default Visual Studio generator, no problem. I also tried with the Ninja generator, and still no problem. FYI, these are the commands I ran (from a Visual Studio Developer Command Prompt):

cmake -G Ninja -DOUP_DO_TEST=1 -S . -B build
cmake --build build

From there on, running

cmake --build build

... produces:

ninja: no work to do.

Are you able to reproduce your problem when building observable_unique_ptr?

NB:

jeremyong commented 1 year ago

Sorry for the late reply, I have since integrated Snitch directly to the project as I didn't have time to diagnose the issue. I'm going to close the issue for now and reopen only if I have more time to investigate.

cschreib commented 1 year ago

Thanks!