Only add coverage flags when gcno file is expected
Change refactored the coverage feature, but wrongly started
add coverage flags when the gcno file was not expected/read by bazel. This
can be harmful, since the size of inputs increases unnecessarily.
RELNOTES: None.
@@ -779,7 +779,6 @@ public class CppActionConfigs {
" flag_group {",
" flag: '-fprofile-instr-generate'",
" flag: '-fcoverage-mapping'",
- " flag: '-g'",
" }",
" }",
" flag_set {",
@@ -809,9 +808,9 @@ public class CppActionConfigs {
" action: 'objc-executable'",
" action: 'objc++-executable'",
" flag_group {",
+ " expand_if_all_available: 'gcov_gcno_file'",
" flag: '-fprofile-arcs'",
" flag: '-ftest-coverage'",
- " flag: '-g'",
" }",
" }",
" flag_set {",
