VS 2022 - CMake generation restarts randomly

Ed Llewellyn 40 Reputation points
2023-03-31T18:46:02.5466667+00:00

I'm using VS 2022 to compile remotely on a Linux machine. When I change the CMakeLists.txt or CMakeSettings.json file for my project, CMake will re-generate the CMakeCache.txt.

That's fine, except most times it generates it, says it done, and restarts the generation again. The automatic re-generation can happen up to 6 times or more.

Why is it doing this? There's nothing in the logs I can see that would cause it to restart the CMakeCache.txt regeneration.

For the Linux machine I'm using an in-house device that we will be testing on. I'm not using WSL for instance.

How do I get the random restarts to stop? I've noticed that things don't work when the target Linux machine's clock isn't synchronized with my PC clock, but I've synced it to no avail!

Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
971 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Anna Xiu-MSFT 25,891 Reputation points Microsoft Vendor
    2023-04-03T03:46:10.7166667+00:00

    Hi @Ed Llewellyn

    Welcome to Microsoft Q&A! 

    Visual Studio does regenerate the cache when you save edits to CMakeLists.txt or CMakeSettings.json. If you're using an Existing Cache configuration, then Visual Studio doesn't modify the cache.

    For information on how to open an Existing Cache configuration, please refer to: Open an existing cache

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Ed Llewellyn 40 Reputation points
    2023-04-21T21:49:25.9766667+00:00

    This answer doesn't help me - I know that changing the CMakeLists.txt or the CMakeJsonSettings.json file will trigger a CMake re-generation. My question is why it'll regenerate over and over again without an errors being displayed. Like it somehow gets out of sync or has timing issues.

    0 comments No comments