I am trying to have some C++ code in my Rust code and I have the following include statement:
#include "gtk-layer-shell.h"
I specified the location of the files in the build.rs but because of all the dependencies its a bit messy. My build.rs looks like this:
extern crate cpp_build;
fn main() {
let include_layer_shell = "/usr/include/gtk-layer-shell";
let include_gtk = "/usr/include/gtk-3.0";
let include_glib = "/usr/include/glib-2.0";
let include_glib_config = "/usr/lib/glib-2.0/include";
let include_pango = "/usr/include/pango-1.0";
let include_harfbuzz = "/usr/include/harfbuzz";
let include_cairo = "/usr/include/cairo";
let include_gdk_pixbuf = "/usr/include/gdk-pixbuf-2.0";
let include_atk = "/usr/include/atk-1.0";
cpp_build::Config::new()
.include(include_layer_shell)
.include(include_gtk)
.include(include_glib)
.include(include_glib_config)
.include(include_pango)
.include(include_harfbuzz)
.include(include_cairo)
.include(include_gdk_pixbuf)
.include(include_atk)
.build("src/main.rs");
}
Is there a way I can more elegantly include it and only specify the location for gtk-layer-shell.h and have all the other ones automatically found? I also want to be able to cross-compile the application for aarch64. The way I have it set up right now I guess I would have to change the paths according to the arch which also seems a bit messy.
Thank you for your help! :)
PS:
The reason why I need to have C++ code is basically only because I don't know how I would write gtk_layer_init_for_window (gtk_window); in Rust, so if anybody knows how to completely avoid the c++ code, that would be even better!