MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / findIncludeFile

Function findIncludeFile

src/parseTools.mjs:80–96  ·  view source on GitHub ↗
(filename, currentDir)

Source from the content-addressed store, hash-verified

78}
79
80function findIncludeFile(filename, currentDir) {
81 if (path.isAbsolute(filename)) {
82 return existsSync(filename) ? filename : null;
83 }
84
85 // Search for include files either relative to the including file,
86 // or in the src root directory.
87 const includePath = [currentDir, srcDir];
88 for (const p of includePath) {
89 const f = path.join(p, filename);
90 if (existsSync(f)) {
91 return f;
92 }
93 }
94
95 return null;
96}
97
98// Simple #if/else/endif preprocessing for a file. Checks if the
99// ident checked is true in our global.

Callers 1

preprocessFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected