pub enum SdkSearchLocation {
SdkRootEnv,
DeveloperDirEnv,
SystemXcode,
CommandLineTools,
XcodeSelectPaths,
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.
XcodeSelectPaths
Check the paths configured by xcode-select --switch
.
This effectively controls whether the Developer Directory resolved by DeveloperDirectory::from_xcode_select_paths() will be searched, 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§
Source§impl Clone for SdkSearchLocation
impl Clone for SdkSearchLocation
Source§fn clone(&self) -> SdkSearchLocation
fn clone(&self) -> SdkSearchLocation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more