feat!: remove C++ support for external scanners
This commit is contained in:
parent
fd190f1d9d
commit
9301d38b77
2 changed files with 7 additions and 33 deletions
|
|
@ -609,15 +609,10 @@ impl Loader {
|
|||
.host(BUILD_HOST)
|
||||
.debug(self.debug_build)
|
||||
.file(&config.parser_path)
|
||||
.includes(&config.header_paths);
|
||||
.includes(&config.header_paths)
|
||||
.std("c11");
|
||||
|
||||
if let Some(scanner_path) = config.scanner_path.as_ref() {
|
||||
if scanner_path.extension() != Some("c".as_ref()) {
|
||||
cc_config.cpp(true);
|
||||
eprintln!("Warning: Using a C++ scanner is now deprecated. Please migrate your scanner code to C, as C++ support will be removed in the near future.");
|
||||
} else {
|
||||
cc_config.std("c11");
|
||||
}
|
||||
cc_config.file(scanner_path);
|
||||
}
|
||||
|
||||
|
|
@ -882,14 +877,6 @@ impl Loader {
|
|||
]);
|
||||
|
||||
if let Some(scanner_filename) = scanner_filename {
|
||||
if scanner_filename
|
||||
.extension()
|
||||
.and_then(|ext| ext.to_str())
|
||||
.map_or(false, |ext| ["cc", "cpp"].contains(&ext))
|
||||
{
|
||||
eprintln!("Warning: Using a C++ scanner is now deprecated. Please migrate your scanner code to C, as C++ support will be removed in the near future.");
|
||||
command.arg("-xc++");
|
||||
}
|
||||
command.arg(scanner_filename);
|
||||
}
|
||||
|
||||
|
|
@ -1204,14 +1191,8 @@ impl Loader {
|
|||
|
||||
#[must_use]
|
||||
pub fn get_scanner_path(&self, src_path: &Path) -> Option<PathBuf> {
|
||||
let mut path = src_path.join("scanner.c");
|
||||
for extension in ["c", "cc", "cpp"] {
|
||||
path.set_extension(extension);
|
||||
if path.exists() {
|
||||
return Some(path);
|
||||
}
|
||||
}
|
||||
None
|
||||
let path = src_path.join("scanner.c");
|
||||
path.exists().then_some(path)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue