mirror of https://github.com/aminya/setup-cpp
Merge pull request #142 from aminya/gcov [skip ci]
This commit is contained in:
commit
b82e63f041
|
@ -34,6 +34,7 @@ words:
|
|||
- esmodule
|
||||
- execa
|
||||
- ftxui
|
||||
- GCOV
|
||||
- gcovr
|
||||
- ghes
|
||||
- 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 semverValid from "semver/functions/valid"
|
||||
import semverMajor from "semver/functions/major"
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export function setupGcovr(version: string | undefined, _setupDir: string, _arch: string) {
|
||||
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 { setupCppcheck } from "./cppcheck/cppcheck"
|
||||
import { setupDoxygen } from "./doxygen/doxygen"
|
||||
import { setupGcovr } from "./gcovr/gcovr"
|
||||
import { activateGcovGCC, activateGcovLLVM, setupGcovr } from "./gcovr/gcovr"
|
||||
import { setupLLVM, setupClangTools } from "./llvm/llvm"
|
||||
import { setupMeson } from "./meson/meson"
|
||||
import { setupMSVC } from "./msvc/msvc"
|
||||
|
@ -201,6 +201,9 @@ export async function main(args: string[]): Promise<number> {
|
|||
join(setupCppDir, "llvm"),
|
||||
arch
|
||||
)
|
||||
|
||||
await activateGcovLLVM()
|
||||
|
||||
successMessages.push(getSuccessMessage("llvm", installationInfo))
|
||||
break
|
||||
}
|
||||
|
@ -208,13 +211,16 @@ export async function main(args: string[]): Promise<number> {
|
|||
case "mingw":
|
||||
case "cygwin":
|
||||
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) {
|
||||
// remove the CPPFLAGS of LLVM that include the LLVM headers
|
||||
await addEnv("CPPFLAGS", "")
|
||||
}
|
||||
|
||||
await activateGcovGCC(gccVersion)
|
||||
|
||||
successMessages.push(getSuccessMessage("gcc", installationInfo))
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue