aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/vs2010backend.py
AgeCommit message (Collapse)AuthorFilesLines
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
2020-04-24backend/vs: Fix build when not all languages have pchPeter Harris1-10/+4
It is not unheard-of for a project to use pch for C++ but not for C (because C usually builds fast enough anyway, so it's not worth the developer overhead of maintaining the pch file). This code was trying to optimize the vcxproj file size by detecting "only one language", but it was only looking at the number of pch-languages defined. This is incorrect when pch is not defined for all languages in use. Instead of tweaking the optimization further, remove it. This makes the vs backend behave more like the ninja backend.
2020-04-20Compiler options per langJohn Ericson1-7/+11
A current rather untyped storage of options is one of the things that contributes to the options code being so complex. This takes a small step in synching down by storing the compiler options in dicts per language. Future work might be replacing the langauge strings with an enum, and defaultdict with a custom struct, just like `PerMachine` and `MachineChoice`.
2020-04-11Handle BuildTarget as custom_target() argument #6914Marc-André Lureau1-1/+1
2020-04-10Fixes meson bug to allow arm64 buildJesse Natalie1-1/+5
2020-04-04backend/vs: Fix link of wmain / wWinMain based appsPeter Harris1-5/+0
Executables may have an entry point of wmain or wWinMain. These executables link successfully with ninja. Rather than add more flags to executable() in meson.build, remove the EntryPointSymbol override. This makes the vs backend behave more like the ninja backend. Fixes #6698
2020-04-03backend/vs: Fix debug information and runtime checksPeter Harris1-6/+6
Both DebugInformationFormat and BasicRuntimeChecks need to be in clconf (not type_config) for Visual Studio to recognize them. Fixes #6699
2020-01-28backend: refactor: set self.interpreter in the constructorDaniel Mensinger1-9/+10
2020-01-22vs: Write checksums in PE binaries (DLLs and EXEs)Nirbheek Chauhan1-0/+4
This is needed for detecting data corruption, and its absence (or an incorrect value) is also used as a hint by anti-viruses that the binary may be malware. Flag is only supported by MSVC `link.exe`, not `lld-link.exe` https://docs.microsoft.com/en-us/cpp/build/reference/release-set-the-checksum
2019-11-30Prevent the presence of duplicated items in .vcxproj filesLuca Bacci1-22/+43
Visual Studio refuses to open projects that present duplicated items, for example: <ItemGroup> <CLInclude Include="glib-enumtypes.h"/> <CLInclude Include="glib-enumtypes.h"/> </ItemGroup> Note that MSBuild handles duplicated items without any issue, this is useful only for compatibility with the VS IDE. See pull request mesonbuild#6151 Fixes issue mesonbuild#6147
2019-07-19backends: choose whether to serialize in as_meson_exe_cmdlinePaolo Bonzini1-6/+7
This removes more duplicate code between custom targets and generators. In addition, generators can now have arguments with newlines in them.
2019-07-19vs2010backend: always serialize executables for generatorsPaolo Bonzini1-12/+14
Do the same as for custom targets.
2019-07-19backends: hide meson --internal exe cmdline from backendsPaolo Bonzini1-9/+7
Return the command line from serialize_executable, which is then renamed to as_meson_exe_cmdline. This avoids repeating code that is common to custom targets and generators.
2019-07-10vs backend: commandrunner.py takes source dir firstXavier Claessens1-1/+1
2019-07-10Add alias_target() functionXavier Claessens1-1/+6
2019-06-09Purge `is_cross` and friends without changing user interfacesJohn Ericson1-14/+10
In most cases instead pass `for_machine`, the name of the relevant machines (what compilers target, what targets run on, etc). This allows us to use the cross code path in the native case, deduplicating the code. As one can see, environment got bigger as more information is kept structured there, while ninjabackend got a smaller. Overall a few amount of lines were added, but the hope is what's added is a lot simpler than what's removed.
2019-06-08Moved RuntimeLibrary property to ItemDefinitionGroup/ClCompilefilippocrocchini1-9/+10
2019-05-02Merge pull request #5311 from mensinda/flake8PluginsJussi Pakkanen1-3/+3
Added flake8 plugins and some code fixes
2019-04-29Added special handling of CustomTargetIndex in VS backendTheQwertiest1-1/+5
2019-04-29Added custom_target[i] support for link_with and link_wholeTheQwertiest1-2/+8
2019-04-29Fixed unnecessary .items()Daniel Mensinger1-3/+3
2019-04-29Fix unused variables warningsDaniel Mensinger1-1/+1
2019-04-16vs2010backend: emit dependencies for generatorsPaolo Bonzini1-0/+3
This is the VS-specific part of the previous commit; the Visual Studio backend was ignoring dependencies, add an AdditionalInputs element similar to what add_custom_build does.
2019-04-16vs2010backend: fix flake8 issuePaolo Bonzini1-1/+0
mesonbuild/backend/vs2010backend.py:506:9: F841 local variable action is assigned to but never used
2019-04-16Add VS2019 backend CI and docs.Anton Kochkov1-1/+1
2019-04-10Add support for VS2019. Closes #4640.Jussi Pakkanen1-0/+4
2019-03-02Move the optimization options in the compiler configSteve Lhomme1-22/+21
They have no effect in the "Configuration" PropertyGroup at least in VS2017
2019-03-01auto generate msvc pch source file if none is provided by the userNicolas Schneider1-8/+19
2019-02-24vs: add support for `build_always_stale` for custom targetsNicolas Schneider1-4/+14
2019-02-21vs: use CustomBuild instead of CustomBuildStep for custom targetsNicolas Schneider1-5/+2
This allows to view the build step in VS and reuses the same concept that we use for run targets instead of maintaining two different behaviors.
2019-02-16Merge pull request #4917 from nioncode/vs-fixTargetDependenciesJussi Pakkanen1-10/+26
vs: use project references in vcxproj instead of the sln file
2019-02-15Remove remaining cross-specific compiler-args codeJohn Ericson1-13/+10
Since the consolidation of flags in `compiler_options.*`, this cross/native special casing is not needed.
2019-02-13vs: link dependencies of link_whole targetsNicolas Schneider1-6/+15
Otherwise, msbuild will not create any output for targets that don't have any sources.
2019-02-13vs: do not automatically link dependenciesNicolas Schneider1-0/+4
2019-02-13vs: use project references in vcxproj instead of the sln fileNicolas Schneider1-8/+11
This shows dependencies clearly in the 'references' view of VS and properly propagates the dependencies when building a single vcxproj with msbuild.
2019-02-12vs: refactor regen target creationNicolas Schneider1-28/+16
2019-02-12vs: always consider run, install, and test targets out-of-dateNicolas Schneider1-26/+23
Pre/PostBuildEvents do not run if no other build steps are out-of-date. For most run targets (including install and test) that have no other build steps, VS considers these to be always up-to-date after they have been built once. On the other hand, CustomBuild has clearly defined inputs and outputs that define whether the target is up-to-date or not. By using a nonexistent file as output of CustomBuild, it is always considered out-of-date. This aligns the VS behavior with ninja. `ninja install` unconditionally installs, `ninja test` always runs the tests, and a run target always gets executed, without any checks whether it is up-to-date or not.
2019-02-12vs: remove regen project dependency from solution fileNicolas Schneider1-2/+0
We now set up the project as a reference inside the vcxproj, so the explicit order in the solution is not needed anymore.
2019-02-12vs: add reconfigure checks for each targetNicolas Schneider1-3/+9
Previously, this was only added to C/C++ targets, but not for others. Thus, if you'd change a setting through `meson configure`, this was not picked up, e.g. the install target said it was up-to-date and when force rebuilding it, it also did not use the new settings until the build dir was manually reconfigured.
2019-02-04Merge pull request #4626 from Ericson2314/consolidate-propertiesJussi Pakkanen1-9/+17
Go through coreutils.compiler_options.{build.host.target}
2019-02-04vs: add PCH headers to projectNicolas Schneider1-1/+4
Otherwise, they will not be visible in the IDE.
2019-02-02Never access environment.properties downstreamJohn Ericson1-9/+17
Instead use coredata.compiler_options.<machine>. This brings the cross and native code paths closer together, since both now use that. Command line options are interpreted just as before, for backwards compatibility. This does introduce some funny conditionals. In the future, I'd like to change the interpretation of command line options so - The logic is cross-agnostic, i.e. there are no conditions affected by `is_cross_build()`. - Compiler args for both the build and host machines can always be controlled by the command line. - Compiler args for both machines can always be controlled separately.
2019-01-29pep8 py37Michael Hirsch, Ph.D1-16/+16
2019-01-29vs: fix PCHNicolas Schneider1-23/+28