From a00705aa40f96fa73b18cfb8a758c62729224258 Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 28 Oct 2024 15:01:38 +0000 Subject: [PATCH] Fix linking in fuzzing --- fuzz/test_case/Cargo.toml | 1 + fuzz/test_case/build.rs | 3 --- fuzz/test_case/src/lib.rs | 7 ++----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/fuzz/test_case/Cargo.toml b/fuzz/test_case/Cargo.toml index f8a52d71..0845db67 100644 --- a/fuzz/test_case/Cargo.toml +++ b/fuzz/test_case/Cargo.toml @@ -8,6 +8,7 @@ publish = false [dependencies] lol_html = { path = "../../" } +lolhtml = { path = "../../c-api" } encoding_rs = "0.8.13" libc = "0.2.61" rand = "0.8.4" diff --git a/fuzz/test_case/build.rs b/fuzz/test_case/build.rs index 243fc735..7fdf0705 100644 --- a/fuzz/test_case/build.rs +++ b/fuzz/test_case/build.rs @@ -5,9 +5,6 @@ fn main() { let out_dir = env::var("OUT_DIR").unwrap(); let out_path = PathBuf::from(&out_dir); - println!("cargo:rustc-link-search=../c-api/target/debug"); - println!("cargo:rustc-link-lib=lolhtml"); - // The bindgen::Builder is the main entry point // to bindgen, and lets you build up options for // the resulting bindings. diff --git a/fuzz/test_case/src/lib.rs b/fuzz/test_case/src/lib.rs index f89c1f09..9e781a54 100644 --- a/fuzz/test_case/src/lib.rs +++ b/fuzz/test_case/src/lib.rs @@ -2,11 +2,8 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] -extern crate encoding_rs; -extern crate lol_html; -extern crate rand; - -extern crate libc; +// make it link +use lolhtml as _; use libc::{c_char, c_void, size_t}; use rand::Rng;