Skip to content

Comments

Add new tools.gnu:disable_flags conf variable#19014

Merged
franramirez688 merged 5 commits intoconan-io:develop2from
memsharded:feature/libcxx_flag_disable
Oct 15, 2025
Merged

Add new tools.gnu:disable_flags conf variable#19014
franramirez688 merged 5 commits intoconan-io:develop2from
memsharded:feature/libcxx_flag_disable

Conversation

@memsharded
Copy link
Member

@memsharded memsharded commented Sep 29, 2025

Changelog: Feature: New tools.gnu:disable_flags configuration to allow disabling the injection of some build system flags.
Docs: Omit

Close #19006

Very preliminary, can't guarantee to merge it, just for exploration

@memsharded memsharded marked this pull request as ready for review October 14, 2025 20:52
@memsharded memsharded added this to the 2.22.0 milestone Oct 14, 2025
Copy link
Contributor

@franramirez688 franramirez688 left a comment

Choose a reason for hiding this comment

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

LGTM!

def disable_flag(conanfile, flag):
disable_flags = conanfile.conf.get("tools.gnu:disable_flags", check_type=list)
if disable_flags is None:
return False
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd simply allow something like:

Suggested change
return False
return False
elif disable_flags == ['*']:
return True

Copy link
Member Author

Choose a reason for hiding this comment

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

But we agreed to not add anything yet to implement the "all" concept, but wait for users feedback and request. Do we want to reconsider?

Copy link
Contributor

Choose a reason for hiding this comment

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

After reviewing it, I thought that it could be fine. Anyway, let's wait for it as we agreed, ok 👍

@franramirez688 franramirez688 merged commit cd407aa into conan-io:develop2 Oct 15, 2025
16 checks passed
@franramirez688 franramirez688 changed the title consider disabling libcxx flag New tools.gnu:disable_flags conf variable Oct 15, 2025
@franramirez688 franramirez688 changed the title New tools.gnu:disable_flags conf variable Add new tools.gnu:disable_flags conf variable Oct 15, 2025
@memsharded memsharded deleted the feature/libcxx_flag_disable branch October 15, 2025 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Add configuration ability to not inject -stdlib flag for compilers

3 participants