3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-04 14:26:10 +00:00

Add versioned shared object names in Bazel rules (#9838)

Adds versioned shared library names (`libz3.so.4.17`,
`libz3.4.17.dylib`, etc.) alongside the unversioned ones to enable Bazel
rules to locate the correct library binaries.
This commit is contained in:
Shantanu Gontia 2026-06-16 23:05:21 +05:30 committed by GitHub
parent d457f9f5d3
commit 3d691fe234
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,14 +19,23 @@ filegroup(
cmake( cmake(
name = "z3_dynamic", name = "z3_dynamic",
generate_args = [ generate_args = [
"-G Ninja", "-G Ninja",
"-D Z3_EXPORTED_TARGETS=", # prevents installation, leaving symlinks between dylibs intact on copy "-D Z3_EXPORTED_TARGETS=", # prevents installation, leaving symlinks between dylibs intact on copy
], ],
lib_source = ":all_files", lib_source = ":all_files",
out_binaries = ["z3"], out_binaries = ["z3"],
out_shared_libs = select({ out_shared_libs = select({
"@platforms//os:linux": ["libz3.so"], # NOTE: These will need to be manually bumped along side the version in MODULE.bazel/VERSION.txt/CMake
# "@platforms//os:osx": ["libz3.dylib"], # FIXME: this is not working, libz3<version>.dylib is not copied "@platforms//os:linux": [
"libz3.so",
"libz3.so.4.17",
"libz3.so.4.17.0.0",
],
"@platforms//os:osx": [
"libz3.dylib",
"libz3.4.17.dylib",
"libz3.4.17.0.0.dylib",
],
"@platforms//os:windows": ["libz3.dll"], "@platforms//os:windows": ["libz3.dll"],
"//conditions:default": ["@platforms//:incompatible"], "//conditions:default": ["@platforms//:incompatible"],
}), }),
@ -36,7 +45,7 @@ cmake(
cmake( cmake(
name = "z3_static", name = "z3_static",
generate_args = [ generate_args = [
"-G Ninja", "-G Ninja",
"-D BUILD_SHARED_LIBS=OFF", "-D BUILD_SHARED_LIBS=OFF",
"-D Z3_BUILD_LIBZ3_SHARED=OFF", "-D Z3_BUILD_LIBZ3_SHARED=OFF",
], ],