Skip to content

qcoro.h: include network and dbus headers conditionally#308

Merged
danvratil merged 1 commit intomainfrom
280-qcoroh-without-qdbus
Dec 10, 2025
Merged

qcoro.h: include network and dbus headers conditionally#308
danvratil merged 1 commit intomainfrom
280-qcoroh-without-qdbus

Conversation

@danvratil
Copy link
Collaborator

Only include those headers when QCoro is actually built with the corresponding feature.

Fixes #280.

Only include those headers when QCoro is actually built with
the corresponding feature.

Fixes #280.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@danvratil danvratil merged commit 8c43e4f into main Dec 10, 2025
47 of 53 checks passed
@danvratil danvratil deleted the 280-qcoroh-without-qdbus branch December 10, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

//#include "qcorodbus.h"

2 participants