cmake: Collect headers for extracting translatable strings #33194

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:250815-tr-headers changing 1 files +11 −36
  1. hebasto commented at 1:20 pm on August 15, 2025: member

    While updating the translation source file for Transifex after #31296, I noticed that headers are not processed by the extract_strings_qt.py script.

    Adding headers to build targets’ sources doesn’t seem like a good solution, because it would be hard to maintain, as CMake does not require the presence of headers in a target’s sources.

    Notably, the translate build target differs from others in the following ways:

    1. It is intended to be used only during the release process.
    2. It modifies files in the source tree that are meant to be committed to the repository.
    3. No other build targets depend on it.

    Considering the above, we can safely collect input files for processing by extract_strings_qt.py using the file(GLOB_RECURSE ...) command.

    Required for #33193.

  2. cmake: Collect headers for extracting translatable strings 33e219de72
  3. hebasto added this to the milestone 30.0 on Aug 15, 2025
  4. hebasto added the label Build system on Aug 15, 2025
  5. DrahtBot commented at 1:20 pm on August 15, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33194.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #33200 (cmake: Introduce translate.cmake script for translate target by purpleKarrot)

    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.

  6. purpleKarrot commented at 2:07 pm on August 15, 2025: contributor

    There is nothing wrong with globbing per se.

    The problem with globbing in the build analysis stage is that it is slows down each individual build.

    The problem with globbing in the build system generator is that the result may be out of date when the build runs. This is the reason why globbing is discouraged in CMakeLists.txt files. Since CMake version 3.12, file(GLOB) supports a CONFIGURE_DEPENDS option, which inserts a check in the build analysis phase. This may give some robustness at the expense of performance.

    Since the result of the glob is only used inside a single custom target, the best approach would be to actually perform the globbing inside the script that is run as the custom target. That means: either do it in the python script or add a cmake script.

  7. hebasto commented at 11:23 am on August 16, 2025: member
    Closing in favour of #33200.
  8. hebasto closed this on Aug 16, 2025


hebasto DrahtBot purpleKarrot

Labels
Build system

Milestone
30.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-08-21 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me