Skip to content

Commit 64dc791

Browse files
committed
Fix z3 BUILD.bazel for macOS, Windows
1 parent 80c553d commit 64dc791

File tree

4 files changed

+753
-1
lines changed

4 files changed

+753
-1
lines changed

.bazelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
common --enable_bzlmod
33
common --noenable_workspace
44

5+
# Specifies...
6+
# --config=windows on Windows hosts
7+
# --config=linux on Linux hosts
8+
# --config=macos on macOS hosts
9+
# NOTE: We assume our host and target platforms are identical.
10+
common --enable_platform_specific_config
11+
512
# Use C++20.
613
build --cxxopt=-std=c++20
714
build --host_cxxopt=-std=c++20

BUILD.bazel

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ cmake(
2121
generate_args = ["-G Ninja"],
2222
lib_source = ":all_files",
2323
out_binaries = ["z3"],
24-
out_shared_libs = ["libz3.so"],
24+
out_shared_libs = select({
25+
"@platforms//os:linux": ["libz3.so"],
26+
"@platforms//os:osx": ["libz3.dylib", "libz3.4.15.dylib"],
27+
"@platforms//os:windows": ["z3.dll"],
28+
"//conditions:default": ["@platforms//:incompatible"],
29+
}),
2530
visibility = ["//visibility:public"],
2631
)

MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ bazel_dep(
1717
version = "8.0.1",
1818
dev_dependency = True,
1919
)
20+
21+
bazel_dep(name = "platforms", version = "0.0.11")

0 commit comments

Comments
 (0)