mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-08 06:00:33 +02:00
cmake, lint: Adjust lint_includes_build_config
This commit is contained in:
parent
3885441ee0
commit
c360837ca5
@ -318,20 +318,14 @@ Please add any false positives, such as subtrees, or externally sourced files to
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn lint_includes_build_config() -> LintResult {
|
fn lint_includes_build_config() -> LintResult {
|
||||||
let config_path = "./src/config/bitcoin-config.h.in";
|
let config_path = "./cmake/bitcoin-config.h.in";
|
||||||
if !Path::new(config_path).is_file() {
|
|
||||||
assert!(Command::new("./autogen.sh")
|
|
||||||
.status()
|
|
||||||
.expect("command error")
|
|
||||||
.success());
|
|
||||||
}
|
|
||||||
let defines_regex = format!(
|
let defines_regex = format!(
|
||||||
r"^\s*(?!//).*({})",
|
r"^\s*(?!//).*({})",
|
||||||
check_output(Command::new("grep").args(["undef ", "--", config_path]))
|
check_output(Command::new("grep").args(["define", "--", config_path]))
|
||||||
.expect("grep failed")
|
.expect("grep failed")
|
||||||
.lines()
|
.lines()
|
||||||
.map(|line| {
|
.map(|line| {
|
||||||
line.split("undef ")
|
line.split_whitespace()
|
||||||
.nth(1)
|
.nth(1)
|
||||||
.unwrap_or_else(|| panic!("Could not extract name in line: {line}"))
|
.unwrap_or_else(|| panic!("Could not extract name in line: {line}"))
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user