Skip to content

Commit 1ad4f77

Browse files
sowhat110oberpar
authored andcommitted
geninfo: Added support for Xcode 7.0 gcov version handling
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]>
1 parent c3602ea commit 1ad4f77

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bin/geninfo

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,6 +1909,7 @@ sub get_gcov_version()
19091909
local *HANDLE;
19101910
my $version_string;
19111911
my $result;
1912+
my $pipe_next_line;
19121913

19131914
open(GCOV_PIPE, "-|", "$gcov_tool --version")
19141915
or die("ERROR: cannot retrieve gcov version!\n");
@@ -1917,7 +1918,13 @@ sub get_gcov_version()
19171918
# For example, gcov --version yields:
19181919
# LLVM (http://llvm.org/):
19191920
# LLVM version 3.4svn
1920-
$version_string = <GCOV_PIPE> if ($version_string =~ /LLVM/);
1921+
1922+
$pipe_next_line = <GCOV_PIPE>;
1923+
# In case version information is on first line.
1924+
# For example, with Xcode 7.0 gcov --version yields:
1925+
# Apple LLVM 7.0.0 (clang-700.0.65)
1926+
1927+
$version_string = $pipe_next_line if ($pipe_next_line && $version_string =~ /LLVM/);
19211928
close(GCOV_PIPE);
19221929

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

0 commit comments

Comments
 (0)