Skip to content
Snippets Groups Projects
Commit 8fc56121 authored by mattijs's avatar mattijs
Browse files

BUG: dynamicCodeContext: preprocessing options_, localCode_

parent 258d9a7f
Branches
Tags
No related merge requests found
...@@ -85,6 +85,14 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict) ...@@ -85,6 +85,14 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
stringOps::inplaceExpand(libs_, dict); stringOps::inplaceExpand(libs_, dict);
} }
// optional
const entry* localPtr = dict.lookupEntryPtr("localCode", false, false);
if (localPtr)
{
localCode_ = stringOps::trim(localPtr->stream());
stringOps::inplaceExpand(localCode_, dict);
}
// calculate SHA1 digest from include, options, localCode, code // calculate SHA1 digest from include, options, localCode, code
OSHA1stream os; OSHA1stream os;
os << include_ << options_ << libs_ << localCode_ << code_; os << include_ << options_ << libs_ << localCode_ << code_;
...@@ -103,14 +111,18 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict) ...@@ -103,14 +111,18 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
{ {
addLineDirective(include_, includePtr->startLineNumber(), dict.name()); addLineDirective(include_, includePtr->startLineNumber(), dict.name());
} }
if (optionsPtr)
{ // Do not add line directive to options_ (Make/options) since at it is a
addLineDirective(options_, optionsPtr->startLineNumber(), dict.name()); // single line at this point. Can be fixed.
}
if (libsPtr) if (libsPtr)
{ {
addLineDirective(libs_, libsPtr->startLineNumber(), dict.name()); addLineDirective(libs_, libsPtr->startLineNumber(), dict.name());
} }
if (localPtr)
{
addLineDirective(localCode_, localPtr->startLineNumber(), dict.name());
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment