-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBUILD.bazel
73 lines (66 loc) · 1.88 KB
/
BUILD.bazel
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
load("//lib:defs.bzl", "dep_path", "include_dir", "library_dir")
load("//lib:lib.bzl", "package_lib")
load("//toolchains/cmake:cmake.bzl", "cache_entries", "cmake_lib")
package(default_visibility = ["//:__subpackages__"])
package_lib(
github_tag = "{name}-solver",
github_version_prefix = "",
)
SS_LIBS = [
# keep sorted
"amd",
"camd",
"ccolamd",
"cholmod",
"colamd",
"config",
"metis",
"spqr",
]
CACHE_ENTRIES = cache_entries(
build_examples = False,
build_shared_libs = False,
# Needed to make #include <SuiteSparse_config.h> work.
cmake_cxx_standard_include_directories = include_dir("config"),
cmake_prefix_path = dep_path("eigen"),
# SuiteSparse hints.
# We must list each component since we put them in separate directories.
suitesparse_include_dir_hints = ";".join([
include_dir(lib)
for lib in SS_LIBS
]),
suitesparse_library_dir_hints = ";".join([
library_dir(lib)
for lib in SS_LIBS
]),
deps = {
"cxsparse": {},
"glog": {},
},
)
cmake_lib(
name = "ceres",
cache_entries = {
"//config:wasm": CACHE_ENTRIES,
"//conditions:default": cache_entries(
CACHE_ENTRIES,
# Add -pthread and -lsupc++ to try_compile() commands.
# These are only needed when compiling with Clang (GCC works fine without these.)
cmake_required_flags = "-pthread",
cmake_required_libraries = "-lsupc++",
),
},
deps = [
"//lib/eigen",
"//lib/glog",
"//lib/suitesparse:amd",
"//lib/suitesparse:camd",
"//lib/suitesparse:ccolamd",
"//lib/suitesparse:cholmod",
"//lib/suitesparse:colamd",
"//lib/suitesparse:config",
"//lib/suitesparse:cxsparse",
"//lib/suitesparse:metis",
"//lib/suitesparse:spqr",
],
)