refactor(cmake): ♻️ query machine flags from ARCH_FLAG itself - #304
Open
robertodr wants to merge 3 commits into
Open
refactor(cmake): ♻️ query machine flags from ARCH_FLAG itself#304robertodr wants to merge 3 commits into
robertodr wants to merge 3 commits into
Conversation
_monoprop_query_machine_flags took a -march *name* plus a "default" sentinel and rebuilt the flag from it, which meant the query could only ever ask about the one architecture selection the function knew how to spell. It now takes the ARCH_FLAGS list the build actually passes, so what is queried is what is compiled, and an empty list is the no-arch-flag build rather than a special case. Inert by construction and checked as such: configured with monoprop_ENABLE_ARCH_FLAGS both ON and OFF, monoprop_DEFAULT_VARIANT_FLAGS, monoprop_VARIANTS, monoprop_VARIANT_FLAGS and ARCH_FLAG all come out identical to the previous implementation. Assisted-by: ClaudeCode:claude-opus-5
robertodr
requested review from
diagonal-hamiltonian,
fpietra and
ludmilaasb
as code owners
August 29, 2026 14:31
|
Docs preview: https://pr-304.monoprop-docs.pages.dev |
robertodr
enabled auto-merge (squash)
August 29, 2026 14:35
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #304 +/- ##
=======================================
Coverage ? 97.70%
=======================================
Files ? 14
Lines ? 742
Branches ? 98
=======================================
Hits ? 725
Misses ? 12
Partials ? 5
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
robertodr
disabled the stack merge
August 29, 2026 19:44
9 tasks
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.



🤖 AI text below 🤖
Summary
Independent of the rest of the #226 split; branches off
mainand touches one CMake file._monoprop_query_machine_flagstook aMARCH <arch>argument and a"default"sentinel meaning "whatever the compiler already targets". That asks the option what the machine flags are, when the thing that actually decides them is the flag the compiler ends up emitting. The helper now takesARCH_FLAGS <flags...>directly and reports what those flags yield, so a caller passes what it is really compiling with instead of a name that stands in for it.No change to the flags any build produces. Configured with
monoprop_ENABLE_ARCH_FLAGSboth ON and OFF against the old and new helper:monoprop_DEFAULT_VARIANT_FLAGS,monoprop_VARIANTS,monoprop_VARIANT_FLAGSandARCH_FLAGcome out identical in all four combinations.Changes
cmake/compiler_flags/CXXFlags.cmake:_monoprop_query_machine_flags(ARCH_FLAGS <flags...> OUTPUT_VARIABLE <var>)replaces theMARCH <arch>form and its"default"sentinel; call sites updated.Checklist
docs/,CONTRIBUTING.md) if neededCHANGELOG/ release notes updated if applicableBuild-system change with no test surface; verified by comparing the derived variables across configures.
AI/LLM disclosure