Skip to content

Commit 79ff30c

Browse files
committed
fix building python wheels
1 parent 4fc5034 commit 79ff30c

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,25 @@ endif()
7676

7777
add_subdirectory(${GGML_PATH} ggml)
7878

79+
# Remove SONAME versioning from ggml targets for Python wheel packaging.
80+
# ggml explicitly sets SOVERSION on its targets, which creates versioned symlinks
81+
# (libggml.so.0 -> libggml.so.0.10.0) that aren't preserved in wheels, causing
82+
# auditwheel/delocate to fail.
83+
if (RS_ENABLE_PYTHON)
84+
set(_ggml_targets ggml ggml-base ggml-cpu ggml-metal ggml-blas ggml-vulkan)
85+
foreach(_t IN LISTS _ggml_targets)
86+
if (TARGET ${_t})
87+
set_target_properties(${_t} PROPERTIES
88+
SOVERSION ""
89+
VERSION ""
90+
NO_SONAME ON
91+
INSTALL_RPATH "@loader_path"
92+
BUILD_WITH_INSTALL_RPATH ON
93+
)
94+
endif()
95+
endforeach()
96+
endif()
97+
7998
# --- Core Source Files ---
8099
include_directories(
81100
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -128,6 +147,12 @@ if (NOT RS_ENABLE_PYTHON)
128147
VERSION ${PROJECT_VERSION}
129148
SOVERSION 1
130149
)
150+
else()
151+
set_target_properties(rapidspeech-core PROPERTIES
152+
NO_SONAME ON
153+
INSTALL_RPATH "@loader_path"
154+
BUILD_WITH_INSTALL_RPATH ON
155+
)
131156
endif()
132157
set_target_properties(rapidspeech-core PROPERTIES
133158
CXX_VISIBILITY_PRESET hidden

0 commit comments

Comments
 (0)