Polyman Documentation - v3.0.0
    Preparing search index...

    Function scanDependencies

    • Finds every local header a source reaches through #include "...", following includes recursively. Each include is looked up in the including file's directory first and then in includeDirs, mirroring g++ with -iquote. Angle-bracket includes are system headers and are covered by the compiler identity instead.

      The scan is textual: includes inside #if blocks or comments are counted too, which can only cause an unnecessary recompile, never a stale binary.

      Parameters

      • sourcePath: string

        Absolute path of the source file

      • includeDirs: string[]

        Extra quoted-include search directories

      Returns Record<string, string | null>

      Dependency (relative to the problem directory, or the include spelling when it did not resolve) → SHA-256 of its contents, or null when it did not resolve

      scanDependencies('/p/generators/gen.cpp', ['/p']);
      // { 'testlib.h': 'a3f1...' }