pub enum SdkSearchLocation {
    SdkRootEnv,
    DeveloperDirEnv,
    SystemXcode,
    CommandLineTools,
    XcodeSelect,
    SystemXcodes,
    Developer(DeveloperDirectory),
    Sdks(PathBuf),
    Sdk(PathBuf),
}
Expand description

Represents a location to search for SDKs.

Variants§

§

SdkRootEnv

Use the path specified by the SDKROOT environment variable.

If this environment variable is defined and the path is not valid, an error occurs.

An SDK yielded from this location skips search filtering. This is because the semantic intent of the SDKROOT environment variable is to force usage of a specific SDK.

If this location yields an SDK, the SDK search will be aborted and subsequent locations will not be searched. This effectively honors the intent of SDKROOT to force usage of a given SDK.

If this behavior is not desirable, construct an SdkSearch with a SdkSearchLocation::Sdk using the value of SDKROOT.

§

DeveloperDirEnv

Use the Developer Directory specified by the DEVELOPER_DIR environment variable.

If this environment variable is defined and the path is not valid, an error occurs.

If this location yields an SDK, the SDK search will be aborted and subsequent locations will not be searched. This effectively honors the intent of DEVELOPER_DIR to explicitly define a developer directory to use for SDK searching.

If this behavior is not desirable, construct an SdkSearch with a SdkSearchLocation::Developer using the value of DEVELOPER_DIR.

§

SystemXcode

Look for SDKs within the system installed Xcode application.

This effectively controls whether the Developer Directory resolved by DeveloperDirectory::default_xcode() will be searched, if available.

§

CommandLineTools

Look for SDKs within the system install Xcode Command Line Tools installation.

This effectively uses the directory returned by command_line_tools_sdks_directory(), if available.

§

XcodeSelect

Invoke xcode-select to find a Developer Directory to search.

This mechanism is intended as a fallback in case other (pure Rust) mechanisms for locating the default Developer Directory fail. If you find yourself needing this, it likely points to a gap in our feature coverage to locate the default Developer Directory without running external tools. Consider filing a bug against this crate to track closing the feature gap.

§

SystemXcodes

Look for SDKs within all system installed Xcode applications.

This effectively controls whether the paths resolved by DeveloperDirectory::find_system_xcodes() will be searched, if present.

Many macOS systems only have a single Xcode application at /Applications/Xcode.app. However, environments like CI workers and developers having beta versions of Xcode installed may have multiple versions of Xcode available. This option can enable multiple copies of Xcode to be used.

§

Developer(DeveloperDirectory)

Use an explicit Developer Directory.

This can be used to point a search at a non-standard location holding a Developer Directory. A common use case for this is when cross-compiling or using hermetic / chroot / container build environments that don’t resemble a common macOS system layout and therefore prohibit use of mechanisms for locating a Developer Directory in default locations.

§

Sdks(PathBuf)

Use an explicit directory holding SDKs.

This is similar to Self::Developer with regards to its intended use cases. The difference is the path is a directory holding *.sdk directories, not a Developer Directory.

§

Sdk(PathBuf)

Use an explicit directory holding an SDK.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.