mirror of https://github.com/aminya/setup-cpp
feat: add Gcov environment variables
This commit is contained in:
parent
8c9d48b9aa
commit
e2bc9743a3
|
@ -34,6 +34,7 @@ words:
|
||||||
- esmodule
|
- esmodule
|
||||||
- execa
|
- execa
|
||||||
- ftxui
|
- ftxui
|
||||||
|
- GCOV
|
||||||
- gcovr
|
- gcovr
|
||||||
- ghes
|
- ghes
|
||||||
- Graphviz
|
- Graphviz
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,21 @@
|
||||||
|
import { addEnv } from "../utils/env/addEnv"
|
||||||
import { setupPipPack } from "../utils/setup/setupPipPack"
|
import { setupPipPack } from "../utils/setup/setupPipPack"
|
||||||
|
import semverValid from "semver/functions/valid"
|
||||||
|
import semverMajor from "semver/functions/major"
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
export function setupGcovr(version: string | undefined, _setupDir: string, _arch: string) {
|
export function setupGcovr(version: string | undefined, _setupDir: string, _arch: string) {
|
||||||
return setupPipPack("gcovr", version)
|
return setupPipPack("gcovr", version)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function activateGcovLLVM() {
|
||||||
|
return addEnv("GCOV", "llvm-cov gcov")
|
||||||
|
}
|
||||||
|
|
||||||
|
export function activateGcovGCC(gccVersion: string) {
|
||||||
|
const gccSemver = semverValid(gccVersion)
|
||||||
|
const gccMajor = gccSemver !== null ? semverMajor(gccSemver) : gccVersion
|
||||||
|
const gcov = gccMajor !== "" ? `gcov-${gccMajor}` : "gcov"
|
||||||
|
|
||||||
|
return addEnv("GCOV", gcov)
|
||||||
|
}
|
||||||
|
|
10
src/main.ts
10
src/main.ts
|
@ -8,7 +8,7 @@ import { setupCmake } from "./cmake/cmake"
|
||||||
import { setupConan } from "./conan/conan"
|
import { setupConan } from "./conan/conan"
|
||||||
import { setupCppcheck } from "./cppcheck/cppcheck"
|
import { setupCppcheck } from "./cppcheck/cppcheck"
|
||||||
import { setupDoxygen } from "./doxygen/doxygen"
|
import { setupDoxygen } from "./doxygen/doxygen"
|
||||||
import { setupGcovr } from "./gcovr/gcovr"
|
import { activateGcovGCC, activateGcovLLVM, setupGcovr } from "./gcovr/gcovr"
|
||||||
import { setupLLVM, setupClangTools } from "./llvm/llvm"
|
import { setupLLVM, setupClangTools } from "./llvm/llvm"
|
||||||
import { setupMeson } from "./meson/meson"
|
import { setupMeson } from "./meson/meson"
|
||||||
import { setupMSVC } from "./msvc/msvc"
|
import { setupMSVC } from "./msvc/msvc"
|
||||||
|
@ -201,6 +201,9 @@ export async function main(args: string[]): Promise<number> {
|
||||||
join(setupCppDir, "llvm"),
|
join(setupCppDir, "llvm"),
|
||||||
arch
|
arch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
await activateGcovLLVM()
|
||||||
|
|
||||||
successMessages.push(getSuccessMessage("llvm", installationInfo))
|
successMessages.push(getSuccessMessage("llvm", installationInfo))
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -208,13 +211,16 @@ export async function main(args: string[]): Promise<number> {
|
||||||
case "mingw":
|
case "mingw":
|
||||||
case "cygwin":
|
case "cygwin":
|
||||||
case "msys": {
|
case "msys": {
|
||||||
const installationInfo = await setupGcc(getVersion("gcc", version, osVersion), join(setupCppDir, "gcc"), arch)
|
const gccVersion = getVersion("gcc", version, osVersion)
|
||||||
|
const installationInfo = await setupGcc(gccVersion, join(setupCppDir, "gcc"), arch)
|
||||||
|
|
||||||
if (hasLLVM) {
|
if (hasLLVM) {
|
||||||
// remove the CPPFLAGS of LLVM that include the LLVM headers
|
// remove the CPPFLAGS of LLVM that include the LLVM headers
|
||||||
await addEnv("CPPFLAGS", "")
|
await addEnv("CPPFLAGS", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await activateGcovGCC(gccVersion)
|
||||||
|
|
||||||
successMessages.push(getSuccessMessage("gcc", installationInfo))
|
successMessages.push(getSuccessMessage("gcc", installationInfo))
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue