-
Notifications
You must be signed in to change notification settings - Fork 37.7k
build: Explicitly set Qt's AUTO{MOC,RCC,UIC}
property per target
#32951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This change avoids unnecessary dependencies for the `codegen` target when using Makefile generators.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32951. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
My Guix build:
|
The codebase, which is compiled, consists of both files in the source tree and additional files generated during the build process. These generated files include headers such as
bitcoin-build-config.h
, headers generated for tests and benchmarks from data files, and files produced by Qt's tools, such asmoc
,rcc
anduic
.When using Makefile or Ninja generators, CMake 3.31 and later provides a convenient builtin build target
codegen
, which buildsallgenerated files. For example:or
However, when building with
-DBUILD_GUI=ON
, setting theCMAKE_{AUTOMOC,RCC,UIC}
variables globally introduces undesired dependencies for Makefiles generators, resulting in building dependencies directly unrelated to the generated files.This PR resolves that issue. The first commit refactors the build system by factoring out the main library from the
test_bitcoin-qt
executable, just as is already done forbitcoinqt
andbitcoin-qt
, and prepares the ground for the second commit.