fix: set the sdk to macosx

This commit is contained in:
Amin Yahyaabadi 2021-09-16 02:57:20 -05:00
parent 16b25286f9
commit 7fdcafd805
1 changed files with 5 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin
import { extractExe, extractTarByExe } from "../utils/setup/extract" import { extractExe, extractTarByExe } from "../utils/setup/extract"
import { getSpecificVersionAndUrl, getVersions } from "../utils/setup/version" import { getSpecificVersionAndUrl, getVersions } from "../utils/setup/version"
import { getExecOutput } from "@actions/exec" import { getExecOutput } from "@actions/exec"
import { existsSync } from "fs"
//================================================ //================================================
// Version // Version
@ -268,9 +269,11 @@ export async function setupLLVM(version: string, directoryGiven?: string): Promi
if (process.platform === "darwin") { if (process.platform === "darwin") {
try { try {
const xcrun = await getExecOutput("xcrun --sdk macos --show-sdk-path") const xcrun = await getExecOutput("xcrun --sdk macosx --show-sdk-path")
const sdkroot = xcrun.stdout || xcrun.stderr const sdkroot = xcrun.stdout || xcrun.stderr
if (existsSync(sdkroot)) {
core.exportVariable("SDKROOT", sdkroot) core.exportVariable("SDKROOT", sdkroot)
}
} catch (e) { } catch (e) {
core.error(e as Error | string) core.error(e as Error | string)
} }