Commit Graph

223 Commits

Author SHA1 Message Date
Jussi Pakkanen 1f4023fa47
Merge pull request #5311 from mensinda/flake8Plugins
Added flake8 plugins and some code fixes
2019-05-02 23:30:29 +03:00
TheQwertiest 61f9cdf962 Added special handling of CustomTargetIndex in VS backend 2019-04-29 17:12:02 +03:00
TheQwertiest 8c9a25456d Added custom_target[i] support for link_with and link_whole 2019-04-29 16:07:50 +03:00
Daniel Mensinger 236221061a
Fixed unnecessary .items() 2019-04-29 12:23:13 +02:00
Daniel Mensinger 3581839f4c
Fix unused variables warnings 2019-04-29 12:22:50 +02:00
Paolo Bonzini c8b414f6b9 vs2010backend: emit dependencies for generators
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-16 01:46:31 +00:00
Paolo Bonzini 5952256566 vs2010backend: fix flake8 issue
mesonbuild/backend/vs2010backend.py:506:9: F841 local variable action is assigned to but never used
2019-04-16 01:46:31 +00:00
Anton Kochkov ad0ba6a911 Add VS2019 backend CI and docs. 2019-04-16 00:11:02 +03:00
Jussi Pakkanen 04710b087a Add support for VS2019. Closes #4640. 2019-04-10 23:13:47 +03:00
Steve Lhomme cb9b151985 Move the optimization options in the compiler config
They have no effect in the "Configuration" PropertyGroup at least in VS2017
2019-03-02 12:40:56 +02:00
Nicolas Schneider ded0defc3f auto generate msvc pch source file if none is provided by the user 2019-03-01 21:50:31 +02:00
Nicolas Schneider 72370faef0 vs: add support for `build_always_stale` for custom targets 2019-02-24 23:53:18 +02:00
Nicolas Schneider 76db753286 vs: use CustomBuild instead of CustomBuildStep for custom targets
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-21 23:07:18 +02:00
Jussi Pakkanen 3ac7df6a6a
Merge pull request #4917 from nioncode/vs-fixTargetDependencies
vs: use project references in vcxproj instead of the sln file
2019-02-16 14:17:19 +02:00
John Ericson d87744138a Remove remaining cross-specific compiler-args code
Since the consolidation of flags in `compiler_options.*`, this
cross/native special casing is not needed.
2019-02-15 09:17:24 -08:00
Nicolas Schneider 907fb59f67 vs: link dependencies of link_whole targets
Otherwise, msbuild will not create any output for targets that don't have
any sources.
2019-02-13 20:49:54 +01:00
Nicolas Schneider 9c55e50bea vs: do not automatically link dependencies 2019-02-13 20:49:54 +01:00
Nicolas Schneider 06268665cd vs: use project references in vcxproj instead of the sln file
This shows dependencies clearly in the 'references' view of VS and properly
propagates the dependencies when building a single vcxproj with msbuild.
2019-02-13 20:49:54 +01:00
Nicolas Schneider e004e711b1 vs: refactor regen target creation 2019-02-12 23:31:59 +01:00
Nicolas Schneider b1c3d150fe vs: always consider run, install, and test targets out-of-date
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-12 23:31:49 +01:00
Nicolas Schneider ccdac894ee vs: remove regen project dependency from solution file
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-12 20:02:28 +02:00
Nicolas Schneider a0112cfb26 vs: add reconfigure checks for each target
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-12 20:02:28 +02:00
Jussi Pakkanen 902aaf2ce6
Merge pull request #4626 from Ericson2314/consolidate-properties
Go through coreutils.compiler_options.{build.host.target}
2019-02-04 23:06:46 +01:00
Nicolas Schneider c1fa61b7d9 vs: add PCH headers to project
Otherwise, they will not be visible in the IDE.
2019-02-04 20:27:57 +01:00
John Ericson 19f81d3e33 Never access environment.properties downstream
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-02-02 13:59:14 -05:00
Michael Hirsch, Ph.D da34bea893 pep8 py37 2019-01-29 22:06:11 +02:00
Nicolas Schneider 09739284be vs: fix PCH 2019-01-29 22:03:47 +02:00
Nicolas Schneider 2dcb6eb0b3 vs: escape embedded quotes of run targets 2019-01-27 20:10:09 +02:00
Nicolas Schneider f1b32aa4bb vs: respect 'b_pch' option
Fixes #4681.
2019-01-02 22:17:36 +02:00
John Preston ca2e378c98 Update VS files only if something changed.
If you change only some project in meson.build,
only that .vcxproj file will be updated and reloaded.

