Skip to content

Commit b39f811

Browse files
committed
drt: factor shared internal headers into private hdrs target
Move the 15 headers that were duplicated across :drt and :ui srcs in src/drt/BUILD into a new :drt_private_hdrs cc_library with //visibility:private, so they're owned in one place and unreachable from outside //src/drt. Restrict :db_hdrs visibility to //src/drt:__subpackages__ so it stays accessible to drt unit tests without leaking outside the module. Move FlexMazeTypes.h from :db_hdrs to :base_types, where the foundational types already live. Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
1 parent 52e5336 commit b39f811

3 files changed

Lines changed: 44 additions & 34 deletions

File tree

src/drt/BUILD

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ cc_library(
2424
cc_library(
2525
name = "base_types",
2626
srcs = ["src/frBaseTypes.cpp"],
27-
hdrs = ["src/frBaseTypes.h"],
27+
hdrs = [
28+
"src/dr/FlexMazeTypes.h",
29+
"src/frBaseTypes.h",
30+
],
2831
includes = ["src"],
2932
deps = [
3033
"//src/odb/src/db",
@@ -91,11 +94,11 @@ cc_library(
9194
"src/db/tech/frTechObject.h",
9295
"src/db/tech/frViaDef.h",
9396
"src/db/tech/frViaRuleGenerate.h",
94-
"src/dr/FlexMazeTypes.h",
9597
],
9698
includes = [
9799
"src",
98100
],
101+
visibility = ["//src/drt:__subpackages__"],
99102
deps = [
100103
":base_types",
101104
"//src/odb/src/db",
@@ -104,10 +107,44 @@ cc_library(
104107
],
105108
)
106109

110+
# Headers owned by :drt but also consumed by :ui. Kept package-private so
111+
# nothing outside //src/drt can depend on them.
112+
cc_library(
113+
name = "drt_private_hdrs",
114+
hdrs = [
115+
"src/AbstractGraphicsFactory.h",
116+
"src/distributed/drUpdate.h",
117+
"src/dr/AbstractDRGraphics.h",
118+
"src/dr/FlexDR.h",
119+
"src/dr/FlexGridGraph.h",
120+
"src/dr/FlexWavefront.h",
121+
"src/frDesign.h",
122+
"src/frRegionQuery.h",
123+
"src/gc/FlexGC.h",
124+
"src/global.h",
125+
"src/pa/AbstractPAGraphics.h",
126+
"src/pa/FlexPA.h",
127+
"src/pa/FlexPA_unique.h",
128+
"src/ta/AbstractTAGraphics.h",
129+
"src/ta/FlexTA.h",
130+
],
131+
includes = ["src"],
132+
visibility = ["//visibility:private"],
133+
deps = [
134+
":base_types",
135+
":db_hdrs",
136+
"//src/dst",
137+
"//src/odb/src/db",
138+
"//src/utl",
139+
"@boost.container",
140+
"@boost.polygon",
141+
"@boost.serialization",
142+
],
143+
)
144+
107145
cc_library(
108146
name = "drt",
109147
srcs = [
110-
"src/AbstractGraphicsFactory.h",
111148
"src/DesignCallBack.cpp",
112149
"src/DesignCallBack.h",
113150
"src/TritonRoute.cpp",
@@ -132,14 +169,11 @@ cc_library(
132169
"src/distributed/RoutingCallBack.h",
133170
"src/distributed/RoutingJobDescription.h",
134171
"src/distributed/drUpdate.cpp",
135-
"src/distributed/drUpdate.h",
136172
"src/distributed/frArchive.cpp",
137173
"src/distributed/frArchive.h",
138174
"src/distributed/paUpdate.cpp",
139175
"src/distributed/paUpdate.h",
140-
"src/dr/AbstractDRGraphics.h",
141176
"src/dr/FlexDR.cpp",
142-
"src/dr/FlexDR.h",
143177
"src/dr/FlexDRFlow.cpp",
144178
"src/dr/FlexDR_conn.cpp",
145179
"src/dr/FlexDR_conn.h",
@@ -148,16 +182,11 @@ cc_library(
148182
"src/dr/FlexDR_maze.cpp",
149183
"src/dr/FlexDR_rq.cpp",
150184
"src/dr/FlexGridGraph.cpp",
151-
"src/dr/FlexGridGraph.h",
152185
"src/dr/FlexGridGraph_maze.cpp",
153-
"src/dr/FlexWavefront.h",
154-
"src/frDesign.h",
155186
"src/frProfileTask.h",
156187
"src/frRTree.h",
157188
"src/frRegionQuery.cpp",
158-
"src/frRegionQuery.h",
159189
"src/gc/FlexGC.cpp",
160-
"src/gc/FlexGC.h",
161190
"src/gc/FlexGC_cut.cpp",
162191
"src/gc/FlexGC_eol.cpp",
163192
"src/gc/FlexGC_impl.h",
@@ -167,30 +196,24 @@ cc_library(
167196
"src/gc/FlexGC_metspc.cpp",
168197
"src/gc/FlexGC_rq.cpp",
169198
"src/global.cpp",
170-
"src/global.h",
171199
"src/io/GuideProcessor.cpp",
172200
"src/io/GuideProcessor.h",
173201
"src/io/io.cpp",
174202
"src/io/io.h",
175203
"src/io/io_parser_helper.cpp",
176204
"src/io/io_pin.cpp",
177-
"src/pa/AbstractPAGraphics.h",
178205
"src/pa/FlexPA.cpp",
179-
"src/pa/FlexPA.h",
180206
"src/pa/FlexPA_acc_pattern.cpp",
181207
"src/pa/FlexPA_acc_point.cpp",
182208
"src/pa/FlexPA_init.cpp",
183209
"src/pa/FlexPA_row_pattern.cpp",
184210
"src/pa/FlexPA_unique.cpp",
185-
"src/pa/FlexPA_unique.h",
186211
"src/rp/FlexRP.cpp",
187212
"src/rp/FlexRP.h",
188213
"src/rp/FlexRP_init.cpp",
189214
"src/rp/FlexRP_prep.cpp",
190215
"src/serialization.h",
191-
"src/ta/AbstractTAGraphics.h",
192216
"src/ta/FlexTA.cpp",
193-
"src/ta/FlexTA.h",
194217
"src/ta/FlexTA_assign.cpp",
195218
"src/ta/FlexTA_end.cpp",
196219
"src/ta/FlexTA_init.cpp",
@@ -209,6 +232,7 @@ cc_library(
209232
deps = [
210233
":base_types",
211234
":db_hdrs",
235+
":drt_private_hdrs",
212236
":pin_access_service",
213237
"//src/dst",
214238
"//src/odb/src/db",
@@ -231,29 +255,13 @@ cc_library(
231255
cc_library(
232256
name = "ui",
233257
srcs = [
234-
"include/drt/TritonRoute.h",
235-
"src/AbstractGraphicsFactory.h",
236258
"src/GraphicsFactory.cpp",
237259
"src/GraphicsFactory.h",
238260
"src/MakeTritonRoute.cpp",
239-
"src/distributed/drUpdate.h",
240-
"src/dr/AbstractDRGraphics.h",
241-
"src/dr/FlexDR.h",
242261
"src/dr/FlexDR_graphics.cpp",
243262
"src/dr/FlexDR_graphics.h",
244-
"src/dr/FlexGridGraph.h",
245-
"src/dr/FlexWavefront.h",
246-
"src/frDesign.h",
247-
"src/frRegionQuery.h",
248-
"src/gc/FlexGC.h",
249-
"src/global.h",
250-
"src/pa/AbstractPAGraphics.h",
251-
"src/pa/FlexPA.h",
252263
"src/pa/FlexPA_graphics.cpp",
253264
"src/pa/FlexPA_graphics.h",
254-
"src/pa/FlexPA_unique.h",
255-
"src/ta/AbstractTAGraphics.h",
256-
"src/ta/FlexTA.h",
257265
"src/ta/FlexTA_graphics.cpp",
258266
"src/ta/FlexTA_graphics.h",
259267
":swig",
@@ -273,6 +281,7 @@ cc_library(
273281
":base_types",
274282
":db_hdrs",
275283
":drt",
284+
":drt_private_hdrs",
276285
":pin_access_service",
277286
"//:ord",
278287
"//src/dst",

src/drt/src/dr/FlexDR.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "distributed/frArchive.h"
4343
#include "dr/AbstractDRGraphics.h"
4444
#include "dr/FlexDR_conn.h"
45+
#include "drt/TritonRoute.h"
4546
#include "dst/BalancerJobDescription.h"
4647
#include "dst/Distributed.h"
4748
#include "dst/JobMessage.h"

src/drt/src/dr/FlexDR.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "dr/FlexGridGraph.h"
3737
#include "dr/FlexMazeTypes.h"
3838
#include "dr/FlexWavefront.h"
39-
#include "drt/TritonRoute.h"
4039
#include "dst/JobMessage.h"
4140
#include "frBaseTypes.h"
4241
#include "frDesign.h"
@@ -58,6 +57,7 @@ class Logger;
5857

5958
namespace drt {
6059

60+
class TritonRoute;
6161
class frConstraint;
6262
struct SearchRepairArgs;
6363

0 commit comments

Comments
 (0)