Skip to content

Let the application own the MUSE_COMPILE_USE_PCH option - #254

Open
luapmartin wants to merge 2 commits into
musescore:mainfrom
luapmartin:luapmartin/app-owned-pch-option
Open

Let the application own the MUSE_COMPILE_USE_PCH option#254
luapmartin wants to merge 2 commits into
musescore:mainfrom
luapmartin:luapmartin/app-owned-pch-option

Conversation

@luapmartin

@luapmartin luapmartin commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Resolves: audacity/audacity#11898

Removes the MUSE_COMPILE_USE_PCH declaration from MuseDeclareOptions.cmake so the application owns the option, matching how MUSE_COMPILE_USE_UNITY already works (declared app-side, consumed by DeclareModuleSetup.cmake / MuseCreateModule.cmake).

Motivation: with the framework declaring it, an application wanting visibility/control of the default has to rely on option() first-declaration-wins ordering (see review discussion in audacity/audacity#11795).

The standalone build declares both MUSE_COMPILE_USE_PCH and MUSE_COMPILE_USE_UNITY explicitly OFF: with #256 merged, every source is self-contained, and the strict configuration in CI keeps missing includes and Qt module links from regressing (the follow-up suggested in #256, without a dedicated CI job).

Note for consumers: an application that does not declare MUSE_COMPILE_USE_PCH now builds without PCH (undefined → falsy in the gating checks). Both consumer apps have PRs declaring it app-side, safe to merge before or after this one: audacity/audacity#11900 (tracked by audacity/audacity#11898) and musescore/MuseScore#34791.

  • I signed the CLA
  • The title of the PR describes the problem it addresses.
  • Each commit's message describes its purpose and effects, and references the issue it resolves. If changes are extensive, there is a sequence of easily reviewable commits.
  • The code in the PR follows the coding rules.
  • I understand all aspects of the code I'm contributing and I'm able to explain it if requested.
  • The code compiles and runs on my machine, preferably after each commit individually. I have manually tested and verified that my changes fulfil their intended purpose.
  • No prior attempts to resolve this problem exist, or if they do, I listed them in my PR description and described how I avoided repeating past mistakes.
  • There are no unnecessary changes.
  • I created a unit test or vtest to verify the changes I made (if applicable).

Build configuration

audacity: audacity/audacity/master
audacity platforms: linux_x64
musescore: musescore/MuseScore/main
musescore platforms: linux_x64

@luapmartin
luapmartin requested a review from kryksyh August 28, 2026 12:17
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 1a8e7664-faeb-48d4-bda7-420a12ad46ec

📥 Commits

Reviewing files that changed from the base of the PR and between a0e9f48 and 9b35bd4.

📒 Files selected for processing (1)
  • CMakeLists.txt

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The top-level CMakeLists.txt now declares cached MUSE_COMPILE_USE_PCH and MUSE_COMPILE_USE_UNITY options with default values of OFF. The framework CMake option declarations no longer define MUSE_COMPILE_USE_PCH.

Merge Risk: ⚪ Minimal · up to 9b35b

This change moves ownership of the PCH build option to the application and keeps the standalone framework build explicitly disabled; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The framework changes remove the option declaration and add standalone-build defaults, but linked issue [#11898] requires adding option(MUSE_COMPILE_USE_PCH "Use precompiled headers." ON) to Audacity'… Add the required MUSE_COMPILE_USE_PCH option to Audacity's root CMakeLists.txt before including the framework options, or provide explicit evidence that this PR is only the framework-side prerequisite and that the linked issue is intentiona…
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The changes are limited to framework option ownership and standalone-build defaults. Both changes support the stated objectives and no unrelated code changes are identified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Description check ✅ Passed The description identifies the resolved issue, explains the motivation and behavior changes, documents consumer impact, and completes the required checklist. The unit-test item is left unchecked, but …
Title check ✅ Passed The title clearly and concisely states the primary change: application ownership of the MUSE_COMPILE_USE_PCH option.
Full details: Linked Issues check

Explanation

The framework changes remove the option declaration and add standalone-build defaults, but linked issue [#11898] requires adding option(MUSE_COMPILE_USE_PCH "Use precompiled headers." ON) to Audacity's root CMakeLists.txt before framework options are included.

Resolution

Add the required MUSE_COMPILE_USE_PCH option to Audacity's root CMakeLists.txt before including the framework options, or provide explicit evidence that this PR is only the framework-side prerequisite and that the linked issue is intentionally resolved by a separate consumer-repository change.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Full details: Description check

Explanation

The description identifies the resolved issue, explains the motivation and behavior changes, documents consumer impact, and completes the required checklist. The unit-test item is left unchecked, but it is marked as applicable only when relevant and does not prevent approval here.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@luapmartin
luapmartin force-pushed the luapmartin/app-owned-pch-option branch 2 times, most recently from 015f2c3 to 82dc7f3 Compare August 28, 2026 23:48
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.

Declare the MUSE_COMPILE_USE_PCH option app-side

1 participant