Skip to content

Commit 2679bec

Browse files
authored
ruby : add cleaning of library names in dependencies (#3241)
* ruby : add cleaning of library names in dependencies This commit adds a cleaning step to the library names in the `Dependencies` class of the Ruby bindings. The motivation for this is that with the introduction of a library name alias for ggml in Commit (b933d17 "Add in-build ggml::ggml ALIAS library (ggml/1260)) causes the Makefile generation to break: ```console $ sed -n '165,170p' ext/Makefile CLEANOBJS = $(OBJS) *.bak TARGET_SO_DIR_TIMESTAMP = $(TIMESTAMP_DIR)/.sitearchdir.time $(TARGET_SO): libcommon.a libwhisper.a libggml\n(ggml::ggml).a libggml-cpu.a libggml-base.a libcommon.a libwhisper.a libggml\n(ggml::ggml).a libggml-cpu.a libggml-base.a: cmake-targets cmake-targets: /usr/bin/cmake -S sources -B build -D BUILD_SHARED_LIBS=OFF -D CMAKE_ARCHIVE_OUTPUT_DIRECTORY=/home/danbev/work/ai/whisper.cpp/bindings/ruby/ext -D CMAKE_POSITION_INDEPENDENT_CODE=ON ``` * squash! ruby : add cleaning of library names in dependencies Apply PR review feedback.
1 parent 93d5439 commit 2679bec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bindings/ruby/ext/dependencies.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ def initialize(cmake, options)
1717
def libs
1818
tsort.filter_map {|node|
1919
label, shape = @nodes[node]
20-
shape == @static_lib_shape ? label : nil
20+
if shape == @static_lib_shape
21+
label.gsub(/\\n\([^)]+\)/, '')
22+
else
23+
nil
24+
end
2125
}.reverse.collect {|lib| "lib#{lib}.a"}
2226
end
2327

0 commit comments

Comments
 (0)