From ce7b2dc2b725b75a835e50b227c90d4b5383d4a8 Mon Sep 17 00:00:00 2001 From: Caelan Sayler Date: Sun, 20 Oct 2024 01:58:28 +0100 Subject: [PATCH] Disable unsupported linker flag on clang --- src/lib-cpp/build.rs | 4 +++- src/lib-cpp/src/lib.rs | 1 + src/lib-cpp/src/map.rs | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib-cpp/build.rs b/src/lib-cpp/build.rs index 73a7f664..061f74de 100644 --- a/src/lib-cpp/build.rs +++ b/src/lib-cpp/build.rs @@ -1,10 +1,10 @@ fn main() { cxx_build::bridge("src/lib.rs") .file("src/bridge.cc") + .warnings_into_errors(true) .flag_if_supported("/std:c++17") .flag_if_supported("/EHsc") // exception unwind handling .flag_if_supported("-Wno-unused-function") // allow unused functions - .warnings_into_errors(true) .define("VELOPACK_LIBC_EXPORTS", Some("1")) .std("c++17") .compile("velopack_libc"); @@ -13,5 +13,7 @@ fn main() { println!("cargo:rerun-if-changed=src/lib.rs"); println!("cargo:rerun-if-changed=src/bridge.hpp"); println!("cargo:rerun-if-changed=src/bridge.cc"); + + #[cfg(target_os = "windows")] println!("cargo:rustc-link-arg=/WHOLEARCHIVE:velopack_libc.lib"); } \ No newline at end of file diff --git a/src/lib-cpp/src/lib.rs b/src/lib-cpp/src/lib.rs index 42930a7a..8888254d 100644 --- a/src/lib-cpp/src/lib.rs +++ b/src/lib-cpp/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] #![allow(non_snake_case)] mod map; diff --git a/src/lib-cpp/src/map.rs b/src/lib-cpp/src/map.rs index 3c68fece..7ba86f36 100644 --- a/src/lib-cpp/src/map.rs +++ b/src/lib-cpp/src/map.rs @@ -1,5 +1,3 @@ -#![allow(dead_code)] - use std::path::PathBuf; use velopack::locator::VelopackLocatorConfig; use velopack::{UpdateInfo, UpdateOptions, VelopackAsset};