diff --git a/tools/workspace/pybind11/package.BUILD.bazel b/tools/workspace/pybind11/package.BUILD.bazel index 1682beaff295..37b34304657f 100644 --- a/tools/workspace/pybind11/package.BUILD.bazel +++ b/tools/workspace/pybind11/package.BUILD.bazel @@ -5,43 +5,56 @@ load( "install", "install_files", ) +load( + "@drake//tools/workspace:check_lists_consistency.bzl", + "check_lists_consistency", +) load("@drake//tools/lint:python_lint.bzl", "python_lint") licenses(["notice"]) # BSD-3-Clause package(default_visibility = ["//visibility:public"]) +_HDRS = [ + "include/pybind11/attr.h", + "include/pybind11/buffer_info.h", + "include/pybind11/cast.h", + "include/pybind11/chrono.h", + "include/pybind11/common.h", + "include/pybind11/complex.h", + "include/pybind11/detail/class.h", + "include/pybind11/detail/common.h", + "include/pybind11/detail/descr.h", + "include/pybind11/detail/init.h", + "include/pybind11/detail/internals.h", + "include/pybind11/detail/type_caster_base.h", + "include/pybind11/detail/typeid.h", + "include/pybind11/eigen.h", + "include/pybind11/embed.h", + "include/pybind11/eval.h", + "include/pybind11/functional.h", + "include/pybind11/gil.h", + "include/pybind11/iostream.h", + "include/pybind11/numpy.h", + "include/pybind11/operators.h", + "include/pybind11/options.h", + "include/pybind11/pybind11.h", + "include/pybind11/pytypes.h", + "include/pybind11/stl.h", + "include/pybind11/stl/filesystem.h", + "include/pybind11/stl_bind.h", +] + +check_lists_consistency( + files = _HDRS, + glob_include = [ + "include/**", + ], +) + cc_library( name = "pybind11", - hdrs = [ - "include/pybind11/attr.h", - "include/pybind11/buffer_info.h", - "include/pybind11/cast.h", - "include/pybind11/chrono.h", - "include/pybind11/common.h", - "include/pybind11/complex.h", - "include/pybind11/detail/class.h", - "include/pybind11/detail/common.h", - "include/pybind11/detail/descr.h", - "include/pybind11/detail/init.h", - "include/pybind11/detail/internals.h", - "include/pybind11/detail/type_caster_base.h", - "include/pybind11/detail/typeid.h", - "include/pybind11/eigen.h", - "include/pybind11/embed.h", - "include/pybind11/eval.h", - "include/pybind11/functional.h", - "include/pybind11/gil.h", - "include/pybind11/iostream.h", - "include/pybind11/numpy.h", - "include/pybind11/operators.h", - "include/pybind11/options.h", - "include/pybind11/pybind11.h", - "include/pybind11/pytypes.h", - "include/pybind11/stl.h", - "include/pybind11/stl/filesystem.h", - "include/pybind11/stl_bind.h", - ], + hdrs = _HDRS, includes = ["include"], deps = [ "@eigen",