diff --git a/c-api/Cargo.toml b/c-api/Cargo.toml index 980e92f1..2cc53b54 100644 --- a/c-api/Cargo.toml +++ b/c-api/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "lolhtml" -version = "1.1.1" +version = "1.1.2" authors = ["Ivan Nikulin ", "Joshua Nelson "] edition = "2021" - +links = "lolhtml" publish = false [dependencies] diff --git a/c-api/build.rs b/c-api/build.rs new file mode 100644 index 00000000..30b0c533 --- /dev/null +++ b/c-api/build.rs @@ -0,0 +1,2 @@ +// Required for the links attribute +fn main() {} diff --git a/c-api/tests/build.rs b/c-api/tests/build.rs index 1f6b2f74..4af2dfc1 100644 --- a/c-api/tests/build.rs +++ b/c-api/tests/build.rs @@ -53,6 +53,8 @@ fn main() { } println!("cargo:rerun-if-changed=../include/lol_html.h"); + println!("cargo:rerun-if-changed=src"); + println!("cargo:rerun-if-changed=build.rs"); // Collect all the C files from src/deps/picotest and src. let mut c_files = glob_c_files(PICOTEST_DIR); @@ -62,7 +64,6 @@ fn main() { build .debug(true) .opt_level(0) - .flag_if_supported("-Wl,no-as-needed") .warnings(true) .extra_warnings(true) .warnings_into_errors(true) @@ -70,7 +71,4 @@ fn main() { .include(PICOTEST_DIR) .files(c_files) .compile("lol_html_ctests"); - - // Link against the C API. - println!("cargo:rustc-link-lib=dylib=lolhtml"); } diff --git a/c-api/tests/src/main.rs b/c-api/tests/src/main.rs index ff67b3b6..10907c30 100644 --- a/c-api/tests/src/main.rs +++ b/c-api/tests/src/main.rs @@ -1,5 +1,8 @@ //! The test runner for the C API tests. +// ensure it's linked +use lolhtml as _; + extern "C" { fn run_tests() -> i32; }