File: generate-swift-availability-macros

package info (click to toggle)
webkit2gtk 2.49.90-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 445,664 kB
  • sloc: cpp: 3,797,881; javascript: 197,914; ansic: 161,337; python: 49,141; asm: 21,979; ruby: 18,539; perl: 16,723; xml: 4,623; yacc: 2,360; sh: 2,246; java: 2,019; lex: 1,327; pascal: 366; makefile: 295
file content (38 lines) | stat: -rwxr-xr-x 1,977 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

for search_path in "${BUILT_PRODUCTS_DIR}" "${SDKROOT}"; do
    candidate="${search_path}/usr/local/include/WebKitAdditions/Scripts/postprocess-framework-headers-definitions"
    test -f "${candidate}" && source "${candidate}" && break
done

# The WebKitAdditions code above may set a platform-specific _VERSION variable.
# If it didn't, use the current deployment target version. The fallback
# versions for other platforms are not knowable. Set them to the same 9999
# placeholder that the swift stdlib uses.

if [[ "${WK_PLATFORM_NAME}" == "macosx" ]]; then
    [[ -n ${OSX_VERSION} ]] || OSX_VERSION=${MACOSX_DEPLOYMENT_TARGET}
    [[ -n ${XROS_VERSION} ]] || XROS_VERSION="9999"
    [[ -n ${IOS_VERSION} ]] || IOS_VERSION="9999"
elif [[ "${WK_PLATFORM_NAME}" == "maccatalyst" ]]; then
    # On Mac Catalyst `LLVM_TARGET_TRIPLE_OS_VERSION` will be in the format `ios{major}.{minor}`.
    [[ -n ${IOS_VERSION} ]] || IOS_VERSION=${LLVM_TARGET_TRIPLE_OS_VERSION#ios}
    [[ -n ${XROS_VERSION} ]] || XROS_VERSION="9999"
    [[ -n ${OSX_VERSION} ]] || OSX_VERSION="9999"
elif [[ "${WK_PLATFORM_NAME}" =~ "iphone" ]]; then
    [[ -n ${IOS_VERSION} ]] || IOS_VERSION=${IPHONEOS_DEPLOYMENT_TARGET}
    [[ -n ${XROS_VERSION} ]] || XROS_VERSION="9999"
    [[ -n ${OSX_VERSION} ]] || OSX_VERSION="9999"
elif [[ "${PLATFORM_NAME}" == xr* ]]; then
    [[ -n ${XROS_VERSION} ]] || XROS_VERSION=${XROS_DEPLOYMENT_TARGET}
    [[ -n ${IOS_VERSION} ]] || IOS_VERSION="9999"
    [[ -n ${OSX_VERSION} ]] || OSX_VERSION="9999"
else
    [[ -n ${OSX_VERSION} ]] || OSX_VERSION="9999"
    [[ -n ${XROS_VERSION} ]] || XROS_VERSION="9999"
    [[ -n ${IOS_VERSION} ]] || IOS_VERSION="9999"
fi

echo "-Xfrontend -define-availability -Xfrontend \"WK_IOS_TBA:iOS ${IOS_VERSION}\"" \
    "-Xfrontend -define-availability -Xfrontend \"WK_MAC_TBA:macOS ${OSX_VERSION}\"" \
    "-Xfrontend -define-availability -Xfrontend \"WK_XROS_TBA:visionOS ${XROS_VERSION}\"" | tee "${SCRIPT_OUTPUT_FILE_0}"