Skip to content

cmake: unset BUILD_GUI when Qt5 is not found#10171

Merged
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
alokkumardalei-wq:fix/unset-build-gui-when-qt5-missing
Apr 17, 2026
Merged

cmake: unset BUILD_GUI when Qt5 is not found#10171
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
alokkumardalei-wq:fix/unset-build-gui-when-qt5-missing

Conversation

@alokkumardalei-wq
Copy link
Copy Markdown
Contributor

@alokkumardalei-wq alokkumardalei-wq commented Apr 17, 2026

What does this PR do?

When BUILD_GUI is ON but Qt5 is not found, the build silently falls back to a stub library. However, the top-level CMakeLists.txt still sets the BUILD_GUI=1 compile definition based on the option alone, causing openroad_gui_compiled to return true at runtime even though gui::show was never registered. This leads to "invalid command name gui::show" errors in batch mode.

Fix by unsetting BUILD_GUI in the cache when Qt5 is not found, so the compile definition correctly reflects the actual build state.

Resolves The-OpenROAD-Project/OpenROAD-flow-scripts#4134

Type of Change

  • Bug fix
  • Breaking change
  • Refactoring

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have signed my commits (DCO).

When BUILD_GUI is ON but Qt5 is not found, the build silently
falls back to a stub library. However, the top-level CMakeLists.txt
still sets the BUILD_GUI=1 compile definition based on the option
alone, causing openroad_gui_compiled to return true at runtime
even though gui::show was never registered. This leads to
"invalid command name gui::show" errors in batch mode.

Fix by unsetting BUILD_GUI in the cache when Qt5 is not found,
so the compile definition correctly reflects the actual build state.

Resolves The-OpenROAD-Project/OpenROAD-flow-scripts#4134

Signed-off-by: alokkumardalei-wq <alokkumardalei2@gmail.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the CMake configuration in src/gui/CMakeLists.txt to explicitly set the BUILD_GUI cache variable to OFF when QT5 is not found. This ensures that the build system state is correctly synchronized with the available dependencies. I have no feedback to provide.

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@alokkumardalei-wq
Copy link
Copy Markdown
Contributor Author

alokkumardalei-wq commented Apr 17, 2026

Hello @maliberty , all checks are passing, please have a look onto this when you get time.
Looking forward for your feedback.

Thank you !

@maliberty maliberty merged commit 6706cc0 into The-OpenROAD-Project:master Apr 17, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

final_report.tcl calls gui::show in batch mode

2 participants