2018-01-22 23:47:07 +08:00
|
|
|
# Copyright 2018 The Cartographer Authors
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
# Top-level proto and C++ targets for Cartographer.
|
|
|
|
|
|
|
|
load("@com_github_antonovvk_bazel_rules//:config.bzl", "cc_fix_config")
|
|
|
|
|
|
|
|
package(
|
|
|
|
default_visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
licenses(["notice"]) # Apache 2.0
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "protos",
|
|
|
|
srcs = glob([
|
|
|
|
"**/*.proto",
|
|
|
|
]),
|
|
|
|
deps = [
|
|
|
|
"@com_google_protobuf//:empty_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_proto_library(
|
|
|
|
name = "cc_protos",
|
|
|
|
deps = [":protos"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_fix_config(
|
|
|
|
name = "common_config_h",
|
|
|
|
cmake = True,
|
|
|
|
files = {"common/config.h.cmake": "common/config.h"},
|
|
|
|
values = {
|
2018-02-02 04:58:59 +08:00
|
|
|
"CARTOGRAPHER_CONFIGURATION_FILES_DIRECTORY": "configuration_files",
|
2018-01-22 23:47:07 +08:00
|
|
|
"PROJECT_SOURCE_DIR": "todo_set_project_source_dir_in_cartographer.BUILD",
|
|
|
|
},
|
|
|
|
visibility = ["//visibility:private"],
|
|
|
|
)
|
|
|
|
|
2018-04-27 19:45:54 +08:00
|
|
|
TEST_LIBRARY_SRCS = glob([
|
|
|
|
"**/*test_helpers.cc",
|
|
|
|
"**/fake_*.cc",
|
|
|
|
"**/mock_*.cc",
|
|
|
|
])
|
|
|
|
|
|
|
|
TEST_LIBRARY_HDRS = glob([
|
|
|
|
"**/*test_helpers.h",
|
|
|
|
"**/fake_*.h",
|
|
|
|
"**/mock_*.h",
|
|
|
|
])
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "cartographer_test_library",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = TEST_LIBRARY_SRCS,
|
|
|
|
hdrs = TEST_LIBRARY_HDRS,
|
|
|
|
deps = [
|
|
|
|
":cartographer",
|
|
|
|
"@com_google_googletest//:gtest",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-01-22 23:47:07 +08:00
|
|
|
cc_library(
|
|
|
|
name = "cartographer",
|
|
|
|
srcs = glob(
|
|
|
|
[
|
|
|
|
"**/*.cc",
|
|
|
|
],
|
|
|
|
exclude = [
|
|
|
|
"**/*_main.cc",
|
|
|
|
"**/*_test.cc",
|
2018-04-27 19:45:54 +08:00
|
|
|
] + TEST_LIBRARY_SRCS,
|
2018-01-22 23:47:07 +08:00
|
|
|
),
|
|
|
|
hdrs = [
|
|
|
|
"common/config.h",
|
2018-04-27 19:45:54 +08:00
|
|
|
] + glob(
|
|
|
|
[
|
|
|
|
"**/*.h",
|
|
|
|
],
|
|
|
|
exclude = TEST_LIBRARY_HDRS,
|
|
|
|
),
|
2018-01-31 22:19:36 +08:00
|
|
|
copts = ["-Wno-sign-compare"],
|
2018-01-22 23:47:07 +08:00
|
|
|
includes = ["."],
|
|
|
|
deps = [
|
|
|
|
":cc_protos",
|
|
|
|
"@boost//:iostreams",
|
2018-08-03 17:15:50 +08:00
|
|
|
"@com_google_absl//absl/base",
|
2018-08-07 18:50:37 +08:00
|
|
|
"@com_google_absl//absl/strings",
|
2018-10-08 16:47:28 +08:00
|
|
|
"@com_google_absl//absl/container:flat_hash_map",
|
2018-10-08 18:43:17 +08:00
|
|
|
"@com_google_absl//absl/container:flat_hash_set",
|
2018-08-03 17:15:50 +08:00
|
|
|
"@com_google_absl//absl/synchronization",
|
2018-08-07 18:50:37 +08:00
|
|
|
"@com_google_absl//absl/types:optional",
|
2018-01-22 23:47:07 +08:00
|
|
|
"@com_google_glog//:glog",
|
|
|
|
"@org_cairographics_cairo//:cairo",
|
|
|
|
"@org_ceres_solver_ceres_solver//:ceres",
|
|
|
|
"@org_lua_lua//:lua",
|
|
|
|
"@org_tuxfamily_eigen//:eigen",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
[cc_test(
|
|
|
|
name = src.replace("/", "_").replace(".cc", ""),
|
|
|
|
srcs = [src],
|
2018-02-02 04:58:59 +08:00
|
|
|
data = ["//:configuration_files"],
|
2018-01-22 23:47:07 +08:00
|
|
|
deps = [
|
|
|
|
":cartographer",
|
2018-04-27 19:45:54 +08:00
|
|
|
":cartographer_test_library",
|
2018-07-28 01:43:35 +08:00
|
|
|
"@com_google_absl//absl/memory",
|
2018-08-07 18:50:37 +08:00
|
|
|
"@com_google_googletest//:gtest_main",
|
2018-01-22 23:47:07 +08:00
|
|
|
],
|
|
|
|
) for src in glob(
|
|
|
|
["**/*_test.cc"],
|
|
|
|
)]
|