From e06011e8d306a1b1603a043b3d55e0aad95f9644 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Sun, 12 Jul 2026 14:39:14 +0000 Subject: [PATCH] cts: make private_hdrs self-contained instead of borrowing cts headers private_hdrs headers (HTreeBuilder.h, SinkClustering.h, TreeBuilder.h, LatencyBalancer.h) include CtsOptions.h and TechChar.h. Since cts already depends on private_hdrs, the header dependency actually runs the other way, and it only compiled because header-only targets are not built standalone under layering_check. Give private_hdrs ownership of CtsOptions.h and TechChar.h (they belong with the cluster -- CtsOptions.h itself includes CtsObserver.h and Util.h) plus the deps those headers need (dbSta, dbNetwork, est, rsz, odb, utl). This makes private_hdrs self-contained; adding cts as a dep of private_hdrs would instead create a cycle. Keep the two headers listed in cts.hdrs as well so cts re-exports them to consumers that depend on cts directly (e.g. the aggregated swig-py module), which layering_check requires. Signed-off-by: Matt Liberty --- src/cts/BUILD | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cts/BUILD b/src/cts/BUILD index 242098af34..f4f4978a23 100644 --- a/src/cts/BUILD +++ b/src/cts/BUILD @@ -18,9 +18,11 @@ cc_library( "src/Clock.h", "src/Clustering.h", "src/CtsObserver.h", + "src/CtsOptions.h", "src/HTreeBuilder.h", "src/LatencyBalancer.h", "src/SinkClustering.h", + "src/TechChar.h", "src/TreeBuilder.h", "src/Util.h", ], @@ -29,7 +31,13 @@ cc_library( ], visibility = ["//visibility:private"], deps = [ + "//src/dbSta", + "//src/dbSta:dbNetwork", + "//src/est", + "//src/odb/src/db", + "//src/rsz", "//src/sta:opensta_lib", + "//src/utl", "@boost.container_hash", "@boost.unordered", ], @@ -50,6 +58,8 @@ cc_library( ], hdrs = [ "include/cts/TritonCTS.h", + # Also owned by :private_hdrs; re-exported here so consumers that + # depend on :cts (e.g. the aggregated swig-py module) can include them. "src/CtsOptions.h", "src/TechChar.h", ],