11include (openroad )
22
3- set (TEST_LIBS
4- odb
5- lef
6- defin
7- defout
8- lefin
9- lefout
10- cdl
11- 3dblox
12- ${TCL_LIBRARY}
13- Boost::boost
14- utl_lib
15- odb_test_helper
16- gdsin
17- tst
3+ # Each executable links only the libraries it actually needs to avoid bloated
4+ # binaries. src/odb/test/cpp/BUILD is the reference for the minimal dependency
5+ # set of each test. GTEST_LIBS is the one group shared by every test.
6+ set (GTEST_LIBS
187 GTest::gtest
198 GTest::gtest_main
20- GTest::gmock
219)
2210
2311add_executable (OdbGTests TestDbWire.cc TestDbNet.cpp TestDesignIsRouted.cpp TestAbstractLef.cc TestPolygonalFloorplan.cc )
@@ -42,27 +30,132 @@ add_executable(TestSwapMasterUnusedPort TestSwapMasterUnusedPort.cpp)
4230add_executable (TestWriteReadDbHier TestWriteReadDbHier.cpp )
4331add_executable (TestObjectType TestObjectType.cpp )
4432
45- target_link_libraries (OdbGTests ${TEST_LIBS} )
46- target_link_libraries (TestCallBacks ${TEST_LIBS} )
47- target_link_libraries (TestGeom ${TEST_LIBS} )
48- target_link_libraries (TestModule ${TEST_LIBS} )
49- target_link_libraries (TestLef58Properties ${TEST_LIBS} )
50- target_link_libraries (TestGroup ${TEST_LIBS} )
51- target_link_libraries (TestGCellGrid ${TEST_LIBS} )
52- target_link_libraries (TestJournal ${TEST_LIBS} )
53- target_link_libraries (TestAccessPoint ${TEST_LIBS} )
54- target_link_libraries (TestGuide ${TEST_LIBS} )
55- target_link_libraries (TestNetTrack ${TEST_LIBS} )
56- target_link_libraries (TestMaster ${TEST_LIBS} )
57- target_link_libraries (TestGDSIn ${TEST_LIBS} )
58- target_link_libraries (TestChips ${TEST_LIBS} )
59- target_link_libraries (Test3DBloxParser ${TEST_LIBS} )
60- target_link_libraries (Test3DBloxChecker ${TEST_LIBS} )
61- target_link_libraries (Test3DBloxVerilogWriter ${TEST_LIBS} )
62- target_link_libraries (TestSwapMaster ${TEST_LIBS} )
63- target_link_libraries (TestSwapMasterUnusedPort ${TEST_LIBS} )
64- target_link_libraries (TestWriteReadDbHier ${TEST_LIBS} )
65- target_link_libraries (TestObjectType ${TEST_LIBS} )
33+ target_link_libraries (OdbGTests
34+ db
35+ defin
36+ lefin
37+ lefout
38+ OpenSTA
39+ tst
40+ utl_lib
41+ GTest::gmock
42+ ${GTEST_LIBS}
43+ )
44+ target_link_libraries (TestCallBacks
45+ db
46+ odb_test_helper
47+ tst_base
48+ spdlog::spdlog
49+ ${GTEST_LIBS}
50+ )
51+ target_link_libraries (TestGeom
52+ db
53+ ${GTEST_LIBS}
54+ )
55+ target_link_libraries (TestModule
56+ db
57+ odb_test_helper
58+ ${GTEST_LIBS}
59+ )
60+ target_link_libraries (TestLef58Properties
61+ db
62+ defin
63+ defout
64+ lefin
65+ lefout
66+ tst
67+ ${GTEST_LIBS}
68+ )
69+ target_link_libraries (TestGroup
70+ db
71+ odb_test_helper
72+ ${GTEST_LIBS}
73+ )
74+ target_link_libraries (TestGCellGrid
75+ db
76+ odb_test_helper
77+ ${GTEST_LIBS}
78+ )
79+ target_link_libraries (TestJournal
80+ db
81+ odb_test_helper
82+ ${GTEST_LIBS}
83+ )
84+ target_link_libraries (TestAccessPoint
85+ db
86+ odb_test_helper
87+ ${GTEST_LIBS}
88+ )
89+ target_link_libraries (TestGuide
90+ db
91+ odb_test_helper
92+ ${GTEST_LIBS}
93+ )
94+ target_link_libraries (TestNetTrack
95+ db
96+ odb_test_helper
97+ ${GTEST_LIBS}
98+ )
99+ target_link_libraries (TestMaster
100+ db
101+ odb_test_helper
102+ ${GTEST_LIBS}
103+ )
104+ target_link_libraries (TestGDSIn
105+ db
106+ gdsin
107+ gdsout
108+ tst_base
109+ utl_lib
110+ ${GTEST_LIBS}
111+ )
112+ target_link_libraries (TestChips
113+ db
114+ odb_test_helper
115+ ${GTEST_LIBS}
116+ )
117+ target_link_libraries (Test3DBloxParser
118+ 3dblox
119+ db
120+ odb_test_helper
121+ tst_base
122+ ${GTEST_LIBS}
123+ )
124+ target_link_libraries (Test3DBloxChecker
125+ 3dblox
126+ db
127+ tst_base
128+ ${GTEST_LIBS}
129+ )
130+ target_link_libraries (Test3DBloxVerilogWriter
131+ 3dblox
132+ db
133+ tst_base
134+ ${GTEST_LIBS}
135+ )
136+ target_link_libraries (TestSwapMaster
137+ db
138+ dbSta_lib
139+ tst
140+ ${GTEST_LIBS}
141+ )
142+ target_link_libraries (TestSwapMasterUnusedPort
143+ db
144+ dbSta_lib
145+ tst
146+ utl_lib
147+ ${GTEST_LIBS}
148+ )
149+ target_link_libraries (TestWriteReadDbHier
150+ db
151+ tst_integrated_fixture
152+ ${GTEST_LIBS}
153+ )
154+ target_link_libraries (TestObjectType
155+ db
156+ tst_base
157+ ${GTEST_LIBS}
158+ )
66159
67160# Skip the tests from being registered here, since they are called via
68161# cpp_tests.tcl and don't need to be executed twice. The cpp_tests.tcl
0 commit comments