Skip to content

Commit

Permalink
Eliminate the remainder of dead C code
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Jan 24, 2025
1 parent f2d89b1 commit e722903
Show file tree
Hide file tree
Showing 57 changed files with 305 additions and 34,627 deletions.
56 changes: 0 additions & 56 deletions c_components/.clion.codestyle.xml

This file was deleted.

129 changes: 0 additions & 129 deletions c_components/CMakeLists.txt

This file was deleted.

18 changes: 2 additions & 16 deletions c_components/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,13 @@ fn main() {
cc.flag("-Wc++-compat");
}

// Step 6: Feature flags (c_rendering) for conditional compilation
// Goal: Include or skip certain source files based on the feature set.
#[cfg(feature = "c_rendering")]
{
cc.define("C_RENDERING", Some("1"));
}

// Step 7: Gather source files, conditionally excluding graphics.c if not c_rendering
// Goal: Add each .c file to the build, except for the optional skip.
let skipped = PathBuf::from("lib/graphics.c");
for file in glob::glob("lib/*.c").unwrap() {
let path = file.unwrap();
if path != skipped || cfg!(feature = "c_rendering") {
cc.file(path);
}
cc.file(path);

}

// Step 8: Optional coverage and profiling flags
Expand All @@ -112,12 +104,6 @@ fn main() {
cc.opt_level(0);
}

if cfg!(feature = "profiling") {
cc.flag("-pg");
cc.file("tests/profile_imageflow.c");
cc.file("tests/helpers.c");
}

// Step 9: Compile the library
// Goal: Produce the final static library.
cc.compile("imageflow_c");
Expand Down
Loading

0 comments on commit e722903

Please sign in to comment.