aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/vs2010backend.py
AgeCommit message (Collapse)AuthorFilesLines
2021-10-10Fix typos discovered by codespellChristian Clauss1-1/+1
2021-10-08backend/vs: Parallelize compilation inside one project.Andres Freund1-0/+1
UseMultiToolTask allows parallelism inside a project, without requiring cl.exe internal multi-threading (which meson generated projects currently can't use, mainly due to specifying output filenames for each object). TODO: - think about making behaviour conditional on msbuild version / add comment why not
2021-10-08backend/vs: Deduplicate basic project template.Andres Freund1-171/+61
Note that a few minor details of the output changed for some target types. I think I called them out with XXXs in the code for now.
2021-10-08backend/vs: Name pch pdb files to avoid naming & lock conflicts.Andres Freund1-0/+7
2021-10-08backend/vs: Move Microsoft.Cpp.props to before ItemDefinitionGroup.Andres Freund1-2/+3
The main reason for this move is to make it easier to merge the copies of project generation. But as far as I can tell, the Microsoft.Cpp.props import also belongs before the ItemDefinitionGroup. Originally the order seems to have been that way, but 431a9ea664 changed it in the course of other changes.
2021-10-04backend/vs: process link dependencies.Andres Freund1-0/+10
Partially-Fixes: #1799
2021-10-04remove useless variables that are no longer or were never usedEli Schwartz1-1/+0
2021-09-20backends/vs: Set ObjectFileName for generated sources.Andres Freund1-0/+3
When a static library B to a static library A with generated sources, B directly references the object file corresponding to the generated source in A. For that reference in B object_filename_from_source() is used. But A did not specify the object file name, ending up with cl.exe's default. Fixes: #9235
2021-09-14backends/vs: Do not emit dummy command for alias_command().Andres Freund1-11/+19
Alias commands did not work with the vs backend, due to trying to access target.command[0] with an empty command. Fix this by just not emitting a CustomBuild node for alias targets - the project references are enough to trigger the necessary actions. Fixes: #9247
2021-08-31pyllint: enable consider-user-enumerateDylan Baker1-2/+1
This caught a couple of cases of us doing: ```python for i in range(len(x)): v = x[i] ``` which are places to use enumerate instead. It also caught a couple of cases of: ```python assert len(x) == len(y) for i in range(len(x)): xv = x[i] yv = y[i] ``` Which should instead be using zip() ```python for xv, yv in zip(x, y): ... ```
2021-08-31pylint: turn on superflous-parensDylan Baker1-1/+1
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-20backends: remove unused name parameter from as_meson_exe_cmdlineDylan Baker1-3/+2
This parameter isn't used, at all, so just remove it
2021-08-20backends/vs: add a missing annotationDylan Baker1-1/+1
2021-08-09Fix native targets for vs backend cross compilationGustavoLCR1-10/+40
2021-06-29Add feed arg to custom_target()Simon Ser1-0/+1
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-1/+1
2021-06-22Add Visual Studio 2012/2013 backends (#8803)fanc9991-5/+35
* backends: Add a Visual Studio 2013 backend This is more-or-less a quick port from the VS2015 backend, except that we update the Visual Studio version strings and toolset versions accordingly. Also correct the generator string for Visual Studio 2015 in mesonbuild/cmake/common.py. * backend: Add VS2012 backend Similar to what we did for Visual Studio 2013, add a Visual Studio 2012 backend. * vs2010backend.py: Implement `link_whole:` if needed We actually need Visual Studio 2015 Update 2 to use `/WHOLEARCHIVE:`, which is what we are currently using for `link_whole:` on Visual Studio. For Visual Studio versions before that, we need to expand from the static targets that were indicated by `link_whole:`, and any of the sub-dependent targets that were pulled in via the dependent target's `link_whole:`. This wil ensure `link_whole:` would actually work in such cases. * vs2010backend.py: Handle objects from generated sources Unforunately, we can't use backends.determine_ext_objs() reliably, as the Visual Studio backends handle this differently. * vs2010backend.py: Fix generating VS2010 projects Visual Studio 2010 (at least the Express Edition) does not set the envvar %VisualStudioVersion% in its command prompt, so fix generating VS2010 projects by taking account into this, so that we can determine the location of vcvarsall.bat correctly. * whole archive test: Disable on vs2012/2013 backends too The Visual Studio 2012/2013 IDE has problems handling the items that would be generated from this test case, so skip this test when using --backend=vs[2012|2013]. This test does work for the Ninja backend when VS2012 or VS2013 is used, though. Consolidate this error message with XCode along with the vs2010 backend. * docs: Add the new vs2012 and vs2013 backends Let people know that we have backends for vs2012 and 2013. Also let people know that generating Visual Studio 2010 projects have been fixed and the pre-vs2015 backends now handle the `link_whole:` project option.
2021-05-15Visual Studio Address Sanitizer updatesPeter Harris1-0/+10
* Allow address sanitizer for Visual Studio 2019 version 16.9 Address Sanitizer was first supported with the current syntax in Visual Studio 16.9.0 (cl version 19.28.29910). * VS: Convert /fsanitize=address to project file setting
2021-04-19Xcode: regenerato project file when build conf changes.Jussi Pakkanen1-17/+0
2021-04-11VS: Disable MSBuild warnings for always-generated targetsJesse Natalie1-2/+5
Without this, VS will generate warning MSB8065: Custom build for item "<path>\custom_target.rule" succeeded, but specified output "<path>\outofdate.file" has not been created. This may cause incremental build to work incorrectly.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-4/+4
performed by running "pyupgrade --py36-plus" and committing the results
2021-02-25Allow custom target output to be processed by generatorsMatthias Klumpp1-9/+17
2021-02-08Fix exe wrapper detection for run targets.Jussi Pakkanen1-1/+1
2021-02-05backend: Do not check for exe wrapper twiceXavier Claessens1-1/+1
It is already checked by as_meson_exe_cmdline().
2021-02-05run_target: Add env kwargXavier Claessens1-25/+11
Re-implement it in backend using the same code path as for custom_target(). This for example handle setting PATH on Windows when command is an executable.
2021-01-27custom_target: Add env kwargXavier Claessens1-1/+2
2021-01-25Add ARM64EC as a new conceptual cpu type of arm64Ben Niu1-1/+7
ARM64EC is a new ARM64 ABI made by Microsoft. The ARM64EC binaries can be loaded in x64 processes on the latest Windows Insider Preview on ARM64, and they don't need to be emulated for the sake of performance. To support the ARM64EC build target, a new conceptual arm64 cpu type 'arm64ec' is added. The cpu can be specified in cross files like below to generate msbuild solution/vcxproj files with platform set to ARM64EC. [target_machine] system = 'windows' cpu_family = 'aarch64' cpu = 'arm64ec' endian = 'little'
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-16/+15
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2021-01-04use OptionKey for builtin and base optionsDylan Baker1-4/+4
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2021-01-04move OptionKey to mesonlibDylan Baker1-2/+1
There's starting to be a lot of things including coredata that coredata needs to itself include. putting it in mesonlib makes more sense
2021-01-04use OptionKey for compiler_optionsDylan Baker1-6/+4
2021-01-04use OptionKey for backend_optionsDylan Baker1-1/+2
2020-11-20use real pathlib moduleDylan Baker1-1/+1
We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
2020-10-14vs: add static_from_buildtype to b_vscrtPeter Harris1-0/+7
2020-10-07Add win_subsystem kwarg. Closes #7765.Jussi Pakkanen1-2/+7
2020-10-04pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger1-2/+2
2020-09-29Merge pull request #7762 from jon-turney/meson-exe-output-improveJussi Pakkanen1-7/+7
Improve the output for meson wrapped commands
2020-09-29compilers/VS: fix build to use optimization and debug flagsVili VÀinölÀ1-10/+20
- Fixed using debug and optimization built-in options in MSVC. - Fixed that VS backend does not create pdb files in release mode. VS implicitly adds the debug fields if left out. - Fix that it is possible to add debug info with ninja backend with optimizations.
2020-09-20Improve description of meson wrapped custom commandsJon Turney1-7/+7
I've always found ninja reporting 'a meson_exe.py custom command' unclear and confusing. Instead say we are invoking a custom command, wrapped by meson, and why.
2020-09-17backends: Treat build target as generator only when it's the first argNirbheek Chauhan1-1/+1
Otherwise it might be an argument to a script that just inspects the binary itself.
2020-09-13Remove redudant checks in vs2010 backendVili VÀinölÀ1-6/+3
- Implicit include dirs was checked twice in a row - Add define only if it does not yet exist rather than remove.
2020-09-13Add VS include directories to projects as wellVili VÀinölÀ1-2/+3
- "Go To Document" action previously only worked on c/cpp files which had the include directories set but it was not possible to move from header to another header.
2020-09-08typing: more fixesDaniel Mensinger1-2/+2
2020-06-22compilers: Return CompilerArgs from compiler instanceDylan Baker1-5/+4
Since the CompileArgs class already needs to know about the compiler, and we really need at least per-lanaguage if not per-compiler CompilerArgs classes, let's get the CompilerArgs instance from the compiler using a method.
2020-06-22compilers: Split CompilerArgs into a separate moduleDylan Baker1-1/+1
I've also moved this out of the compilers pacakge because we're soon going to need it in linkers, and that creates some serious spagetti
2020-06-15Add exception handling to be also written to the VS project xmlVili VÀinölÀ1-0/+12
When changing meson option cpp_eh, it was passed to cl with AdditionalOptions and resulted in unsuppressable warning "cl : command line warning D9025: overriding '/EHs' with '/EHa'"
2020-06-06backend/vs: Fix OpenMP supportPeter Harris1-17/+17
Use the IDE's OpenMP flag instead of adding /openmp to additional arguments. The IDE appears to override /openmp in additional arguments with the IDE setting, which defaults to false, leading to binaries built without OpenMP.
2020-05-19Build private directory name from output file name.Jussi Pakkanen1-0/+3
2020-05-14backend/vs: Fix b_vscrt=from_buildtype for debugoptimizedPeter Harris1-2/+2
The ninja backend only uses the debug C runtime for 'debug', not for 'debugoptimized'. The ninja backend always uses the DLL C runtime for all configurations. The documentation matches the ninja backend. Make the visual studio backend follow the documentation (and the precedent set by the ninja backend).
2020-05-04Fix incremental debug builds in VSGustavoLCR1-1/+2