Skip to content

Commit

Permalink
update gcc debug compile option for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
injae committed Jan 1, 2024
1 parent 5a07289 commit fd26354
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cppm_cxx_standard(17)
cppm_compiler_option(
DEBUG
CLANG "-fprofile-instr-generate -fcoverage-mapping"
GCC "-fprofile-arcs -ftest-coverage"
GCC "--coverage -fno-inline -fno-inline-small-functions -fno-default-inline"
)

find_cppkg(benchmark 1.5.2 MODULE benchmark::benchmark TYPE lib OPTIONAL OFF)
Expand Down
34 changes: 34 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# in flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
overlays = [];
pkgs = import nixpkgs {
inherit system overlays;
};
in
with pkgs;
{
devShells.default = mkShell {
nativeBuildInputs = [
#llvmPackages_17.stdenv
gcc13Stdenv
ccache
cmake
ninja
lcov
];
shellHook = ''
export CC=gcc
export CXX=g++
'';
};
}
);
}

0 comments on commit fd26354

Please sign in to comment.