aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-01-26 19:08:47 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-01-28 01:05:20 +0530
commitfc4e3326012aceeb3a1ef4a616e42e9cdfeadb9f (patch)
treeb6493e93b55f48dd76238dfefcc258dffbbd83b7 /mesonbuild/backend/backends.py
parent4677f37366b2b57053e065d9bb188191dddfa5e9 (diff)
downloadmeson-fc4e3326012aceeb3a1ef4a616e42e9cdfeadb9f.zip
meson-fc4e3326012aceeb3a1ef4a616e42e9cdfeadb9f.tar.gz
meson-fc4e3326012aceeb3a1ef4a616e42e9cdfeadb9f.tar.bz2
backends: Add support for build_by_default to vs2010 backend
Always generate the vcxproj file, but only add it to the build configuration if it's either supposed to be built by default, or is a dependency of another target that is built by default.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 6f8a50e..fe9a881 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -516,6 +516,29 @@ class Backend:
newargs.append(arg)
return newargs
+ def get_build_by_default_targets(self):
+ result = {}
+ # Get all build and custom targets that must be built by default
+ for name, t in self.build.get_targets().items():
+ if t.build_by_default or t.install or t.build_always:
+ result[name] = t
+ # Get all targets used as test executables and arguments. These must
+ # also be built by default. XXX: Sometime in the future these should be
+ # built only before running tests.
+ for t in self.build.get_tests():
+ exe = t.exe
+ if hasattr(exe, 'held_object'):
+ exe = exe.held_object
+ if isinstance(exe, (build.CustomTarget, build.BuildTarget)):
+ result[exe.get_id()] = exe
+ for arg in t.cmd_args:
+ if hasattr(arg, 'held_object'):
+ arg = arg.held_object
+ if not isinstance(arg, (build.CustomTarget, build.BuildTarget)):
+ continue
+ result[arg.get_id()] = arg
+ return result
+
def get_custom_target_provided_libraries(self, target):
libs = []
for t in target.get_generated_sources():