Exemplo n.º 1
0
 static void Main(string[] args)
 {
     const string projectDir = "C:/code/fixinc/fakeProject/";
     var project = new Project {
         IncludePaths = new string[0],
         PreprocessorDefines = new string[0],
         Sources = new [] { "fake-class.cpp", "fake-main.cpp" }.Select(s => projectDir + s).ToArray()
     };
     Scan.Run(project);
 }
Exemplo n.º 2
0
 public static void Run(Project project)
 {
     using (var index = new ClangSharp.Index()) {
         var scan = new Scan(project.Sources.AsParallel().Select(s =>
             index.CreateTranslationUnit(s,
                 project.PreprocessorDefines.Select(d => "-D" + d).Concat(
                 project.IncludePaths.Select(p => "-I" + p)).ToArray())));
         scan.VisitAll();
         scan.BuildIndex();
     }
 }