diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/main.rs b/src/main.rs index ebc9d71..732805c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,9 @@ use std::env::{current_dir, set_current_dir}; -use std::fs::{create_dir_all, metadata}; +use std::fs::{create_dir_all, metadata, read_to_string}; use std::path::Path; use std::process::Command; -use clang::{Clang, Index}; +mod parse; const TARGET_TAG: &str = "v3.1.5"; @@ -24,8 +24,6 @@ fn main() { "--quiet", "https://github.com/wxWidgets/wxWidgets.git", "orig", - "--depth", - "1", ]) .status() .unwrap(); @@ -66,12 +64,7 @@ fn main() { assert!(cargo_new.success()); } - let clang = Clang::new().unwrap(); - let index = Index::new(&clang, true, true); - - let mut root_header_parser = index.parser("orig/include/wx/wx.h"); - root_header_parser.keep_going(true); - root_header_parser.arguments(&["-Iorig/include", "-D"]); - let root_header = root_header_parser.parse().unwrap(); - println!("{}", root_header.get_entity().get_pretty_printer().print()); + let wx_h_text = read_to_string("orig/include/wx/wx.h").unwrap(); + let lib_root_h = parse::parse(&wx_h_text); + dbg!(lib_root_h); } |