mirror of
https://github.com/ggml-org/whisper.cpp.git
synced 2026-07-23 11:10:57 -05:00
* Change MemoryView example using NDAV * Add note on audio attributes for #full and #full_parallel * Support more variants of MemoryView * Use IO.popen instead of Kernel.` for Windows compatibility * Use cmake's -C option instead of multiple -D options * Fix memsize calculation * Remove unused argument * Add is_interrupted field to abort callback container * Fix RBS syntax * Address document comment for RDoc * Add .document for RDoc * Add .rdoc_options * Run #full without GVL * Initialize callbacks with nil * Specify implicity Whisper::Params to distinguish from Whisper::Context::Params * Run callbacks without GVL * Call log callback with GVL * Run full_parallel without GVL * Run transcribe without GVL * Fix ruby_whisper_lock_gvl and ruby_whisper_unlock_gvl * Fix return value of encoder_begin_callback * Report GVL unlocking from transcribe * Remove unused interface * Restore overload of full_parallel * Close process * Fix struct name * Make is_without_gvl thread local * Use rb_thread_call_with_gvl instead of global variable * Retrieve instance variable in GVL * Narrow acceptable MemoryView format * Fix option cache path * Reduce files in package * Use append_cflags * Add ext/*.rb to task dependencies * Use copy instead of cp * Make TestPackage more portable * Patch for lower version Ruby * Make build scripts more portable * Add Windows support * Don't raise exceptions
52 lines
1.3 KiB
Ruby
52 lines
1.3 KiB
Ruby
require_relative "options"
|
|
|
|
class OptionsForWindows < Options
|
|
def to_s
|
|
command_line(*generator_args, *to_a)
|
|
end
|
|
|
|
def graphviz_cmake_args
|
|
generator_args
|
|
end
|
|
|
|
private
|
|
|
|
def arm?
|
|
RbConfig::CONFIG["host_cpu"].to_s.downcase.match?(/\A(?:arm64|aarch64)\z/)
|
|
end
|
|
|
|
def cmake_options_output
|
|
Dir.chdir(__dir__) do
|
|
IO.popen([@cmake, "-S", "sources", "-B", "build", *generator_args, "-L"]) {|io| io.read}
|
|
end
|
|
end
|
|
|
|
def generator_args
|
|
generator = cmake_generator
|
|
["-G", generator] if generator && !generator.empty?
|
|
end
|
|
|
|
def cmake_generator
|
|
return @cmake_generator if defined?(@cmake_generator)
|
|
|
|
generator = ENV["CMAKE_GENERATOR"]
|
|
abort "CMAKE_GENERATOR=#{generator} is unsupported for mingw/ucrt Ruby" if visual_studio_generator_name?(generator)
|
|
return @cmake_generator = generator unless generator.nil? || generator.empty?
|
|
|
|
ninja = find_executable("ninja")
|
|
return @cmake_generator = "Ninja" if ninja
|
|
|
|
make = find_executable("make")
|
|
return @cmake_generator = "MSYS Makefiles" if make
|
|
|
|
mingw32_make = find_executable("mingw32-make")
|
|
return @cmake_generator = "MinGW Makefiles" if mingw32_make
|
|
|
|
@cmake_generator = nil
|
|
end
|
|
|
|
def visual_studio_generator_name?(generator)
|
|
generator && generator.start_with?("Visual Studio")
|
|
end
|
|
end
|