diff --git a/src/Core/Parser/Parser.cs b/src/Core/Parser/Parser.cs
index 15e0e551..2fdcd34c 100644
--- a/src/Core/Parser/Parser.cs
+++ b/src/Core/Parser/Parser.cs
@@ -48,8 +48,9 @@ namespace CppSharp
///
/// Parses a C++ source file to a translation unit.
///
- public ParserResult ParseSourceFile(SourceFile file, ParserOptions options)
+ public ParserResult ParseSourceFile(SourceFile file)
{
+ var options = file.Options;
options.ASTContext = ASTContext;
options.FileName = file.Path;
@@ -62,13 +63,13 @@ namespace CppSharp
///
/// Parses the project source files.
///
- public void ParseProject(Project project, ParserOptions options)
+ public void ParseProject(Project project)
{
// TODO: Search for cached AST trees on disk
// TODO: Do multi-threaded parsing of source files
foreach (var source in project.Sources)
- ParseSourceFile(source, options);
+ ParseSourceFile(source);
}
///
diff --git a/src/Generator/Driver.cs b/src/Generator/Driver.cs
index 78b21522..bc9a1aac 100644
--- a/src/Generator/Driver.cs
+++ b/src/Generator/Driver.cs
@@ -170,7 +170,7 @@ namespace CppSharp
var parser = new ClangParser(new Parser.AST.ASTContext());
parser.SourceParsed += OnSourceFileParsed;
- parser.ParseProject(Project, Options);
+ parser.ParseProject(Project);
TargetInfo = parser.GetTargetInfo(Options);