summaryrefslogtreecommitdiff
path: root/mesonbuild/backend/vs2010backend.py
AgeCommit message (Collapse)Author
2025-12-16review get_subdir vs get_builddirPaolo Bonzini
Comparing the implementation of build_subdir with https://github.com/mesonbuild/meson/pull/12258, both of them introduced a similar separation between srcdir and builddir. There were some differences in the choices of srcdir vs builddir; this commit tries to identify which are bugs in which implementation, and get the best of both worlds.
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_compile_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_std_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_link_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.sanitizer_argsDylan Baker
2025-11-17Support Visual Studio 2026.Jussi Pakkanen
2025-11-12compilers: pass target and env to sanitizer_*_argsPaolo Bonzini
The Rust compiler will need these to check the rust_nightly option. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-12build: Use a tuple for pch dataDylan Baker
This really isn't a list because it's not homogenous data, it's really `tuple[str, str | None] | None`, but we're using list length to decide what to do with it, and that makes for strict null issues, as an accurate annotation would be `list[str | None]`, which would require a lot of `is not None` checking. By using a tuple we don't need to keep checking length, which is more expensive than null checking. To ensure correctness I annotated some things in the VS backend
2025-11-03backends: add CustomTargetIndexes to meson-{test,benchmark}-prereqPaolo Bonzini
If a CustomTargetIndex is passed as an argument to a test, running meson test (with no test glob) does not automatically build the custom_target before running the test, because CustomTargetIndex outputs are not added as prerequisites to the meson-test-prereq and meson-benchmark-prereq targets. Fixes: #14743 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29environment, backends: remove is_* methodsPaolo Bonzini
They are duplicates of what is already in compilers and have no state. Just use compilers. Fixes: #15082 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-16backend: remove InterpreterPaolo Bonzini
No one is accessing backend.interpreter anymore, get rid of it to avoid future temptations. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-14Make use of build TypeAliasesDylan Baker
There are a lot of spelled out unions for these types, lets reduce that number
2025-10-06options: replace get_value with get_value_forPaolo Bonzini
The two methods are identical. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-06compilers: Enable out-of-the-box MSVC compatibility with ccacheL. E. Segovia
ccache has been for a long time compatible with MSVC (since 4.6) but when using debug mode, the /Z7 flag must be passed instead of /Zi. See https://ccache.dev/releasenotes.html#_ccache_4_6
2025-06-05vsbackend: detect toolset and SDK version at generate() timePaolo Bonzini
Compilers are not ready at the time the backend is created. Do not look at them until generate() runs. Fixes: 4e9fac15d ("interpreter: add backend options before validating the command line options", 2025-05-16) Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-05-26vs2010backend: fix EmbedManifest state when /MANIFEST:EMBED is usedPeter Harris
With introduction of dfd8cfbd8d9c VS compile is broken for cases where /MANIFEST:EMBED linker flag is actually used. The fix keeps the default creation of <EmbedManifest> but adopts the same strategy as e3db7af0ea41, that is to scan the link flags for the embed case to decide state is emit 'true' or 'false' for EmbedManifest.
2025-05-26vs2010backend: Escape linker argumentsPeter Harris
This allows linker arguments containing a space (or other special character) to pass through to the linker correctly. For example, the spaces in "test cases/windows/25 embed manifest" when using meson.project_source_root().
2025-05-15vs2010backend: Initial MASM language supportZephyr Lykos
2025-04-04compilers: introduce get_option_std_argsPaolo Bonzini
Allow CUDA to completely override the -std arguments but not the rest. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-03-10coredata: replace get_option with optstore.get_value_forDylan Baker
This is an old method, that is now just a wrapper around the OptionStore method, that doesn't add any value. It's also an option related method attached to the CoreData instead of the OptionStore, so useless and a layering violation.
2025-03-09compilers: convert `b_sanitize` to a free-form array optionPatrick Steinhardt
In the preceding commit we have started to perform compiler checks for the value of `b_sanitize`, which allows us to detect sanitizers that aren't supported by the compiler toolchain. But we haven't yet loosened the option itself to accept arbitrary values, so until now it's still only possible to pass sanitizer combinations known by Meson, which is quite restrictive. Lift that restriction by adapting the `b_sanitize` option to become a free-form array. Like this, users can pass whatever combination of comma-separated sanitizers to Meson, which will then figure out whether that combination is supported via the compiler checks. This lifts a couple of restrictions and makes the supporting infrastructure way more future proof. A couple of notes regarding backwards compatibility: - All previous values of `b_sanitize` will remain valid as the syntax for free-form array values and valid combo choices is the same. We also treat 'none' specially so that we know to convert it into an empty array. - Even though the option has been converted into a free-form array, callers of `get_option('b_sanitize')` continue to get a string as value. We may eventually want to introduce a kwarg to alter this behaviour, but for now it is expected to be good enough for most use cases. Fixes #8283 Fixes #7761 Fixes #5154 Fixes #1582 Co-authored-by: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: Patrick Steinhardt <ps@pks.im>
2025-02-13Make all Meson level options overridable per subproject.Jussi Pakkanen
2025-01-29Fix call to object_filename_from_source in vs2010Charles Brunet
There was a missing parameter in one call. This was caused by b95e1777ddbf0f8aebb56b84a6011468088c06ec
2025-01-08First draft version of Tasking MIL linking with b_lto and prelinkinggerioldman
2024-09-11Fix typosspaette
2024-07-17Remove language (AKA compiler) type from OptionKey.Jussi Pakkanen
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen
2024-06-24Update mesonbuild/backend/vs2010backend.pyRenan Lavarec
Co-authored-by: Charles Brunet <charles.brunet@optelgroup.com>
2024-06-24Vs2010Backend: Fix REGEN.vcxproj not getting default debug config in releaseRenan Lavarec
2024-06-14Replace direct indexing with named methods.Jussi Pakkanen
2024-06-14Rename option variable to optstore to make it unique.Jussi Pakkanen
2024-05-01use a for loop, check more linker optionsmatyalatte
2024-05-01vs2010backend: fix an error when using /MANIFEST:NOmatyalatte
2024-04-24backend: fix type annotation of Backend.generateDylan Baker
`func(value: dict = None)` is invalid, it must be `func(value: dict | None = None)`, or in our older syntax: `T.Optional[T.Dict] = None`
2024-04-05depends keyword argument: accept CustomTargetIndexGerion Entrup
That holds for all of these meson function: run_target, generator and custom_target and additionally to the Windows and Gnome module.
2024-03-28Pass Environment down from BackendSam James
We'll need it in a moment for get_base_compile_args -> get_assert_args. Bug: https://github.com/mesonbuild/meson/issues/12962 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-02-07Fix minsize optimization for vs backendCharles Brunet
Fixes #12265
2024-01-26backends: Make object_filename_from_source() backend-agnosticAlbert Tang
Some backends may need to use its own target directories instead of our default one. For this, introduce an optional argument "targetdir" that will still use our default one when not specified.
2024-01-17Improve project naming and build configuration in genvslite projectsRoger Sanders
This change fixes two usability issues with the genvslite project generation. Unlike when using the full VS backend, under genvslite the ProjectName property wasn't being set for generated projects. This means projects end up being named according to the project files, which includes suffixes like "@exe" in the solution, which is undesirable. This change adds the ProjectName field in for genvslite projects, to keep the naming consistent with projects under the VS backend. Additionally, previously under genvslite, no projects were set to build under any solution configuration by default. This is inconvenient, as the user has to manually edit the build settings for each solution configuration before they can compile at the solution level. There was a note in the code to do something about this. This change enables compilation at the solution level for the default startup project in the solution, so the user can now just press F5 to build the solution and run the default startup project, as they would typically expect.
2024-01-05Fix warning_level=everything in vs backendsCharles Brunet
Fixes #12688
2024-01-01Fix intellisense errors in genvslite projectsRoger Sanders
Standard include paths need to be added to resolve STL and platform headers. Additionally, compiler args need to be separated by spaces, not semicolons, in order to be recognised.
2023-12-23Remove `get_buildtype_args` functionCharles Brunet
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See #10808. Relates to: - #11645 - #12096 - #5920 - #5814 - #8220 - #8493 - #9540 - #10487 - #12265 - #8308 - #8214 - #7194 - #11732
2023-12-22backend/vs: use the host machine instead of the target machineDylan Baker
This could lead to subtle bugs if you happened to be building a project that is some sort of toolchain (compiler, linker, etc)
2023-12-22stop using the interpreter holders for the MachineInfoDylan Baker
Anywhere we have that, we also have the Environment object, which is just wrapped by the Interpreter methods anyway. This avoids inderections that are unnecessary.
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-12-10vs: Manually link generated .o filesarch1t3cht
Fixes #12550 . VS automatically links CustomBuild outputs ending in .obj or .res, but others need to be included explicitly.
2023-11-20vs2010backend: fix incompatibility with custom manifestsTamás Bálint Misius
EmbedManifest seems to default to true, which creates a default manifest based on other parameters (likewise defaults) and makes it impossible to supply your own with CREATEPROCESS_MANIFEST_RESOURCE_ID. There is value to being able to do this and no value to the default one, so this should be disabled.
2023-10-19Remove duplicated code to canonicalize b_vscrt option valueXavier Claessens
Add a common function that infers vscrt from buildtype in Compiler base class.
2023-10-09interpreter: Handle BuildTarget.vala_args as Files in the interpreterDylan Baker
Way back in Meson 0.25, support was added to `vala_args` for Files. Strangely, this was never added to any other language, though it's been discussed before. For type safety, it makes more sense to handle this in the interpreter level, and pass only strings into the build IR. This is accomplished by adding a `depend_files` field to the `BuildTarget` class (which is not exposed to the user), and adding the depend files into that field, while converting the arguments to relative string paths. This ensures both the proper build dependencies happen, as well as that the arguments are always strings.
2023-10-05Add env kwarg in generator.process()Nomura