cmake: honor `--with-sha1dc`
@@ -12,6 +12,9 @@ $CFLAGS << " -g"
$CFLAGS << " -O3" unless $CFLAGS[/-O\d/]
$CFLAGS << " -Wall -Wno-comment"
+cmake_flags = [ ENV["CMAKE_FLAGS"] ]
+cmake_flags << "-DUSE_SHA1DC=ON" if with_config("sha1dc")
+
def sys(cmd)
puts " -- #{cmd}"
unless ret = xsystem(cmd)
@@ -77,7 +80,7 @@ else
Dir.chdir("build") do
# On Windows, Ruby-DevKit is MSYS-based, so ensure to use MSYS Makefiles.
generator = "-G \"MSYS Makefiles\"" if Gem.win_platform?
- sys("cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo #{ENV['CMAKE_FLAGS']} #{generator}")
+ sys("cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo #{cmake_flags.join(' ')} #{generator}")
sys(MAKE)
# "normal" libraries (and libgit2 builds) get all these when they build but we're doing it
