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

VS: Add support for /utf-8 #13929

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Conversation

lb90
Copy link
Contributor

@lb90 lb90 commented Nov 19, 2024

This PR does a few things:

  • Adds support for compiler and linker's always args in the vs backend
  • Global compiler and linker arguments which have no corresponding MSBuild prop go in <AdditionalOptions> (under <ClCompile> and <Link>, respectively)
  • Introduce a Compiler.add_default_args(CompileArgs) method and make all backends (ninja, xcode, vs) honour that. It's used to append Meson default arguments (at last, before the link args) in a transparent manner, so Meson's default arguments can be overriden by the user.
  • Moves /utf-8 from the MSVCCompiler's always args to VisualStudioLikeCompiler.add_default_args(CompileArgs)
  • Fixes MSVCCompiler.get_always_args() returning a reference to its internal data rather than a copy

Fixes #13860

@lb90 lb90 requested a review from jpakkane as a code owner November 19, 2024 17:59
@lb90 lb90 marked this pull request as draft November 19, 2024 18:01
@lb90 lb90 marked this pull request as ready for review November 20, 2024 08:53
@lb90 lb90 changed the title VS: Add support for /utf-8 VS: Get always args Nov 21, 2024
@lb90 lb90 marked this pull request as draft November 21, 2024 10:59
Some arguments correspond to MSBuild properties ($(VCTargetsPath)\Microsoft.cpp*.props),
for example:

 * /EH: <ExceptionHandling>
 * /O: <Optimization>
 * etc.

The ones which have no corresponding property must be specified via <AdditionalOptions>.
Otherwise it's going to be modified (e.g in the vs generator)
We're going to add /utf-8 back in subsequent commit
Thisi can be used to add default args. Unlike always args, default
args can be overriden.
extra_link_args.pop(index)
return index is not None

def check_link_arg_prefix(prefix):

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable check_link_arg_prefix is not used.
@lb90 lb90 changed the title VS: Get always args VS: Add support for /utf-8 Nov 25, 2024
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.

meson does not add /utf-8 if vc backend is used
1 participant