OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """MB - the Meta-Build wrapper around GYP and GN | 6 """MB - the Meta-Build wrapper around GYP and GN |
7 | 7 |
8 MB is a wrapper script for GYP and GN that can be used to generate build files | 8 MB is a wrapper script for GYP and GN that can be used to generate build files |
9 for sets of canned configurations and analyze them. | 9 for sets of canned configurations and analyze them. |
10 """ | 10 """ |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 if not ret and self.args.verbose: | 1049 if not ret and self.args.verbose: |
1050 outp = json.loads(self.ReadFile(self.args.output_path[0])) | 1050 outp = json.loads(self.ReadFile(self.args.output_path[0])) |
1051 self.Print() | 1051 self.Print() |
1052 self.Print('analyze output:') | 1052 self.Print('analyze output:') |
1053 self.PrintJSON(outp) | 1053 self.PrintJSON(outp) |
1054 self.Print() | 1054 self.Print() |
1055 | 1055 |
1056 return ret | 1056 return ret |
1057 | 1057 |
1058 def GetIsolateCommand(self, target, vals): | 1058 def GetIsolateCommand(self, target, vals): |
| 1059 isolate_map = self.ReadIsolateMap() |
| 1060 |
1059 android = 'target_os="android"' in vals['gn_args'] | 1061 android = 'target_os="android"' in vals['gn_args'] |
| 1062 ozone = 'use_ozone=true' in vals['gn_args'] |
| 1063 ozone_x11 = (ozone and 'args' in isolate_map[target] and |
| 1064 '--ozone-platform=x11' in isolate_map[target]['args']) |
1060 | 1065 |
1061 # This needs to mirror the settings in //build/config/ui.gni: | 1066 # This needs to mirror the settings in //build/config/ui.gni: |
1062 # use_x11 = is_linux && !use_ozone. | 1067 # use_x11 = is_linux && !use_ozone || use_ozone && --ozone-platform=x11 |
1063 use_x11 = (self.platform == 'linux2' and | 1068 use_x11 = (self.platform == 'linux2' and |
1064 not android and | 1069 not android and |
1065 not 'use_ozone=true' in vals['gn_args']) | 1070 (ozone_x11 or not ozone)) |
1066 | 1071 |
1067 asan = 'is_asan=true' in vals['gn_args'] | 1072 asan = 'is_asan=true' in vals['gn_args'] |
1068 msan = 'is_msan=true' in vals['gn_args'] | 1073 msan = 'is_msan=true' in vals['gn_args'] |
1069 tsan = 'is_tsan=true' in vals['gn_args'] | 1074 tsan = 'is_tsan=true' in vals['gn_args'] |
1070 | 1075 |
1071 isolate_map = self.ReadIsolateMap() | |
1072 test_type = isolate_map[target]['type'] | 1076 test_type = isolate_map[target]['type'] |
1073 | 1077 |
1074 executable = isolate_map[target].get('executable', target) | 1078 executable = isolate_map[target].get('executable', target) |
1075 executable_suffix = '.exe' if self.platform == 'win32' else '' | 1079 executable_suffix = '.exe' if self.platform == 'win32' else '' |
1076 | 1080 |
1077 cmdline = [] | 1081 cmdline = [] |
1078 extra_files = [] | 1082 extra_files = [] |
1079 | 1083 |
1080 if test_type == 'nontest': | 1084 if test_type == 'nontest': |
1081 self.WriteFailureAndRaise('We should not be isolating %s.' % target, | 1085 self.WriteFailureAndRaise('We should not be isolating %s.' % target, |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 # Then check to see if the arg contains any metacharacters other than | 1571 # Then check to see if the arg contains any metacharacters other than |
1568 # double quotes; if it does, quote everything (including the double | 1572 # double quotes; if it does, quote everything (including the double |
1569 # quotes) for safety. | 1573 # quotes) for safety. |
1570 if any(a in UNSAFE_FOR_CMD for a in arg): | 1574 if any(a in UNSAFE_FOR_CMD for a in arg): |
1571 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) | 1575 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) |
1572 return arg | 1576 return arg |
1573 | 1577 |
1574 | 1578 |
1575 if __name__ == '__main__': | 1579 if __name__ == '__main__': |
1576 sys.exit(main(sys.argv[1:])) | 1580 sys.exit(main(sys.argv[1:])) |
OLD | NEW |