Skip to content

Commit

Permalink
Enable header layering checks for bazel build (#646)
Browse files Browse the repository at this point in the history
* Enable parse_headers and process_headers_in_dependencies checks for bazel build

Signed-off-by: Shameek Ganguly <[email protected]>

* Enable layering checks for gz-math/eigen3

Signed-off-by: Shameek Ganguly <[email protected]>

---------

Signed-off-by: Shameek Ganguly <[email protected]>
  • Loading branch information
shameekganguly authored Nov 15, 2024
1 parent 44e3bba commit ebfb0bf
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ build --strip=never
build --strict_system_includes
build --fission=dbg
build --features=per_object_debug_info

# Enable header processing, required for layering checks with parse_header.
build --process_headers_in_dependencies
15 changes: 14 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ load("@rules_license//rules:license.bzl", "license")
package(
default_applicable_licenses = [":license"],
default_visibility = ["//visibility:public"],
features = ["layering_check"],
features = [
"layering_check",
"parse_headers",
],
)

license(
Expand Down Expand Up @@ -592,6 +595,10 @@ cc_library(
name = "MaterialType",
hdrs = ["include/gz/math/MaterialType.hh"],
includes = ["include"],
deps = [
":Config",
":Export",
],
)

cc_library(
Expand Down Expand Up @@ -698,6 +705,9 @@ cc_library(
hdrs = ["include/gz/math/MovingWindowFilter.hh"],
includes = ["include"],
deps = [
":Config",
":Export",
":Vector3",
"@gz-utils//:SuppressWarning",
],
)
Expand Down Expand Up @@ -757,6 +767,9 @@ cc_library(
name = "PiecewiseScalarField3",
hdrs = ["include/gz/math/PiecewiseScalarField3.hh"],
includes = ["include"],
deps = [
":Region3",
],
)

cc_test(
Expand Down
4 changes: 4 additions & 0 deletions eigen3/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ load("@rules_license//rules:license.bzl", "license")

package(
default_applicable_licenses = ["//:license"],
features = [
"layering_check",
"parse_headers",
],
)

license(
Expand Down
1 change: 1 addition & 0 deletions include/gz/math/detail/Box.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#ifndef GZ_MATH_DETAIL_BOX_HH_
#define GZ_MATH_DETAIL_BOX_HH_

#include "gz/math/Box.hh"
#include "gz/math/Triangle3.hh"

#include <optional>
Expand Down
1 change: 1 addition & 0 deletions include/gz/math/detail/Capsule.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <limits>
#include <optional>
#include <gz/math/Capsule.hh>
#include <gz/math/Helpers.hh>
#include <gz/math/Inertial.hh>

Expand Down
1 change: 1 addition & 0 deletions include/gz/math/detail/Cone.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define GZ_MATH_DETAIL_CONE_HH_

#include <optional>
#include "gz/math/Cone.hh"

namespace gz::math
{
Expand Down
1 change: 1 addition & 0 deletions include/gz/math/detail/Cylinder.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define GZ_MATH_DETAIL_CYLINDER_HH_

#include <optional>
#include "gz/math/Cylinder.hh"

namespace gz::math
{
Expand Down
1 change: 1 addition & 0 deletions include/gz/math/detail/Ellipsoid.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <limits>
#include <optional>
#include "gz/math/Ellipsoid.hh"
#include <gz/math/Helpers.hh>
#include <gz/math/Inertial.hh>

Expand Down
1 change: 1 addition & 0 deletions src/KmeansPrivate.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <gz/math/Vector3.hh>
#include <gz/math/Helpers.hh>
#include <gz/math/config.hh>
#include <gz/math/Kmeans.hh>

namespace gz
{
Expand Down
2 changes: 2 additions & 0 deletions src/MaterialType.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <array>
#include <utility>

#include "gz/math/Material.hh"

using namespace gz;
using namespace math;

Expand Down

0 comments on commit ebfb0bf

Please sign in to comment.