[cmake-developers] Add native options to the clean step of 'cmake --build .. --clean-first'

Yves Frederix yves.frederix+cmake at gmail.com
Fri Dec 16 03:46:22 EST 2016


<snip>
> Flags for other generators can cause the `clean` to not actually happen.
> For example, with make `cmake --build ... --clean-first -- -i` can cause
> the clean to silently fail and then it isn't really a clean build. Or
> the `-t` flag which skips running commands and instead just touches
> output files. `-n` just prints what would be done. Or a target is passed
> and so you effectively have `make clean -j10 mytarget; make -j10
> mytarget` which could be interesting with the `mytarget` subgraph making
> files while `clean` is going around deleting them again.

Although I am not fully convinced that the above might actually happen
in 'normal' practice, I do agree that it is a risk that should not be
introduced simply to get less verbose output for the clean step (my
use case). Pulling the PR ;) Thanks for your insights!

Regards,
Yves

>
> IMO, these flags being passed to `--clean-first`'s subtask can
> completely invalidate what is being asked for and it makes sense that
> `--clean-first` is really just a plain clean.
>
> --Ben


More information about the cmake-developers mailing list