Skip to content

Commit

Permalink
Fix packaging issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed May 17, 2024
1 parent 66b68f5 commit 9c2bf78
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
17 changes: 16 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ include = [
"src/*.c",
"src/zlib/*.[ch]",
"src/zlib/*.pc.in",
# zlib-ng
"src/zlib-ng/**.[ch]",
"src/zlib-ng/arch/arm/**.[ch]",
"src/zlib-ng/arch/generic/**.[ch]",
"src/zlib-ng/arch/power/**.[ch]",
"src/zlib-ng/arch/riscv/**.[ch]",
"src/zlib-ng/arch/s390x/**.[ch]",
"src/zlib-ng/arch/x86/**.[ch]",
"src/zlib-ng/*.[ch].in",
"src/zlib-ng/*.pc.in",
"src/zlib-ng/zlib_name_mangling.h.empty",
# zlib-ng cmake
"src/zlib-ng/CMakeLists.txt",
"src/zlib-ng/zlib.pc.cmakein",
"src/zlib-ng/cmake",
]

[workspace]
Expand All @@ -39,7 +54,7 @@ libc = { version = "0.2.43", optional = true }

[build-dependencies]
pkg-config = "0.3.9"
cc = "1.0.18"
cc = "1.0.97"
cmake = { version = "0.1.50", optional = true }
vcpkg = "0.2"

Expand Down
12 changes: 11 additions & 1 deletion zng/cc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ struct Build {

impl Build {
fn new(cfg: cc::Build) -> Self {
let is_msvc = cfg.get_compiler().is_like_msvc();
// cc currently has a bug where they create a named temp file in a directory
// without ensuring the directory exists first, so apply this workaround
// until it can be fixed upstream
let mut pb = PathBuf::from(env::var_os("OUT_DIR").expect("this should always be set"));
pb.push("lib");
if let Err(err) = std::fs::create_dir_all(&pb) {
panic!("failed to create {:?}: {}", pb, err);
}

let is_msvc = cfg.try_get_compiler().unwrap().is_like_msvc();

Self { cfg, is_msvc }
}

Expand Down

0 comments on commit 9c2bf78

Please sign in to comment.