File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -126,20 +126,20 @@ void fstk_SetPreIncludeFile(std::string const &path) {
126126 // LCOV_EXCL_STOP
127127}
128128
129+ static bool isValidFilePath (std::string const &path) {
130+ struct stat statBuf;
131+ return stat (path.c_str (), &statBuf) == 0 && !S_ISDIR (statBuf.st_mode ); // Reject directories
132+ }
133+
129134static void printDep (std::string const &path) {
130135 if (dependFile) {
131136 fprintf (dependFile, " %s: %s\n " , targetFileName.c_str (), path.c_str ());
132- if (generatePhonyDeps) {
137+ if (generatePhonyDeps && isValidFilePath (path) ) {
133138 fprintf (dependFile, " %s:\n " , path.c_str ());
134139 }
135140 }
136141}
137142
138- static bool isValidFilePath (std::string const &path) {
139- struct stat statBuf;
140- return stat (path.c_str (), &statBuf) == 0 && !S_ISDIR (statBuf.st_mode ); // Reject directories
141- }
142-
143143std::optional<std::string> fstk_FindFile (std::string const &path) {
144144 for (std::string &incPath : includePaths) {
145145 if (std::string fullPath = incPath + path; isValidFilePath (fullPath)) {
You can’t perform that action at this time.
0 commit comments