Skip to content

Commit

Permalink
geninfo: Added support for Xcode 7.0 gcov version handling
Browse files Browse the repository at this point in the history
With Xcode 7.0 LLVM gcov keeps version information on the first line.
E.g. gcov --version yields: Apple LLVM 7.0.0 (clang-700.0.65)

Signed-off-by: Denis Abramov <[email protected]>
  • Loading branch information
sowhat110 authored and oberpar committed Sep 21, 2015
1 parent c3602ea commit 1ad4f77
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/geninfo
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,7 @@ sub get_gcov_version()
local *HANDLE;
my $version_string;
my $result;
my $pipe_next_line;

open(GCOV_PIPE, "-|", "$gcov_tool --version")
or die("ERROR: cannot retrieve gcov version!\n");
Expand All @@ -1917,7 +1918,13 @@ sub get_gcov_version()
# For example, gcov --version yields:
# LLVM (http://llvm.org/):
# LLVM version 3.4svn
$version_string = <GCOV_PIPE> if ($version_string =~ /LLVM/);

$pipe_next_line = <GCOV_PIPE>;
# In case version information is on first line.
# For example, with Xcode 7.0 gcov --version yields:
# Apple LLVM 7.0.0 (clang-700.0.65)

$version_string = $pipe_next_line if ($pipe_next_line && $version_string =~ /LLVM/);
close(GCOV_PIPE);

# Remove version information in parenthesis to cope with the following:
Expand Down

0 comments on commit 1ad4f77

Please sign in to comment.