setup-cpp/src/macos-sdk/macos-sdk.ts

19 lines
501 B
TypeScript
Raw Normal View History

2021-11-22 01:06:16 +08:00
import { getExecOutput } from "@actions/exec"
import * as core from "@actions/core"
export async function setupMacOSSDK() {
if (process.platform === "darwin") {
try {
const xcrun = await getExecOutput("xcrun --sdk macosx --show-sdk-path")
const sdkroot = xcrun.stdout || xcrun.stderr
2021-12-11 19:46:00 +08:00
if (sdkroot) {
2021-11-22 01:06:16 +08:00
core.exportVariable("SDKROOT", sdkroot)
2021-12-11 19:46:00 +08:00
} else {
core.error(`SDKROOT not set`)
2021-11-22 01:06:16 +08:00
}
} catch (e) {
core.error(e as Error | string)
}
}
}