fix: fix the quoting of CPPFLAGS and LDFLAGS for pwsh

This commit is contained in:
Amin Yahyaabadi 2022-05-12 17:31:41 -07:00
parent c6a8977164
commit a4e2df0c28
4 changed files with 6 additions and 6 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -317,8 +317,8 @@ export async function activateLLVM(directory: string, versionGiven: string) {
} }
} }
await addEnv("LDFLAGS", `-L"${directory}/lib"`) await addEnv("LDFLAGS", `-L'${directory}/lib'`)
await addEnv("CPPFLAGS", `-I"${directory}/include"`) await addEnv("CPPFLAGS", `-I'${directory}/include'`)
await addEnv("CC", `${directory}/bin/clang`) await addEnv("CC", `${directory}/bin/clang`)
await addEnv("CXX", `${directory}/bin/clang++`) await addEnv("CXX", `${directory}/bin/clang++`)

View File

@ -55,14 +55,14 @@ async function addEnvSystem(name: string, valGiven: string | undefined) {
case "win32": { case "win32": {
// We do not use `execa.sync(`setx PATH "${path};%PATH%"`)` because of its character limit // We do not use `execa.sync(`setx PATH "${path};%PATH%"`)` because of its character limit
await execPowershell(`[Environment]::SetEnvironmentVariable("${name}", "${val}", "User")`) await execPowershell(`[Environment]::SetEnvironmentVariable("${name}", "${val}", "User")`)
info(`${name}="${val} was set in the environment."`) info(`${name}="${val}" was set in the environment.`)
return return
} }
case "linux": case "linux":
case "darwin": { case "darwin": {
setupCppInProfile() setupCppInProfile()
appendFileSync(cpprc_path, `\nexport ${name}="${val}"\n`) appendFileSync(cpprc_path, `\nexport ${name}="${val}"\n`)
info(`${name}="${val} was added to "${cpprc_path}"`) info(`${name}="${val}" was added to "${cpprc_path}`)
return return
} }
default: { default: {