Skip to content

compilers: improve /Fe vs /Fo args for MSVC - #16107

Open
lucascolley wants to merge 1 commit into
mesonbuild:masterfrom
lucascolley:Fe
Open

compilers: improve /Fe vs /Fo args for MSVC#16107
lucascolley wants to merge 1 commit into
mesonbuild:masterfrom
lucascolley:Fe

Conversation

@lucascolley

Copy link
Copy Markdown

This avoids erroneously generating e.g.

clang-cl.exe ... /Fosanity_check_for_cython.dll sanity_check_for_cython.c ... /link ... /DLL

as happens in Meson 1.12.0 — see scipy/scipy#25904 for an issue that might have been avoided without this bug.

Ref. https://learn.microsoft.com/en-us/cpp/build/reference/fo-object-file-name?view=msvc-170 vs. https://learn.microsoft.com/en-us/cpp/build/reference/fe-name-exe-file?view=msvc-170.


Issue diagnosed and patch generated by Claude Opus 5; patch reviewed and edited by me.

cargs = list(self.environment.coredata.get_external_args(self.for_machine, self.language))
largs = list(self.environment.coredata.get_external_link_args(self.for_machine, self.language))
return self.exelist_no_ccache + self.get_always_args() + self.get_output_args(binname) + [sourcename] + cargs, largs
return self.exelist_no_ccache + self.get_always_args() + self.get_image_output_args(binname) + [sourcename] + cargs, largs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is subtly wrong, because the subclass CLikeCompiler._sanity_check_compile_args can choose to make the sanity check compilation only. I'm trying to understand what's the right API for this.

this avoids erroneously generating e.g.

```
clang-cl.exe ... /Fosanity_check_for_cython.dll
sanity_check_for_cython.c ... /link ... /DLL
```

as happens in Meson 1.12.0

---

Issue diagnosed and patch generated by Claude Opus 5, patch reviewed and
edited by me.

[skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants