Skip to content

Commit

Permalink
Fixing publishing issue related to not using OUT_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsky committed Jun 4, 2022
1 parent e6d033a commit b6793e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions egui-theme/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ fn main() {
panic!("cargo.toml path `{toml_path}` should exist before the build kicks off");
});
// We need to ensure that the generated directory is created properly.
let _ = create_dir("generated");
let out_file = File::create("generated/meta.rs").expect("cannot create file");
let directory = std::env::var("OUT_DIR").expect("OUT_DIR must exist");
let directory = directory + "/generated";
let _ = create_dir(directory.as_str());
let filepath = directory + "/meta.rs";
let out_file = File::create(filepath).expect("cannot create file");

let mut writer = BufWriter::new(out_file);
writeln!(
Expand Down
2 changes: 1 addition & 1 deletion egui-theme/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use theme::EguiTheme;
#[cfg(test)]
mod tests;

include!("../generated/meta.rs");
include!(concat!(env!("OUT_DIR"), "/generated/meta.rs"));

const DEFAULT_FONTS: [&str; 4] = [
"Hack",
Expand Down

0 comments on commit b6793e3

Please sign in to comment.