Commit 703c01c4 authored by Ian P. Cooke's avatar Ian P. Cooke

trying to get gir_scanner to work with g-ir-scanner in path.

"-v" to help debugging
"--add-include-path" needed for Linux and making sure it works for Windows.
"--extra-library" to avoid linking errors (changes order of libraries).
parent 85ec00cf
Pipeline #88055 failed with stages
in 7 minutes and 24 seconds
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "aho-corasick"
version = "0.6.8"
......
......@@ -19,6 +19,7 @@ impl GirScanner {
// The path of gir-file which exists in the repository
let repos_girfile = Path::new("gir/Ctest.gir");
let mut command = Command::new("g-ir-scanner");
command.arg("-v");
command.arg("-o");
command.arg(&out_girfile);
command.arg("--namespace");
......@@ -27,17 +28,19 @@ impl GirScanner {
command.arg("0.1");
command.arg("-lgobject-2.0");
command.arg("--pkg=glib-2.0");
command.arg("--add-include-path=./gir");
command.arg("--include");
command.arg("GObject-2.0");
command.arg(format!("--extra-library={}", buildconfig.library_archive().to_str().unwrap()));
command.args(h_files);
command.env("LDFLAGS", buildconfig.library_archive());
if let Some(output) = Self::try_run(&mut command).expect("Error running g-ir-scanner") {
// g-ir-scanner found and runned correctly
if !output.status.success() {
println!("Running g-ir-scanner {:?}", &command);
panic!(
"Error executing g-ir-scanner {}",
"Error executing g-ir-scanner {} {}",
::std::str::from_utf8(&output.stdout).expect("Error converting stdout to utf8"),
::std::str::from_utf8(&output.stderr).expect("Error converting stderr to utf8")
);
}
......
......@@ -125,7 +125,7 @@ impl<'lt, 'ast: 'lt, Boilerplate: boilerplate::Boilerplate<'ast>>
};
quote! {
static mut PRIV: PrivateStatic = PrivateStatic {
gtype: ::std::sync::atomic::ATOMIC_USIZE_INIT,
gtype: ::std::sync::atomic::AtomicUsize::new(0),
private_offset: 0i32,
private: {
#structname {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment