Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ext/rugged/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ def self.run_cmake(timeout, args)

major = minor = nil

File.readlines(File.join(LIBGIT2_DIR, "include", "git2", "version.h")).each do |line|
git2_include_dir = Dir.glob("#{RbConfig::CONFIG["includedir"]}/**/git2").first ||
File.join(LIBGIT2_DIR, "include", "git2")

File.readlines(File.join(git2_include_dir, "version.h")).each do |line|
if !major && (matches = line.match(/^#define LIBGIT2_VER_MAJOR\s+([0-9]+)$/))
major = matches[1]
next
Expand Down