If you change something not related to VS solution and projects
or simply touch the meson.build file, nothing will be reloaded.
2018-12-07 21:36:48 +02:00
John Preston c17a80f47b Use correct environment for REGEN in VS backend.
Try to guess which VS Command Prompt was used for the Meson call.
If one is chosen invoke it before calling Meson in REGEN command.
2018-12-04 20:19:19 +02:00
Jussi Pakkanen 509afe752c Use /O1 instead of /Os for MSVC as the latter is deprecated. 2018-11-28 00:17:08 +02:00
Jussi Pakkanen 50d5bcff87 Remove MinimalRebuild as it is deprecated. Closes #4539. 2018-11-22 22:30:34 +02:00
John Preston 5d6dcf8850 Fix ProjectGuid values in VS projects. 2018-11-15 21:07:33 +02:00
John Preston 16144fd61b Add 'meson.build' to VS project files. 2018-11-15 21:06:31 +02:00
Jussi Pakkanen 54aed1a92c Added "native" kwarg to add_XXX_args. Closes #3669. 2018-08-22 23:22:48 +03:00
Jussi Pakkanen d83f77109a
Convert buildtype to optimization and debug options (#3489) 2018-08-18 20:39:47 +03:00
Emil Styrke 2e3e2abceb Fix @CURRENT_SOURCE_DIR@ in generator()
Fix @CURRENT_SOURCE_DIR@ pointing to the wrong directory if generator() is called from a subdir.
2018-08-07 04:57:34 -07:00
Jussi Pakkanen e75f6e4305
Merge pull request #3850 from mesonbuild/nirbheek/exe-wrapper-compiler-fallbacks
Be more permissive about not-found exe_wrapper
2018-07-31 19:33:06 +03:00
Jussi Pakkanen 7bb5f82736 Added install target to VS. Closes #3841. 2018-07-22 16:05:09 +03:00
Nirbheek Chauhan e8dae2b966 cross: Be more permissive about not-found exe_wrapper
We used to immediately try to use whatever exe_wrapper was defined in
the cross file, but some people generate the cross file once and use
it for several projects, most of which do not even need an exe wrapper
to build.

Now we're a bit more resilient. We quietly fall back to using
non-exe-wrapper paths for compiler checks and skip the sanity check.
However, if some code needs the exe wrapper, f.ex., if you run a built
executable using custom_target() or run_target(), we will error out
during setup.

Tests will, of course, continue to error out when you run them if the
exe wrapper was not found. We don't want people's tests to silently
"pass" (aka skip) because of a bad CI setup.

Closes https://github.com/mesonbuild/meson/issues/3562

This commit also adds a test for the behaviour of exe_wrapper in these
cases, and refactors the unit tests a bit for it.
2018-07-09 05:39:40 +05:30
Niklas Claesson 14716ea90c Visual Studio: Implement startup project 2018-06-10 23:36:54 +03:00
Xavier Claessens b7d442150d Move <lang>_args to coredata.compiler_options 2018-06-06 20:02:37 +00:00
Nirbheek Chauhan 3e1a610702 Add a new option for building with Apple bitcode support
Normally, people would just pass -fembed-bitcode in CFLAGS, but this
conflicts with -Wl,-dead_strip_dylibs and -bundle, so we need it as
an option so that those can be quietly disabled.
2018-06-06 07:53:10 +00:00
Jussi Pakkanen 9c073620aa
Merge pull request #3372 from NickeZ/vs-sol-folders
Use visual studio solution directories
2018-04-26 00:47:11 +03:00
Xavier Claessens b0e4d4047b Fix using object extracted from a unity build
- determine_ext_objs: What matters is if extobj.target is a unity build,
  not if the target using those objects is a unity build.
- determine_ext_objs: Return one object file per compiler, taking into
  account generated sources.
- object_filename_from_source: No need to special-case unity build, it
  does the same thing in both code paths.
- check_unity_compatible: For each compiler we must extract either none
  or all its sources, taking into account generated sources.
2018-04-18 14:49:52 -04:00
Niklas Claesson c6e03b9535 Use visual studio solution directories
This implements support for visual studio solution directories.
Projects will by default be put into directories that map their sub-directory
name in the source folder. No directories are created if `--layout=flat` is used.

Fixes: #2524
2018-04-17 23:41:03 +02:00
Niklas Claesson e50a5c1311 Fix vs flat layout bug 2018-04-17 23:41:03 +02:00
Jussi Pakkanen 88ca3805e7
Merge pull request #1852 from QuLogic/openmp
Add an OpenMP dependency.
2018-04-17 21:39:13 +03:00
Nirbheek Chauhan 6089631a1b Open build files with utf-8 2018-04-17 09:55:34 +00:00