Skip to content

Commit

Permalink
[workspace] Remove globbing from qhull build
Browse files Browse the repository at this point in the history
Don't build unnecessary files: Coordinates.cpp, PointCoordinates.cpp,
QhullPoints.cpp, QhullStat.cpp, RboxPoints.cpp, rboxlib_r.c.

This makes our build and object code footprint smaller, and enables a
future commit to use a better technique for C++ symbol visibility.
  • Loading branch information
jwnimmer-tri committed May 19, 2022
1 parent d8af4d1 commit da7bd8f
Showing 1 changed file with 48 additions and 17 deletions.
65 changes: 48 additions & 17 deletions tools/workspace/qhull/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,66 @@ load(

licenses(["notice"]) # Qhull

package(default_visibility = ["//visibility:public"])
package(default_visibility = ["//visibility:private"])

_HDRS_C = glob([
"src/libqhull_r/*.h",
])

_HDRS_CPP = glob([
"src/libqhullcpp/*.h",
])

_SRCS_C = [
"src/libqhull_r/geom2_r.c",
"src/libqhull_r/geom_r.c",
"src/libqhull_r/global_r.c",
"src/libqhull_r/io_r.c",
"src/libqhull_r/libqhull_r.c",
"src/libqhull_r/mem_r.c",
"src/libqhull_r/merge_r.c",
"src/libqhull_r/poly2_r.c",
"src/libqhull_r/poly_r.c",
"src/libqhull_r/qset_r.c",
"src/libqhull_r/random_r.c",
"src/libqhull_r/stat_r.c",
"src/libqhull_r/user_r.c",
"src/libqhull_r/usermem_r.c",
]

_SRCS_CPP = [
"src/libqhullcpp/Qhull.cpp",
"src/libqhullcpp/QhullFacet.cpp",
"src/libqhullcpp/QhullFacetList.cpp",
"src/libqhullcpp/QhullFacetSet.cpp",
"src/libqhullcpp/QhullHyperplane.cpp",
"src/libqhullcpp/QhullPoint.cpp",
"src/libqhullcpp/QhullPointSet.cpp",
"src/libqhullcpp/QhullQh.cpp",
"src/libqhullcpp/QhullRidge.cpp",
"src/libqhullcpp/QhullSet.cpp",
"src/libqhullcpp/QhullUser.cpp",
"src/libqhullcpp/QhullVertex.cpp",
"src/libqhullcpp/QhullVertexSet.cpp",
"src/libqhullcpp/RoadError.cpp",
"src/libqhullcpp/RoadLogEvent.cpp",
]

cc_library(
name = "qhull",
hdrs = glob([
"src/libqhullcpp/*.h",
"src/libqhull_r/*.h",
]),
hdrs = _HDRS_C + _HDRS_CPP,
copts = [
"-fvisibility=hidden",
],
includes = ["src"],
srcs = glob(
[
"src/libqhullcpp/*.cpp",
"src/libqhull_r/*.c",
],
exclude = [
"src/libqhullcpp/qt-qhull.cpp",
"src/libqhullcpp/usermem_r-cpp.cpp",
"src/libqhull_r/userprintf_r.c",
"src/libqhull_r/userprintf_rbox_r.c",
],
),
srcs = _SRCS_C + _SRCS_CPP,
linkstatic = 1,
visibility = ["//visibility:public"],
)

# Install the license file.
install(
name = "install",
docs = ["COPYING.txt"],
visibility = ["//visibility:public"],
)

0 comments on commit da7bd8f

Please sign in to comment.