Browse Source

Add _wrapper suffix to autogenerated files, so would not conflict with normal headers/sources.

Move interop.h to higher directory.
pull/1/head
Tarmo Pikaro 14 years ago committed by triton
parent
commit
f9dc3a61c7
  1. 16
      src/Generator/Generators/CLI/CLIHelpers.cs
  2. 7
      src/Generator/Generators/CLI/CLISourcesTemplate.cs

16
src/Generator/Generators/CLI/CLIHelpers.cs

@ -405,6 +405,7 @@ namespace Cxxi.Generators.CLI
public void GenerateStart() public void GenerateStart()
{ {
if( Transform == null) if( Transform == null)
<<<<<<< HEAD
{ {
WriteLine("//----------------------------------------------------------------------------"); WriteLine("//----------------------------------------------------------------------------");
WriteLine("// This is autogenerated code by cxxi-generator."); WriteLine("// This is autogenerated code by cxxi-generator.");
@ -414,6 +415,17 @@ namespace Cxxi.Generators.CLI
if( FileExtension == "cpp" ) if( FileExtension == "cpp" )
WriteLine(@"#include ""interop.h"" // marshalString"); WriteLine(@"#include ""interop.h"" // marshalString");
=======
{
WriteLine("//----------------------------------------------------------------------------");
WriteLine("// This is autogenerated code by cxxi-generator.");
WriteLine("// Do not edit this file or all your changes will be lost after re-generation.");
WriteLine("//----------------------------------------------------------------------------");
if( FileExtension == "cpp" )
WriteLine(@"#include ""../interop.h"" // marshalString");
>>>>>>> 02a2243... Add _wrapper suffix to autogenerated files, so would not conflict with normal headers/sources.
}else }else
Transform.GenerateStart(this); Transform.GenerateStart(this);
} }
@ -534,9 +546,11 @@ namespace Cxxi.Generators.CLI
return template; return template;
} }
public static String WrapperSuffix = "_wrapper";
void WriteTemplate(TextTemplate template) void WriteTemplate(TextTemplate template)
{ {
var file = Path.GetFileNameWithoutExtension(template.Module.FileName) + "." var file = Path.GetFileNameWithoutExtension(template.Module.FileName) + WrapperSuffix + "."
+ template.FileExtension; + template.FileExtension;
var path = Path.Combine(Options.OutputDir, file); var path = Path.Combine(Options.OutputDir, file);

7
src/Generator/Generators/CLI/CLISourcesTemplate.cs

@ -12,8 +12,15 @@ namespace Cxxi.Generators.CLI
{ {
GenerateStart(); GenerateStart();
<<<<<<< HEAD
WriteLine("#include \"{0}.h\"", WriteLine("#include \"{0}.h\"",
Path.GetFileNameWithoutExtension(Module.FileName)); Path.GetFileNameWithoutExtension(Module.FileName));
=======
WriteLine("#include \"{0}{1}.h\"",
Path.GetFileNameWithoutExtension(Module.FileName),
CLIGenerator.WrapperSuffix );
NewLine();
>>>>>>> 02a2243... Add _wrapper suffix to autogenerated files, so would not conflict with normal headers/sources.
GenerateForwardReferenceHeaders(); GenerateForwardReferenceHeaders();
NewLine(); NewLine();

Loading…
Cancel
Save