Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.8.3] - UNRELEASED
### Changed
- Introduce a feature "support" to guard all interactions with clang executable.
Enabled by default, for backwards compatibility.

## [1.8.2] - 2024-05-29

### Changed
Expand Down
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ links = "clang"
build = "build.rs"

[features]
default = ["support"]

clang_3_5 = []
clang_3_6 = ["clang_3_5"]
Expand All @@ -41,11 +42,13 @@ clang_16_0 = ["clang_15_0"]
clang_17_0 = ["clang_16_0"]
clang_18_0 = ["clang_17_0"]

runtime = ["libloading"]
runtime = ["libloading", "support"]
static = []

libcpp = []

support = []

[dependencies]

glob = "0.3"
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]

// Keep all interactions with the clang executable in this module.
#[cfg(feature = "support")]
pub mod support;

#[macro_use]
Expand Down
3 changes: 3 additions & 0 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,22 @@ fn test() {
parse();
}

#[cfg(feature = "support")]
#[test]
fn test_support() {
let clang = support::Clang::find(None, &[]).unwrap();
println!("{:?}", clang);
}

#[cfg(feature = "support")]
#[test]
fn test_support_target() {
let args = &["--target".into(), "x86_64-unknown-linux-gnu".into()];
let clang = support::Clang::find(None, args).unwrap();
println!("{:?}", clang);
}

#[cfg(feature = "support")]
#[cfg(feature = "runtime")]
#[test]
fn test_support_runtime() {
Expand Down