Confusing error behaviour when path supplied to -C is missing
When doing cmake .. -C foo.cmake <lots of args>
, as part of a larger build process with LLVM, cmake failed with:
<hundreds of messages>
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Configuring incomplete, errors occurred!
Looking through the recent things there are lots of things that say "failed", but they are feature tests.
The way I ended up finding the error was to set a hardware watchpoint on cmSystemTools::s_ErrorOccured
. This brought to my attention the very first line of output, previously invisible to me:
CMake Error: Error processing file: foo.cmake
Since it is the only line which is not prefixed with --
, it did not stand out as an error on inspecting the logs. It also did not stand out because typically errors appear towards the end of the log, not at the very beginning.
Is there a good reason to have this be an "error" rather than a "fatal error"? It seems to me that having it as a fatal error would be much more useful in bringing it to the attention of a user. If it's an error, it won't succeed in any case, so is there any value at proceeding?
The relevant code path is: