Try to consume a -I or -isystem include path flag. Returns true if consumed. */
| 79 | |
| 80 | /* Try to consume a -I or -isystem include path flag. Returns true if consumed. */ |
| 81 | static bool try_include_flag(cbm_compile_flags_t *f, const char **args, int argc, int *i, |
| 82 | const char *directory) { |
| 83 | const char *arg = args[*i]; |
| 84 | if (arg[0] == '-' && arg[CC_FLAG_IDX] == 'I') { |
| 85 | const char *path = arg + CC_FLAG_SKIP; |
| 86 | if (*path == '\0' && *i + SKIP_ONE < argc) { |
| 87 | (*i)++; |
| 88 | path = args[*i]; |
| 89 | } |
| 90 | if (path && *path) { |
| 91 | f->include_paths[f->include_count++] = resolve_path(path, directory); |
| 92 | } |
| 93 | return true; |
| 94 | } |
| 95 | if (strcmp(arg, "-isystem") == 0 && *i + SKIP_ONE < argc) { |
| 96 | (*i)++; |
| 97 | f->include_paths[f->include_count++] = resolve_path(args[*i], directory); |
| 98 | return true; |
| 99 | } |
| 100 | return false; |
| 101 | } |
| 102 | |
| 103 | /* Try to consume a -D define flag. Returns true if consumed. */ |
| 104 | static bool try_define_flag(cbm_compile_flags_t *f, const char **args, int argc, int *i) { |
no test coverage detected