pub enum Origin {
User,
Compiler,
Sysroot,
Sdk,
Bundled,
Kernel,
Host,
}Expand description
Which of section 8.5’s four steps put a directory in the list.
Carried rather than discarded because -print-search-dirs has to say it, because a user
debugging a wrong header needs to know which rule chose it, and because the test that no host
directory appears in a cross build is written against this rather than against path spelling.
Variants§
User
Step 1. A -I the user gave, in the position they gave it.
Compiler
Step 2. The compiler’s own headers, which describe the compiler rather than the platform.
Sysroot
Step 3, taken from a --sysroot or -isysroot the user named.
Sdk
Step 3, taken from an Apple SDK installed on this machine.
Separate from Origin::Sysroot because nobody named it, and separate from
Origin::Host because what is in it is the target’s headers and not this machine’s: one
SDK holds every Apple architecture. A user who sees this in -print-search-dirs is being
told that the path came from Xcode rather than from their command line.
Bundled
Step 3, taken from the tree we bundle for this target.
Kernel
Step 3, taken from the kernel header tree, which is bundled too and is not the libc’s.
Separate from Origin::Bundled because the two trees have different owners, different
licences and different producers, and a user looking at where linux/stat.h came from is
asking about the kernel and not about glibc.
Host
Step 3, taken from the host, which is legal only when the target is the host.