Commit 7974dced authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'make-entry-no-parallel'

bd11de08 Makefile: Allow "gmake target1 target2 -j" (#14312)
parents 6f29fdd7 bd11de08
......@@ -44,6 +44,8 @@ public:
*/
virtual void EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *, bool optional);
virtual bool AllowNotParallel() const { return false; }
};
#endif
......@@ -125,6 +125,9 @@ public:
const std::string &workingDirectory,
const std::string &compileCommand);
/** Does the make tool tolerate .NOTPARALLEL? */
virtual bool AllowNotParallel() const { return true; }
protected:
void WriteMainMakefile2();
void WriteMainCMakefile();
......
......@@ -43,6 +43,8 @@ public:
*/
virtual void EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *, bool optional);
virtual bool AllowNotParallel() const { return false; }
};
#endif
......@@ -1685,6 +1685,17 @@ void cmLocalUnixMakefileGenerator3
"default_target",
depends,
no_commands, true);
// Help out users that try "gmake target1 target2 -j".
cmGlobalUnixMakefileGenerator3* gg =
static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
if(gg->AllowNotParallel())
{
std::vector<std::string> no_depends;
this->WriteMakeRule(ruleFileStream,
"Allow only one \"make -f Makefile2\" at a time, but pass parallelism.",
".NOTPARALLEL", no_depends, no_commands, true);
}
}
this->WriteSpecialTargetsTop(ruleFileStream);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment