summaryrefslogtreecommitdiffstats
path: root/Source/cmLoadCacheCommand.cxx
diff options
context:
space:
mode:
authorCharles Barto <chbarto@microsoft.com>2019-11-13 01:17:17 (GMT)
committerBrad King <brad.king@kitware.com>2019-11-19 19:39:00 (GMT)
commit5e9ecaae0e191aba8b02243cb94a68983d6ce3f0 (patch)
treefcc019812b0735542892afe2ae611375f056c893 /Source/cmLoadCacheCommand.cxx
parent7e62ffc028cbaea17d5dc19d5dd4c2f5fcbfa137 (diff)
downloadCMake-5e9ecaae0e191aba8b02243cb94a68983d6ce3f0.zip
CMake-5e9ecaae0e191aba8b02243cb94a68983d6ce3f0.tar.gz
CMake-5e9ecaae0e191aba8b02243cb94a68983d6ce3f0.tar.bz2
load_cache: Allow READ_WITH_PREFIX mode in cmake scripts
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.