[feature] Option to set default profile:build and profile:host in conanfile
See original GitHub issueSummary
Can we get an option to specify a default profile:build and profile:host in the conanfile?
Nice to haves:
- Allow for
profile:buildto use a variable for the current architecture (eg, so it will use a linux_x64 profile if you’re on a linux_x64 machine) - Allow a ‘none’ value for
profile:host, so that the user is forced to enter a value on the commandline. - Allow values specified as command line args to override defaults specified in conanfile
Justification:
On firmware projects that require cross-compilation, profile:build is generally going to be the current architecture of the machine the developer is using, and profile:host will almost always be the embedded device architecture (eg, an ARM toolchain).
Given that omitting profile:build and profile:host from the commandline makes significant changes to the build, I feel like this would end up being a common pitfall when getting new developers up to speed on a conan project. I think it would be less confusing if I could specify default values in the conanfile, but still be able to override them as needed.
- I’ve read the CONTRIBUTING guide.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Profiles — conan 1.56.0 documentation
Profiles allows users to set a complete configuration set for settings, options, environment variables, and build requirements in a file.
Read more >Profiles — conan 1.34.1 documentation
Profiles allows users to set a complete configuration set for settings, options, environment variables, and build requirements in a file.
Read more >Attributes — conan 1.50.2 documentation
The attribute default_options has the purpose of defining the default values for the options if the consumer (consuming recipe, project, profile or the...
Read more >conan create — conan 1.55.0 documentation
Builds a binary package for a recipe (conanfile.py). Uses the specified configuration in a profile or in -s settings, -o options, etc.
Read more >How to cross-compile your applications using Conan: host ...
In the previous examples, we learned how to use a conanfile.py or conanfile.txt to ... --build=missing --profile:host=someprofile --profile:build=default.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@solvingj I never knew that settings could be specified this way for individual packages. That’s exactly what I need, thanks a lot!
I’m pretty novice on the cross-build implications. Would it work to add this to the settings of your
build_profile?