@@ -25,6 +25,7 @@ string_flag(
2525 build_setting_default = "cli" ,
2626 values = [
2727 "cli" ,
28+ "gui" ,
2829 ],
2930)
3031
@@ -35,6 +36,13 @@ config_setting(
3536 },
3637)
3738
39+ config_setting (
40+ name = "platform_gui" ,
41+ flag_values = {
42+ ":platform" : "gui" ,
43+ },
44+ )
45+
3846# TODO: once project is properly decomposed, we don't
3947# need these blanked dependencies in multiple places anymore.
4048OPENROAD_LIBRARY_DEPS = [
@@ -60,7 +68,6 @@ OPENROAD_LIBRARY_DEPS = [
6068 "//src/gpl" ,
6169 "//src/grt" ,
6270 "//src/grt:ui" ,
63- "//src/gui" ,
6471 "//src/ifp" ,
6572 "//src/ifp:ui" ,
6673 "//src/mpl" ,
@@ -86,7 +93,12 @@ OPENROAD_LIBRARY_DEPS = [
8693 "//src/utl" ,
8794 "//src/utl:ui" ,
8895 "@edu_berkeley_abc//:abc-lib" ,
89- ]
96+ ] + select (
97+ {
98+ ":platform_gui" : ["//src/gui:gui_qt" ],
99+ ":platform_cli" : ["//src/gui" ],
100+ },
101+ )
90102
91103OPENROAD_COPTS = [
92104 "-Wno-error" ,
@@ -121,14 +133,9 @@ cc_binary(
121133 ":rmp_swig" ,
122134 ":rmp_tcl" ,
123135 "//bazel:runfiles" ,
124- ] + select ({
125- ":platform_cli" : [],
126- }),
136+ ],
127137 copts = OPENROAD_COPTS ,
128138 features = ["-use_header_modules" ],
129- linkopts = select ({
130- ":platform_cli" : [],
131- }),
132139 malloc = "@tcmalloc//tcmalloc" ,
133140 visibility = ["//visibility:public" ],
134141 deps = [
@@ -143,6 +150,13 @@ cc_binary(
143150 ],
144151)
145152
153+ GUI_BUILD_FLAGS = select (
154+ {
155+ ":platform_gui" : ["BUILD_GUI=true" ],
156+ ":platform_cli" : ["BUILD_GUI=false" ],
157+ },
158+ )
159+
146160cc_library (
147161 name = "openroad_lib_private" ,
148162 srcs = [
@@ -157,9 +171,7 @@ cc_library(
157171 "src/rmp/include/rmp/*.h" ,
158172 ]),
159173 copts = OPENROAD_COPTS ,
160- defines = OPENROAD_DEFINES + [
161- "BUILD_GUI=false" ,
162- ],
174+ defines = OPENROAD_DEFINES + GUI_BUILD_FLAGS ,
163175 features = ["-use_header_modules" ],
164176 includes = [
165177 "include" ,
@@ -185,9 +197,7 @@ cc_library(
185197 ]),
186198 hdrs = glob (["src/rmp/include/rmp/*.h" ]),
187199 copts = OPENROAD_COPTS ,
188- defines = OPENROAD_DEFINES + [
189- "BUILD_GUI=false" ,
190- ],
200+ defines = OPENROAD_DEFINES + GUI_BUILD_FLAGS ,
191201 features = ["-use_header_modules" ],
192202 includes = [
193203 "include" ,
0 commit comments