Why doesn't `--workflow` support multiple configure stages?

I was trying to answer a question on StackOverflow about how to effectively accomplish PGO using Clang. The manual workflow is typically to compile once with -fprofile-generate and then again with -fprofile-use after running a representative sample of your application’s functionality.

I thought it would be useful to drive this using a CMake preset workflow:

  1. Configure the project with -fprofile-generate
  2. Build the project
  3. Run the tests marked with the performance label
  4. Configure the project again with -fprofile-use
  5. Build the project again

But CMake rejects this saying that only one configure step is allowed. Why is that? It seems like it would be useful to support doing something like what I outline above.

Here’s a link to my SO answer in case you want to repro this quickly: c++ - How can I express PGO dependencies in CMake 3.7 and higher? - Stack Overflow

1 Like

Cc: @kyle.edwards