qcoro.h: include network and dbus headers conditionally#308
Merged
Conversation
Only include those headers when QCoro is actually built with the corresponding feature. Fixes #280.
There was a problem hiding this comment.
Pull request overview
This PR adds conditional inclusion of QtDBus and QtNetwork headers in the main qcoro.h header file based on build configuration flags. The changes ensure that these headers are only included when QCoro is built with the corresponding features enabled, fixing issue #280.
- Convert qcoro.h to a template file (qcoro.h.in) with CMake conditional defines
- Add conditional preprocessor guards for qcorodbus.h and qcoronetwork.h includes
- Refactor CMakeLists.txt to configure qcoro.h from template and adjust header generation/installation
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| qcoro/qcoro.h.in | Adds #cmakedefine directives for QCORO_WITH_QTDBUS and QCORO_WITH_QTNETWORK, and wraps qcorodbus.h and qcoronetwork.h includes with conditional compilation guards |
| qcoro/CMakeLists.txt | Adds configure_file() call to generate qcoro.h from template, moves QCoro from CAMELCASE_HEADERS to separate generate_headers() call, and consolidates install commands outside conditional blocks |
| cmake/GenerateHeaders.cmake | Adds optional SOURCE_DIR parameter to allow specifying a different source directory for header generation, with backward-compatible default |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only include those headers when QCoro is actually built with the corresponding feature.
Fixes #280.