-
Notifications
You must be signed in to change notification settings - Fork 993
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
Add implements attribute in ConanFile to provide opt-in automatic management of some options and settings. #14320
Merged
czoido
merged 8 commits into
conan-io:release/2.0
from
czoido:add_opt_in_for_default_option_handling
Jul 19, 2023
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
aed5b01
add options_auto_handle to auto handle options
czoido c81a24f
add with_options_auto_handle
czoido 69e5ae1
minor changes
czoido 65f4303
review
memsharded 4904b75
implement implements
czoido 8e0bb02
fix comment
czoido fd8d81f
review
czoido 3437b90
unused import
czoido File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
6 changes: 3 additions & 3 deletions
6
conan/tools/helpers.py → conans/client/conanfile/implementations.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
from conans.model.pkg_type import PackageType | ||
|
||
|
||
def default_config_options(conanfile): | ||
def auto_shared_fpic_config_options(conanfile): | ||
if conanfile.settings.get_safe("os") == "Windows": | ||
conanfile.options.rm_safe("fPIC") | ||
|
||
|
||
def default_configure(conanfile): | ||
def auto_shared_fpic_configure(conanfile): | ||
if conanfile.options.get_safe("header_only"): | ||
conanfile.options.rm_safe("fPIC") | ||
conanfile.options.rm_safe("shared") | ||
elif conanfile.options.get_safe("shared"): | ||
conanfile.options.rm_safe("fPIC") | ||
|
||
|
||
def default_package_id(conanfile): | ||
def auto_header_only_package_id(conanfile): | ||
if conanfile.options.get_safe("header_only") or conanfile.package_type is PackageType.HEADER: | ||
conanfile.info.clear() |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this
if
be part of theheader_only
automation? Maybe not, I guess the meaning ofauto-shared_fpic
is "you can remove these options if they are not necessary"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think is fine as is but would require a clear explanation in the docs