Skip to content

Commit f4badcb

Browse files
committed
mpl: factor shared internal headers into private hdrs target
Move the two headers that were duplicated across :mpl and :ui srcs in src/mpl/BUILD (MplObserver.h, clusterEngine.h) into a new :mpl_private_hdrs cc_library with //visibility:private, so they're owned in one place and unreachable from outside //src/mpl. The new target declares its own deps (:pusher, //src/odb/src/db) to be self-contained. Also drop the redundant include/mpl/rtl_mp.h entry from :ui srcs (already exposed via :mpl's hdrs). Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
1 parent 52e5336 commit f4badcb

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

src/mpl/BUILD

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,31 @@ cc_library(
4848
],
4949
)
5050

51+
# Headers owned by :mpl but also consumed by :ui. Kept package-private so
52+
# nothing outside //src/mpl can depend on them.
53+
cc_library(
54+
name = "mpl_private_hdrs",
55+
hdrs = [
56+
"src/MplObserver.h",
57+
"src/clusterEngine.h",
58+
],
59+
visibility = ["//visibility:private"],
60+
deps = [
61+
":pusher",
62+
"//src/odb/src/db",
63+
],
64+
)
65+
5166
cc_library(
5267
name = "mpl",
5368
srcs = [
54-
"src/MplObserver.h",
5569
"src/SACoreHardMacro.cpp",
5670
"src/SACoreHardMacro.h",
5771
"src/SACoreSoftMacro.cpp",
5872
"src/SACoreSoftMacro.h",
5973
"src/SimulatedAnnealingCore.cpp",
6074
"src/SimulatedAnnealingCore.h",
6175
"src/clusterEngine.cpp",
62-
"src/clusterEngine.h",
6376
"src/hier_rtlmp.cpp",
6477
"src/hier_rtlmp.h",
6578
"src/rtl_mp.cpp",
@@ -71,6 +84,7 @@ cc_library(
7184
"include",
7285
],
7386
deps = [
87+
":mpl_private_hdrs",
7488
":pusher",
7589
":snapper",
7690
"//src/dbSta",
@@ -87,10 +101,7 @@ cc_library(
87101
cc_library(
88102
name = "ui",
89103
srcs = [
90-
"include/mpl/rtl_mp.h",
91104
"src/MakeMacroPlacer.cpp",
92-
"src/MplObserver.h",
93-
"src/clusterEngine.h",
94105
"src/graphics.cpp",
95106
"src/graphics.h",
96107
":swig",
@@ -105,6 +116,7 @@ cc_library(
105116
],
106117
deps = [
107118
":mpl",
119+
":mpl_private_hdrs",
108120
":pusher",
109121
"//:ord",
110122
"//src/gui",

0 commit comments

Comments
 (0)