3 # Only set up `DEVELOPER_DIR` if a default darwin min version is set,
4 # which is a signal that we're targetting darwin.
5 if [[ "@darwinMinVersion@" ]]; then
6 # `DEVELOPER_DIR` is used to dynamically locate libSystem (and the SDK frameworks) based on the SDK at that path.
7 mangleVarSingle DEVELOPER_DIR
${role_suffixes[@]+"${role_suffixes[@]}"}
9 # Allow wrapped compilers to do something useful when no `DEVELOPER_DIR` is set, which can happen when
10 # the compiler is run outside of a stdenv or intentionally in an environment with no environment variables set.
11 export DEVELOPER_DIR
=${DEVELOPER_DIR_@suffixSalt@:-@fallback_sdk@}
13 # xcbuild needs `SDKROOT` to be the name of the SDK, which it sets in its own wrapper,
14 # but compilers expect it to point to the absolute path.
15 export SDKROOT
="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"