Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[email protected] #3494

Merged
merged 22 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions modules/lanelet2/1.2.2/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module(
name = "lanelet2",
version = "1.2.2",
)

BOOST_VERSION = "1.83.0"

bazel_dep(name = "boost.config", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.core", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.filesystem", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.format", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.geometry", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.graph", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.iterator", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.lexical_cast", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.optional", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.polygon", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.program_options", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.property_map", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.serialization", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.type_traits", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "boost.units", version = BOOST_VERSION)
bazel_dep(name = "boost.variant", version = BOOST_VERSION + ".bcr.1")
bazel_dep(name = "eigen", version = "3.4.0.bcr.1")
bazel_dep(name = "geographiclib", version = "2.4.0.bcr.1")
bazel_dep(name = "googletest", version = "1.15.2", repo_name = "com_google_googletest")
bazel_dep(name = "platforms", version = "0.0.9")
bazel_dep(name = "pugixml", version = "1.14.bcr.1")
bazel_dep(name = "rules_cc", version = "0.1.0")
bazel_dep(name = "rules_license", version = "1.0.0")
242 changes: 242 additions & 0 deletions modules/lanelet2/1.2.2/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
"""Bazel build file for lanelet2 libraries"""

load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load("@rules_license//rules:license.bzl", "license")

package(default_applicable_licenses = [":license"])

license(
name = "license",
license_kinds = ["@rules_license//licenses/spdx:BSD-3-Clause"],
license_text = "LICENSE",
)

cc_library(
name = "lanelet2_core",
srcs = glob(["lanelet2_core/src/**/*.cpp"]),
hdrs = glob(["lanelet2_core/include/**/*.h"]),
copts = select({
"@platforms//os:windows": [],
"//conditions:default": [
"-Wno-sign-compare",
"-Wno-unused-function",
"-Wno-unused-local-typedefs",
],
}),
includes = ["lanelet2_core/include"],
visibility = ["//visibility:public"],
deps = [
"@boost.config",
"@boost.core",
"@boost.geometry",
"@boost.iterator",
"@boost.lexical_cast",
"@boost.optional",
"@boost.polygon",
"@boost.type_traits",
"@boost.units",
"@boost.variant",
"@eigen",
],
)

cc_library(
name = "lanelet2_io",
srcs = glob(["lanelet2_io/src/**/*.cpp"]),
hdrs = glob(["lanelet2_io/include/**/*.h"]),
includes = ["lanelet2_io/include"],
visibility = ["//visibility:public"],
deps = [
":lanelet2_core",
"@boost.filesystem",
"@boost.format",
"@boost.geometry",
"@boost.serialization",
"@pugixml",
],
)

filegroup(
name = "lanelet2_maps_osm_files",
srcs = glob(["lanelet2_maps/res/*.osm"]),
)

cc_library(
name = "lanelet2_matching",
srcs = glob(["lanelet2_matching/src/**/*.cpp"]),
hdrs = glob(["lanelet2_matching/include/**/*.h"]),
includes = [
"lanelet2_matching/include",
# This has to be exposed as a public include because the headers include other headers using
# the local path.
"lanelet2_matching/include/lanelet2_matching",
],
visibility = ["//visibility:public"],
deps = [
":lanelet2_core",
":lanelet2_traffic_rules",
"@eigen",
],
)

cc_library(
name = "lanelet2_projection",
srcs = glob(["lanelet2_projection/src/**/*.cpp"]),
hdrs = glob(["lanelet2_projection/include/**/*.h"]),
includes = ["lanelet2_projection/include"],
visibility = ["//visibility:public"],
deps = [
":lanelet2_core",
":lanelet2_io",
"@geographiclib",
],
)

cc_library(
name = "lanelet2_routing",
srcs = glob(["lanelet2_routing/src/**/*.cpp"]),
hdrs = glob(["lanelet2_routing/include/**/*.h"]),
includes = ["lanelet2_routing/include"],
visibility = ["//visibility:public"],
deps = [
":lanelet2_core",
":lanelet2_traffic_rules",
"@boost.geometry",
"@boost.graph",
"@boost.property_map",
],
)

cc_library(
name = "lanelet2_traffic_rules",
srcs = glob(["lanelet2_traffic_rules/src/**/*.cpp"]),
hdrs = glob(["lanelet2_traffic_rules/include/**/*.h"]),
includes = ["lanelet2_traffic_rules/include"],
visibility = ["//visibility:public"],
deps = [":lanelet2_core"],
)

cc_library(
name = "lanelet2_validation",
srcs = glob(["lanelet2_validation/src/**/*.cpp"]),
hdrs = glob(["lanelet2_validation/include/**/*.h"]),
includes = ["lanelet2_validation/include"],
visibility = ["//visibility:public"],
deps = [
":lanelet2_core",
":lanelet2_io",
":lanelet2_projection",
":lanelet2_routing",
":lanelet2_traffic_rules",
"@boost.program_options",
],
)

#################################################################################
# Tests
#################################################################################
cc_test(
name = "lanelet2_core_test",
size = "small",
srcs = glob([
"lanelet2_core/test/*.cpp",
"lanelet2_core/test/*.h",
]),
copts = select({
"@platforms//os:windows": [],
"//conditions:default": ["-Wno-sign-compare"],
}),
deps = [
":lanelet2_core",
"@boost.geometry",
"@boost.optional",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "lanelet2_io_test",
size = "small",
srcs = glob([
"lanelet2_io/test/*.cpp",
"lanelet2_io/test/*.h",
]),
data = [":lanelet2_maps_osm_files"],
deps = [
":lanelet2_core",
":lanelet2_io",
"@bazel_tools//tools/cpp/runfiles",
"@boost.filesystem",
"@boost.serialization",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "lanelet2_matching_test",
size = "small",
srcs = glob(["lanelet2_matching/test/*.cpp"]),
deps = [
":lanelet2_io",
":lanelet2_matching",
":lanelet2_projection",
":lanelet2_traffic_rules",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "lanelet2_projection_test",
size = "small",
srcs = glob(["lanelet2_projection/test/*.cpp"]),
deps = [
":lanelet2_projection",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "lanelet2_routing_test",
size = "small",
srcs = glob([
"lanelet2_routing/test/*.cpp",
"lanelet2_routing/test/*.h",
]),
# For some unknown reason, this test fails without optimization enabled.
copts = ["-O3"],
deps = [
":lanelet2_core",
":lanelet2_routing",
":lanelet2_traffic_rules",
"@boost.filesystem",
"@boost.geometry",
"@boost.optional",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "lanelet2_traffic_rules_test",
size = "small",
srcs = glob(["lanelet2_traffic_rules/test/*.cpp"]),
deps = [
":lanelet2_core",
":lanelet2_traffic_rules",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "lanelet2_validation_test",
size = "small",
srcs = glob(["lanelet2_validation/test/*.cpp"]),
data = [":lanelet2_maps_osm_files"],
deps = [
":lanelet2_core",
":lanelet2_io",
":lanelet2_projection",
":lanelet2_validation",
"@bazel_tools//tools/cpp/runfiles",
"@com_google_googletest//:gtest_main",
],
)
1 change: 1 addition & 0 deletions modules/lanelet2/1.2.2/overlay/MODULE.bazel
Loading
Loading