Skip to main content

find_sources

Function find_sources 

Source
fn find_sources(
    src_dir: &Path,
    makevars: &Makevars,
) -> Result<Vec<PathBuf>, String>
Expand description

Find C and C++ source files to compile.

Collects sources from:

  1. OBJECTS variable (if set) — explicit list
  2. Other variables ending in .o — bundled library object files
  3. Fallback: all src/*.{c,cpp,cc,cxx} files

For bundled libraries (jsonlite/yajl, commonmark/cmark, etc.), the Makevars defines variables like LIBYAJL = yajl/yajl.o yajl/yajl_alloc.o .... We collect ALL .o references, resolve them to source files, and compile everything into one shared library (no static archive intermediate).