mirror of
https://github.com/mirror/tinycc.git
synced 2025-04-01 12:30:08 +08:00
add -isystem cmdline option
This commit is contained in:
parent
b88677454b
commit
e939c4072c
2
libtcc.c
2
libtcc.c
@ -1274,7 +1274,7 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type)
|
|||||||
|
|
||||||
if (!s->nostdinc) {
|
if (!s->nostdinc) {
|
||||||
/* default include paths */
|
/* default include paths */
|
||||||
/* XXX: reverse order needed if -isystem support */
|
/* -isystem paths have already been handled */
|
||||||
#ifndef TCC_TARGET_PE
|
#ifndef TCC_TARGET_PE
|
||||||
tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/local/include");
|
tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/local/include");
|
||||||
tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/include");
|
tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/include");
|
||||||
|
5
tcc.c
5
tcc.c
@ -111,6 +111,7 @@ enum {
|
|||||||
TCC_OPTION_O,
|
TCC_OPTION_O,
|
||||||
TCC_OPTION_m,
|
TCC_OPTION_m,
|
||||||
TCC_OPTION_f,
|
TCC_OPTION_f,
|
||||||
|
TCC_OPTION_isystem,
|
||||||
TCC_OPTION_nostdinc,
|
TCC_OPTION_nostdinc,
|
||||||
TCC_OPTION_nostdlib,
|
TCC_OPTION_nostdlib,
|
||||||
TCC_OPTION_print_search_dirs,
|
TCC_OPTION_print_search_dirs,
|
||||||
@ -161,6 +162,7 @@ static const TCCOption tcc_options[] = {
|
|||||||
{ "O", TCC_OPTION_O, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
|
{ "O", TCC_OPTION_O, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
|
||||||
{ "m", TCC_OPTION_m, TCC_OPTION_HAS_ARG },
|
{ "m", TCC_OPTION_m, TCC_OPTION_HAS_ARG },
|
||||||
{ "f", TCC_OPTION_f, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
|
{ "f", TCC_OPTION_f, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
|
||||||
|
{ "isystem", TCC_OPTION_isystem, TCC_OPTION_HAS_ARG },
|
||||||
{ "nostdinc", TCC_OPTION_nostdinc, 0 },
|
{ "nostdinc", TCC_OPTION_nostdinc, 0 },
|
||||||
{ "nostdlib", TCC_OPTION_nostdlib, 0 },
|
{ "nostdlib", TCC_OPTION_nostdlib, 0 },
|
||||||
{ "print-search-dirs", TCC_OPTION_print_search_dirs, 0 },
|
{ "print-search-dirs", TCC_OPTION_print_search_dirs, 0 },
|
||||||
@ -425,6 +427,9 @@ static int parse_args(TCCState *s, int argc, char **argv)
|
|||||||
reloc_output = 1;
|
reloc_output = 1;
|
||||||
output_type = TCC_OUTPUT_OBJ;
|
output_type = TCC_OUTPUT_OBJ;
|
||||||
break;
|
break;
|
||||||
|
case TCC_OPTION_isystem:
|
||||||
|
tcc_add_sysinclude_path(s, optarg);
|
||||||
|
break;
|
||||||
case TCC_OPTION_nostdinc:
|
case TCC_OPTION_nostdinc:
|
||||||
s->nostdinc = 1;
|
s->nostdinc = 1;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user