Skip to content

Commit

Permalink
Fix linking of lolhtml lib
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Oct 28, 2024
1 parent 0d8757b commit e7f1101
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions c-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "lolhtml"
version = "1.1.1"
version = "1.1.2"
authors = ["Ivan Nikulin <[email protected]>", "Joshua Nelson <[email protected]>"]
edition = "2021"

links = "lolhtml"
publish = false

[dependencies]
Expand Down
2 changes: 2 additions & 0 deletions c-api/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Required for the links attribute
fn main() {}
6 changes: 2 additions & 4 deletions c-api/tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -62,15 +64,11 @@ fn main() {
build
.debug(true)
.opt_level(0)
.flag_if_supported("-Wl,no-as-needed")
.warnings(true)
.extra_warnings(true)
.warnings_into_errors(true)
.include(INCLUDE_DIR)
.include(PICOTEST_DIR)
.files(c_files)
.compile("lol_html_ctests");

// Link against the C API.
println!("cargo:rustc-link-lib=dylib=lolhtml");
}
3 changes: 3 additions & 0 deletions c-api/tests/src/main.rs
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down

0 comments on commit e7f1101

Please sign in to comment.