-1

How to add a path compiler search path? I do not mean-I options. I want to add path permanently to compiler search paths. Is there a file where compiler has saved search paths? I would like to add the path to the header so that the compiler always searching this folder every time I run the build. I am using Fedora 20.

sweet_sugar
  • 1,390
  • 3
  • 13
  • 22
  • 2
    `--with-local-prefix` is the gcc configuration option, clang tends to use the same options. You will have recompile clang. The `CPATH` environment variable can be used if you don't want to recompile. – user657267 Oct 19 '14 at 12:02
  • if you simply would like to *add* some paths, a dirty way will be export CPLUS_INCLUDE_PATH/C_INCLUDE_PATH(write into your shell profile if needed); if you would like to *change* the default headers, might also consider `-system-header-prefix`/` -nostdinc++`/`-isystem` and their friends. you can verify by using `clang -E -x c /dev/null -v`. – Hongxu Chen Oct 22 '14 at 17:42

1 Answers1

0

According to the detected/specified triple and language, clang searches for built-in additional default include paths in the following routine

void InitHeaderSearch::AddDefaultIncludePaths(const LangOptions &Lang,
                                          const llvm::Triple &triple,
                                        const HeaderSearchOptions &HSOpts)

Take a look at the source code here. That's your spot.

Marco A.
  • 43,032
  • 26
  • 132
  • 246