forked from Z3Prover/z3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
58 lines (51 loc) · 1.6 KB
/
BUILD.bazel
File metadata and controls
58 lines (51 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
load("@rules_license//rules:license.bzl", "license")
package(default_applicable_licenses = [":license"])
license(
name = "license",
license_kinds = ["@rules_license//licenses/spdx:MIT"],
license_text = "LICENSE.txt",
)
exports_files(["LICENSE.txt"])
filegroup(
name = "all_files",
srcs = glob(["**"]),
)
cmake(
name = "z3_dynamic",
generate_args = [
"-G Ninja",
"-D Z3_EXPORTED_TARGETS=", # prevents installation, leaving symlinks between dylibs intact on copy
],
lib_source = ":all_files",
out_binaries = ["z3"],
out_shared_libs = select({
"@platforms//os:linux": ["libz3.so"],
# "@platforms//os:osx": ["libz3.dylib"], # FIXME: this is not working, libz3<version>.dylib is not copied
"@platforms//os:windows": ["libz3.dll"],
"//conditions:default": ["@platforms//:incompatible"],
}),
visibility = ["//visibility:public"],
)
cmake(
name = "z3_static",
generate_args = [
"-G Ninja",
"-D BUILD_SHARED_LIBS=OFF",
"-D Z3_BUILD_LIBZ3_SHARED=OFF",
],
lib_source = ":all_files",
out_binaries = ["z3"],
out_static_libs = select({
"@platforms//os:linux": ["libz3.a"],
"@platforms//os:osx": ["libz3.a"],
"@platforms//os:windows": ["libz3.lib"], # MSVC with Control Flow Guard enabled by default
"//conditions:default": ["@platforms//:incompatible"],
}),
visibility = ["//visibility:public"],
)
alias(
name = "z3",
actual = ":z3_dynamic",
visibility = ["//visibility:public"],
)