diff options
author | ianhin <ianhin> | 2004-11-16 01:25:16 +0000 |
---|---|---|
committer | ianhin <ianhin> | 2004-11-16 01:25:16 +0000 |
commit | 4082c1e82c44eda5fc1ddb4fb9ec55161444ceb8 (patch) | |
tree | fb10ebb894a268d7a1dcb19fac2ffc6a564e327b /Tools/CodeGen/Thorn.m | |
parent | 7e6ec004230019a539b23e4fa888da118bce625d (diff) |
Added support for extra include files in Setter Source files
Diffstat (limited to 'Tools/CodeGen/Thorn.m')
-rw-r--r-- | Tools/CodeGen/Thorn.m | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Tools/CodeGen/Thorn.m b/Tools/CodeGen/Thorn.m index 1cad59a..346237b 100644 --- a/Tools/CodeGen/Thorn.m +++ b/Tools/CodeGen/Thorn.m @@ -39,7 +39,7 @@ Schedule, Sources, Makefile, Filename, Contents, ThornName, BaseImplementation, EvolvedGFs, PrimitiveGFs, Groups, Calculation, GridFunctions, Shorthands, Equations, Parameter, Value, UsesFunctions, ArgString, Conditional, D1, D2, D3, D11, D22, D33, D21, D31, D32, -Textual, TriggerGroups}; +Textual, TriggerGroups, Include}; {ExcisionGFs}; @@ -408,7 +408,13 @@ calculationMacros[] := CodeGen representation of a source file that defines a function for each Calculation. *) -CreateSetterSource[calcs_, debug_] := +CreateSetterSource[calcs_, debug_, opts___] := + Module[{include}, + include = lookupDefault[{opts}, Include, {}]; + + If[!MatchQ[include, _List], + Throw["CreateSetterSource: Include should be a list but is in fact " <> ToString[include]]]; + {whoWhen[CodeGen`SOURCELANGUAGE], "#define KRANC_" <> ToUpperCase[CodeGen`SOURCELANGUAGE] <> "\n\n", @@ -418,14 +424,14 @@ CreateSetterSource[calcs_, debug_] := "\n" ], - Map[IncludeFile, {"cctk.h", "cctk_Arguments.h", "cctk_Parameters.h", - "precomputations.h", "GenericFD.h", "Differencing.h"}], + Map[IncludeFile, Join[{"cctk.h", "cctk_Arguments.h", "cctk_Parameters.h", + "precomputations.h", "GenericFD.h", "Differencing.h"}, include]], calculationMacros[], (* For each function structure passed, create the function and insert it *) Map[CreateCalculationFunction[# , debug]& , - calcs]}; + calcs]}]; |