diff --git a/Cargo.toml b/Cargo.toml index 548be2ce..f387648a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] @@ -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" diff --git a/zng/cc.rs b/zng/cc.rs index 3fe5a5ee..0bbac907 100644 --- a/zng/cc.rs +++ b/zng/cc.rs @@ -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 } }