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

Reimplement several methods for Fortran compilers #13815

Merged
merged 1 commit into from
Oct 27, 2024

Conversation

svillemot
Copy link
Contributor

The output_is_64bit, sizeof, cross_sizeof, compute_int and cross_compute_int methods are reimplemented for Fortran compilers. Those inherited from CLikeCompiler do not work since they assume C or C++.

Note that those tests rely on Fortran 2008 features (notably the c_sizeof operator).

Closes #12757

@svillemot
Copy link
Contributor Author

There is some code duplication, especially the cross_compute_int method which is almost identical. Don’t know whether you want to factorize it (the only difference is the logical operator && which is replaced by .and. in Fortran).

Copy link
Member

@dcbaker dcbaker left a comment

Choose a reason for hiding this comment

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

I'm okay with duplication here, though we could break the expressions out into some sort of class variable if you're feeling adventurous and just really want to do that.

Copy link
Member

@dcbaker dcbaker left a comment

Choose a reason for hiding this comment

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

Sorry, one small request. Could you add a release snippet about these methods being correctly implemented for Fortran? Having this documented would be good I think.

The output_is_64bit, sizeof, cross_sizeof, compute_int and cross_compute_int
methods are reimplemented for Fortran compilers. Those inherited from
CLikeCompiler do not work since they assume C or C++.

Note that those tests rely on Fortran 2008 features (notably the c_sizeof
operator).

Closes mesonbuild#12757
@svillemot
Copy link
Contributor Author

@dcbaker Thanks for the review. I added a release snippet.

Copy link
Member

@dcbaker dcbaker left a comment

Choose a reason for hiding this comment

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

Thanks, looks great!

@dcbaker dcbaker merged commit 8c5505c into mesonbuild:master Oct 27, 2024
34 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.

compiler.find_library() always fails with a Fortran compiler and prefer_static=true
3 participants