Browse Source

Update to the new driver interface.

pull/1/head
triton 13 years ago
parent
commit
0070b5f0d6
  1. 18
      src/Generator/Program.cs
  2. 2
      src/Generator/Transforms/Transform.cs

18
src/Generator/Program.cs

@ -122,17 +122,23 @@ namespace Cxxi @@ -122,17 +122,23 @@ namespace Cxxi
if (!ParseCommandLineOptions(args, options))
return;
// We need to know absolute pathes in order to determine correct include pathes.
for (int i = 0; i < options.IncludeDirs.Count; i++)
{
if (options.IncludeDirs[i] == ".") options.IncludeDirs[i] = Directory.GetCurrentDirectory();
}
ILibrary library = null;
if (!ParseLibraryAssembly(options.Assembly, out library))
return;
var driver = new Driver(options, library);
driver.Setup();
driver.ParseCode();
driver.ProcessCode();
driver.GenerateCode();
}
public static void Run(ILibrary library)
{
var options = new DriverOptions();
var driver = new Driver(options, library);
driver.Setup();
driver.ParseCode();
driver.ProcessCode();
driver.GenerateCode();

2
src/Generator/Transforms/Transform.cs

@ -35,7 +35,7 @@ namespace Cxxi.Passes @@ -35,7 +35,7 @@ namespace Cxxi.Passes
shortestIncludePath = inc;
}
return "..\\" + shortestIncludePath.TrimStart(new char[] { '\\', '/' });
return Options.IncludePrefix + shortestIncludePath.TrimStart(new char[] { '\\', '/' });
}
void TransformModule(TranslationUnit unit)

Loading…
Cancel
Save