aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock35
-rw-r--r--Cargo.toml1
-rw-r--r--src/main.rs17
-rw-r--r--src/parse.rs6
4 files changed, 11 insertions, 48 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 66b32ca..6115bba 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3,40 +3,5 @@
version = 3
[[package]]
-name = "clang"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34c6913be3a1c94f52fb975cdec7ef5a7b69de10a55de66dcbc30d7046b85fa1"
-dependencies = [
- "clang-sys",
- "libc",
-]
-
-[[package]]
-name = "clang-sys"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077c"
-dependencies = [
- "glob",
- "libc",
-]
-
-[[package]]
-name = "glob"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
-
-[[package]]
-name = "libc"
-version = "0.2.97"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6"
-
-[[package]]
name = "riir-wxwidgets"
version = "0.1.0"
-dependencies = [
- "clang",
-]
diff --git a/Cargo.toml b/Cargo.toml
index f9cf65f..8d474db 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,4 +6,3 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-clang = { version = "1.0.3", features = ["clang_8_0"] }
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);
}
diff --git a/src/parse.rs b/src/parse.rs
new file mode 100644
index 0000000..e528f01
--- /dev/null
+++ b/src/parse.rs
@@ -0,0 +1,6 @@
+#[derive(Debug)]
+pub struct FileItem;
+
+pub fn parse(file: &str) -> Vec<FileItem> {
+ todo!()
+}