Fix bug with nested / moduled c files not compiling #30

Merged
sfrembling merged 1 commits from working/#29 into main 2026-03-23 20:09:19 -06:00

View File

@@ -482,7 +482,7 @@ fn gen_compile_commands(mode: &Option<String>) -> std::io::Result<()> {
let cwd = std::env::current_dir()?;
let obj_dir = format!("target/{}/obj", build_config.name);
let source_files: Vec<PathBuf> = glob("src/*.c")
let source_files: Vec<PathBuf> = glob("src/**/*.c")
.map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))?
.filter_map(|e| e.ok())
.collect();
@@ -665,7 +665,7 @@ fn build(mode: &Option<String>, force_recompile: bool) -> std::io::Result<()> {
.collect();
}
let source_files: Vec<PathBuf> = glob("src/*.c")
let source_files: Vec<PathBuf> = glob("src/**/*.c")
.map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))?
.filter_map(|e| e.ok())
.collect();
@@ -814,7 +814,7 @@ fn clean() -> std::io::Result<()> {
}
fn fmt() -> std::io::Result<()> {
let source_files: Vec<PathBuf> = glob("src/*.c")
let source_files: Vec<PathBuf> = glob("src/**/*.c")
.map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))?
.chain(
glob("src/*.h")
@@ -846,7 +846,7 @@ fn fmt() -> std::io::Result<()> {
fn lint() -> std::io::Result<()> {
gen_compile_commands(&None)?;
let source_files: Vec<PathBuf> = glob("src/*.c")
let source_files: Vec<PathBuf> = glob("src/**/*.c")
.map_err(|e| std::io::Error::new(std::io::ErrorKind::NotFound, format!("{e}")))?
.filter_map(|e| e.ok())
.collect();