Skip to content

Fix for regression introduced in commit 7302245 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/jomlib/makefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ void Command::evaluateModifiers()
DescriptionBlock::DescriptionBlock(Makefile* mkfile)
: m_bFileExists(false),
m_bVisitedByCycleCheck(false),
m_bVisitedByPreselectInferenceRules(false),
m_bNoCyclesRootedHere(false),
m_canAddCommands(ACSUnknown),
m_pMakefile(mkfile)
Expand Down
1 change: 1 addition & 0 deletions src/jomlib/makefile.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class DescriptionBlock : public CommandContainer {
bool m_bFileExists;
bool m_bVisitedByCycleCheck;
bool m_bNoCyclesRootedHere;
bool m_bVisitedByPreselectInferenceRules;
QVector<InferenceRule*> m_inferenceRules;

enum AddCommandsState { ACSUnknown, ACSEnabled, ACSDisabled };
Expand Down
17 changes: 9 additions & 8 deletions src/jomlib/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,16 +726,17 @@ QVector<InferenceRule*> Parser::findRulesByTargetName(const QString& targetFileP

void Parser::preselectInferenceRules(DescriptionBlock *target)
{
if (!target->m_commands.isEmpty()) {
/* If we already have commands for this target, then we've already
* generated all the commands for the dependents already. Nothing
* more to do. */
if (target->m_bVisitedByPreselectInferenceRules)
// We already processed this target
return;
}

QVector<InferenceRule *> rules = findRulesByTargetName(target->targetName());
if (!rules.isEmpty())
target->m_inferenceRules = rules;
target->m_bVisitedByPreselectInferenceRules = true;

if (target->m_commands.isEmpty()) {
QVector<InferenceRule*> rules = findRulesByTargetName(target->targetName());
if (!rules.isEmpty())
target->m_inferenceRules = rules;
}

foreach (const QString &dependentName, target->m_dependents) {
DescriptionBlock *dependent = m_makefile->target(dependentName);
Expand Down