diff --git a/src/Generator/Program.cs b/src/Generator/Program.cs index 4b670b61..1577dfd2 100644 --- a/src/Generator/Program.cs +++ b/src/Generator/Program.cs @@ -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(); diff --git a/src/Generator/Transforms/Transform.cs b/src/Generator/Transforms/Transform.cs index baf284bd..cc89656a 100644 --- a/src/Generator/Transforms/Transform.cs +++ b/src/Generator/Transforms/Transform.cs @@ -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)