mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-04-27 14:29:43 +00:00
* Fix signature of URI.new7s return value * Use path instead of string | _ToPath * Add document comment to RBS * Remove unnecessary build flags * Remove unnecessary line * Remove files have become unnecessary * Make gem install accept build options for whisper.cpp * Add instraction for build options in README * Add methods for check to Options * Test build options * Rename: configs -> options * Add assert_installed assertion * Use assert_installed * Remove unused attribute * Extract dependency check logic as Dependencies class * Update README * Add WHISPER_FFMPEG option * Test extra build options only on local test * Bump version to 1.3.2 [skip ci]
23 lines
716 B
Ruby
23 lines
716 B
Ruby
require "mkmf"
|
|
require_relative "options"
|
|
require_relative "dependencies"
|
|
|
|
cmake = find_executable("cmake") || abort
|
|
options = Options.new
|
|
have_library("gomp") rescue nil
|
|
libs = Dependencies.new(cmake, options)
|
|
|
|
$INCFLAGS << " -Isources/include -Isources/ggml/include -Isources/examples"
|
|
$LOCAL_LIBS << " #{libs}"
|
|
$cleanfiles << " build #{libs}"
|
|
|
|
create_makefile "whisper" do |conf|
|
|
conf << <<~EOF
|
|
$(TARGET_SO): #{libs}
|
|
#{libs}: cmake-targets
|
|
cmake-targets:
|
|
#{"\t"}#{cmake} -S sources -B build -D BUILD_SHARED_LIBS=OFF -D CMAKE_ARCHIVE_OUTPUT_DIRECTORY=#{__dir__} -D CMAKE_POSITION_INDEPENDENT_CODE=ON #{options}
|
|
#{"\t"}#{cmake} --build build --config Release --target common whisper
|
|
EOF
|
|
end
|