summaryrefslogtreecommitdiffstats
path: root/Source/cmLoadCacheCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLoadCacheCommand.cxx')
-rw-r--r--Source/cmLoadCacheCommand.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx
index 1184bcb..d49e711 100644
--- a/Source/cmLoadCacheCommand.cxx
+++ b/Source/cmLoadCacheCommand.cxx
@@ -24,12 +24,20 @@ bool cmLoadCacheCommand(std::vector<std::string> const& args,
{
if (args.empty()) {
status.SetError("called with wrong number of arguments.");
+ return false;
}
if (args.size() >= 2 && args[1] == "READ_WITH_PREFIX") {
return ReadWithPrefix(args, status);
}
+ if (status.GetMakefile().GetCMakeInstance()->GetWorkingMode() ==
+ cmake::SCRIPT_MODE) {
+ status.SetError(
+ "Only load_cache(READ_WITH_PREFIX) may be used in script mode");
+ return false;
+ }
+
// Cache entries to be excluded from the import list.
// If this set is empty, all cache entries are brought in
// and they can not be overridden.