History

add -isystem cmdline option

Joe Soroka committed 15 years ago

Commit e939c401 parent b8867742 files · +6 −1Browse files

Unified · Split

2 files
  1. libtcc.c +1 −1
  2. tcc.c +5 −0
libtcc.c+1−1
@@ -1274,7 +1274,7 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) · 1273 unmodified lines
12741274
12751275 if (!s->nostdinc) {
12761276 /* default include paths */
1277− /* XXX: reverse order needed if -isystem support */
1277+ /* -isystem paths have already been handled */
12781278 #ifndef TCC_TARGET_PE
12791279 tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/local/include");
12801280 tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/include");
tcc.c+5−0
@@ -111,6 +111,7 @@ enum { · 110 unmodified lines
111111 TCC_OPTION_O,
112112 TCC_OPTION_m,
113113 TCC_OPTION_f,
114+ TCC_OPTION_isystem,
114115 TCC_OPTION_nostdinc,
115116 TCC_OPTION_nostdlib,
116117 TCC_OPTION_print_search_dirs,
@@ -161,6 +162,7 @@ static const TCCOption tcc_options[] = { · 44 unmodified lines
161162 { "O", TCC_OPTION_O, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
162163 { "m", TCC_OPTION_m, TCC_OPTION_HAS_ARG },
163164 { "f", TCC_OPTION_f, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
165+ { "isystem", TCC_OPTION_isystem, TCC_OPTION_HAS_ARG },
164166 { "nostdinc", TCC_OPTION_nostdinc, 0 },
165167 { "nostdlib", TCC_OPTION_nostdlib, 0 },
166168 { "print-search-dirs", TCC_OPTION_print_search_dirs, 0 },
@@ -425,6 +427,9 @@ static int parse_args(TCCState *s, int argc, char **argv) · 258 unmodified lines
425427 reloc_output = 1;
426428 output_type = TCC_OUTPUT_OBJ;
427429 break;
430+ case TCC_OPTION_isystem:
431+ tcc_add_sysinclude_path(s, optarg);
432+ break;
428433 case TCC_OPTION_nostdinc:
429434 s->nostdinc = 1;
430435 break;