aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/vs2010backend.py
AgeCommit message (Collapse)AuthorFilesLines
2023-03-30backend/vs: ensure that build dir is preferred to src dirBarnabás Pőcze1-1/+2
Previously, the VS backend would add the the include directories in the reverse order that the Ninja backend does it, which means that the source directories would be preferred over the build directories. For example, this would cause the compiler to choose the file from the source directory if a file with the same name is found in both. Fixes 57ec097b5 ("vs: Use CompilerArgs() for compile and link args") Fixes #11630
2023-03-20backends: simplify class setupEli Schwartz1-1/+3
2023-01-10backends: Stop passing generator exes to ExecutableSerialisation as stringsDylan Baker1-4/+2
The code below this already handles being passed an Executable or ExternalProgram, and it does it correctly, since it handles host binaries that need an exe_wrapper correctly, while the code in the generator paths doesn't. The xcode backend is, like always, problematic, it doesn't handle things the same way as the ninja and vscode backends, and generates a shell script instead of using meson as a wrapper when needed (it seems likely that just forcing the meson path for xcode would be better). I don't have a working mac to develop a fix for, so I've left a todo comment there. Fixes: #11264
2022-11-30pylint: enable the set_membership pluginDylan Baker1-2/+2
Which adds the `use-set-for-membership` check. It's generally faster in python to use a set with the `in` keyword, because it's a hash check instead of a linear walk, this is especially true with strings, where it's actually O(n^2), one loop over the container, and an inner loop of the strings (as string comparison works by checking that `a[n] == b[n]`, in a loop). Also, I'm tired of complaining about this in reviews, let the tools do it for me :)
2022-11-10Fix options overrides for vsbackendDenis Fortin1-1/+1
Use OptionOverrideProxy instead of pure options. Closes #10393
2022-10-23vs backend: Add support for CompileTargetXavier Claessens1-0/+19
Since vs backend only support the C compiler, everything else are custom targets. Convert CompileTarget into a Generator to reuse existing code. This will be useful in the future to support transpilers, and assemblers.
2022-10-13fix: don't set FavorSizeOrSpeed in vs backend if optimization disabled (/Od ↵Luke Elliott1-1/+2
set). Debugging is broken with clang-cl when FavorSizeOrSpeed is set.
2022-10-04pylint: enable consider-merging-isinstanceDylan Baker1-1/+1
2022-09-29Add cross-compile support for Microsoft GDK platformsCaleb Cornett1-2/+9
2022-09-27compilers: Cleanup a bit languages/suffixes listsXavier Claessens1-2/+2
Use set where order does not matter, fix is_source() to really mean only source suffixes.
2022-09-20Fix including headers from another drive on VS backendVili Väinölä1-2/+6
Include paths to different drives as absolute paths fixes #8329
2022-09-19pylint: enable consider-using-inDylan Baker1-4/+4
2022-09-19pylint: enable consider-using-dict-itemsDylan Baker1-5/+4
Which found a couple of places where we could write better code.
2022-09-09vs: Fix CustomBuild contents.Andres Freund1-9/+9
%% survived into the output since 038b31e72bc02f0a9b. That failed to fail, at least in the common cases, because the whole command sequence is unnecessary / redundant - it appears to come from cmake, which executes multiple commands within a single CustomBuild element.
2022-08-24backend/ninja: properly track objects extracted from fortran sourcesDylan Baker1-1/+1
We need this to ensure that .mod files are created before we start compiling, and to ensure that the proper include directory arguments are generated.
2022-06-26add missing lower() to fix msvc backend platform detectionTad Young1-1/+1
Regardless of which MachineChoice we base the platform on, we compare its value to lowercased identifiers. So we need to lowercase the targetplatform too... but we only did so sometimes. This broke e.g. on "Win32", but only when *not* doing a cross build. Fixes #10539
2022-06-14take override_option('unity=...') into account when allowing extract_objects()Paolo Bonzini1-1/+1
A single target could be picked for unity build, and in that case extract_objects() should not be allowed. Likewise for the opposite case, where extract_objects() should be allowed if unity build is disabled for a single target. A test that covers that case is added later.
2022-06-13ninja backend: generate additional meta-rules for test/benchmarks targetsEli Schwartz1-0/+1
'meson-test-prereq' now depends on any targets that were formerly added directly to 'all'. Behavior is not changed -- the all target still depends on this other meta-rule, and thus indirectly depends on all targets it used to depend on. It is now possible to build just the targets needed for the testsuite and then e.g. run `meson test --no-rebuild`.
2022-06-10treewide: various cleanups to move imports for mypy into typechecking blocksEli Schwartz1-1/+3
Along the way, add __future__ annotations where lacking.
2022-06-08build: Store depends in GeneratedList instead of GeneratorDylan Baker1-2/+6
Since they are actually dependencies out the output not the Generator itself. This fixes dependency issues in the ninja backend, allowing Meson to rebuild more accurately. It also does sometimes in the vs backend, but there are problems in the vs backend I'm not sure how to solve. The vsbackend is, itself, so fragile looking I don't want to get too involved with it.
2022-06-08backend/vs: "fix" handling of CustomTarget dependenciesDylan Baker1-3/+6
This doesn't actually fix the problem, but it provides parity with what is currently happening. I don't have access to a Windows machine to further debug, however, so not breaking anything is the best I can do ATM.
2022-05-31Fix that VS backend respects "console" keyword in custom_targetVili Väinölä1-1/+2
Previously the output of the custom target was always captured and it was not possible to see the output unless build failed.
2022-03-29Replace backend.get_option_for_target() with target.get_option()Xavier Claessens1-3/+3
That method had nothing specific to the backend, it's purely a Target method. This allows to cache the OptionOverrideProxy object on the Target instance instead of creating a new one for each option lookup.
2022-03-22backends: Stop separating base and compiler optionsXavier Claessens1-1/+1
Since OptionKey is used we can mix all options together in a single dictionary. That's already what we do in coredata.options.
2021-11-27Fix '# Visual Studio <>' comment in sln files with VS backendLuke Elliott1-4/+7
such that Visual Studio Version Selector works.
2021-11-25Stop backend_startup_project from erasing the last project in a VS solutionLuke Elliott1-1/+1
if it is not the specified project.
2021-11-21Support Visual Studio 2022 backendCrend King1-0/+4
2021-11-21Run pylintGustavoLCR1-28/+36
2021-11-21Fix vs backend cross compilation regressionGustavoLCR1-6/+15
2021-11-02Move language standard in separate method within vsbackendMoroz Oleg1-9/+4
2021-11-02Fixes .vcxproj for vs2017 vs2019Олег Мороз1-0/+9
fixes #6314 in case of backend is vs2017 or vs2019 place LanguageStandard tag with stdcpp version and LanguageStandard_C tag with stdc version in .vcxproj file
2021-11-01various manual conversion of percent-formatted strings to f-stringsEli Schwartz1-11/+10
2021-11-01fix typoed vs backend tokenEli Schwartz1-1/+1
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.