Skip to content

load_cache: allow one form in script mode

Charlie Barto requested to merge barcharcraz/cmake:load_cache_in_script into master
  • allows the new form of load_cache in script mode. Both technically could work (there's no cache to save, so the second form would just set "cache" variables, but usage of the second form in script mode is probably a bug.

  • also makes load_cache immediately terminate if it's passed no arguments, this isn't a bug fix or anything, but it could become one if the logic of load_cache's old mode changes.

I'm looking for feedback on the implementation before writing tests. In particular I want to know if cmLoadCacheCommand() is the correct place to be checking for script mode, and also if status.GetMakefile().GetCMakeInstance()->GetWorkingMode() == cmake::SCRIPT_MODE is the correct way to do so. I'd also like to know if there's any unforeseen interactions with findPackage mode I need to be aware of. This is my first contribution to cmake's c++ code (which I found pretty nice work work with) so I don't know how everything works.

Edited by Brad King

Merge request reports