Skip to content
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

[MesonToolchain] Added native mechanism when cross-building #15919

Merged

Conversation

franramirez688
Copy link
Contributor

@franramirez688 franramirez688 commented Mar 22, 2024

Changelog: Feature: MesonToolchain can generate a native file if native=True (only makes sense when cross-building).
Changelog: Feature: Meson helper injects native and cross files if both exist.
Docs: conan-io/docs#3710
Closes: #15878

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

This is looking great.
I think I'd prefer a bit more explicit (vs magic replace under the hood) but the ground work is fantastic, lets sync to discuss.

conan/tools/meson/meson.py Outdated Show resolved Hide resolved
conans/client/graph/profile_node_definer.py Outdated Show resolved Hide resolved
conans/model/conf.py Outdated Show resolved Hide resolved
conans/model/conf.py Outdated Show resolved Hide resolved
conans/model/conan_file.py Outdated Show resolved Hide resolved
@franramirez688 franramirez688 force-pushed the frm/mesontoolchain_both_files branch 2 times, most recently from a0fab76 to f4831bd Compare April 12, 2024 11:21
@franramirez688 franramirez688 marked this pull request as ready for review April 12, 2024 11:48
machine_files.insert(0, native)
cmd += "".join([f'--native-file "{file}"' for file in machine_files])
else: # extra native file for cross-building scenarios
cmd += f' --native-file "{native}"'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm keeping the old behavior.

# Forcing to create the native context too
if cross_building(self):
tc = MesonToolchain(self, native=True)
tc.generate()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to keep this quite explicit, but I'm open to talking more 😁

@franramirez688 franramirez688 changed the title [ConanFile][MesonToolchain] ConanFile uses build context profiles [MesonToolchain] Added native mechanism when cross-building Apr 12, 2024
@franramirez688 franramirez688 modified the milestones: 2.3.0, 2.4.0 Apr 30, 2024
@memsharded memsharded merged commit 66ef385 into conan-io:develop2 May 6, 2024
2 checks passed
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.

[bug] Meson lacking native file during cross compiling
3 participants