aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/backends.py10
-rw-r--r--mesonbuild/backend/ninjabackend.py1
-rw-r--r--mesonbuild/backend/vs2010backend.py3
-rw-r--r--mesonbuild/backend/xcodebackend.py3
4 files changed, 15 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 354d25a..e9012e5 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -24,6 +24,7 @@ from ..mesonlib import MesonException, OrderedSet
from ..mesonlib import classify_unity_sources
from ..mesonlib import File
from ..compilers import CompilerArgs
+from ..mupgrade import create_dump_dict
from collections import OrderedDict
import shlex
@@ -120,6 +121,7 @@ class OptionOverrideProxy:
# This class contains the basic functionality that is needed by all backends.
# Feel free to move stuff in and out of it as you see fit.
class Backend:
+
def __init__(self, build):
self.build = build
self.environment = build.environment
@@ -922,3 +924,11 @@ class Backend:
for s in self.build.postconf_scripts:
cmd = s['exe'] + s['args']
subprocess.check_call(cmd, env=child_env)
+
+ def dump_state_file(self):
+ import json
+ build_dir = self.environment.get_build_dir()
+ dumpfile = os.path.join(build_dir, 'meson-private', 'upgrade-state.json')
+ s = create_dump_dict(self.environment, self.build)
+ with open(dumpfile, 'w') as f:
+ json.dump(s, f)
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 09c4904..cde2151 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -238,6 +238,7 @@ int dummy;
# fully created.
os.replace(tempfilename, outfilename)
self.generate_compdb()
+ self.dump_state_file()
# http://clang.llvm.org/docs/JSONCompilationDatabase.html
def generate_compdb(self):
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index d42e91d..aee3754 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -1,4 +1,4 @@
-# Copyright 2014-2016 The Meson development team
+# Copyright 2014-2018 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -167,6 +167,7 @@ class Vs2010Backend(backends.Backend):
self.generate_solution(sln_filename, projlist)
self.generate_regen_info()
Vs2010Backend.touch_regen_timestamp(self.environment.get_build_dir())
+ self.dump_state_file()
@staticmethod
def get_regen_stampfile(build_dir):
diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py
index 9a9f88b..276e365 100644
--- a/mesonbuild/backend/xcodebackend.py
+++ b/mesonbuild/backend/xcodebackend.py
@@ -1,4 +1,4 @@
-# Copyright 2014-2016 The Meson development team
+# Copyright 2014-2018 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -103,6 +103,7 @@ class XCodeBackend(backends.Backend):
self.generate_xc_build_configuration()
self.generate_xc_configurationList()
self.generate_suffix()
+ self.dump_state_file()
def get_xcodetype(self, fname):
return self.xcodetypemap[fname.split('.')[-1]]