OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import copy | 5 import copy |
6 import gyp | 6 import gyp |
7 import gyp.common | 7 import gyp.common |
8 import gyp.msvs_emulation | 8 import gyp.msvs_emulation |
9 import gyp.system_test | 9 import gyp.system_test |
10 import gyp.xcode_emulation | 10 import gyp.xcode_emulation |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 # gyp dictates that commands are run from the base directory. | 938 # gyp dictates that commands are run from the base directory. |
939 # cd into the directory before running, and adjust paths in | 939 # cd into the directory before running, and adjust paths in |
940 # the arguments to point to the proper locations. | 940 # the arguments to point to the proper locations. |
941 if self.flavor == 'win': | 941 if self.flavor == 'win': |
942 cd = 'cmd /s /c "cd %s && ' % self.build_to_base | 942 cd = 'cmd /s /c "cd %s && ' % self.build_to_base |
943 else: | 943 else: |
944 cd = 'cd %s; ' % self.build_to_base | 944 cd = 'cd %s; ' % self.build_to_base |
945 args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args] | 945 args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args] |
946 env = self.ComputeExportEnvString(env) | 946 env = self.ComputeExportEnvString(env) |
947 if self.flavor == 'win': | 947 if self.flavor == 'win': |
948 # TODO(scottmg): Really don't want encourage cygwin, but I'm not sure | 948 # TODO(scottmg): Respect msvs_cygwin setting here. |
949 # how much sh is depended upon. For now, double quote args to make most | 949 command = gyp.msvs_emulation.EncodeCmdExeList(args) |
950 # things work. | |
951 command = args[0] + ' "' + '" "'.join(args[1:]) + '""' | |
952 else: | 950 else: |
953 command = gyp.common.EncodePOSIXShellList(args) | 951 command = gyp.common.EncodePOSIXShellList(args) |
954 if env: | 952 if env: |
955 # If an environment is passed in, variables in the command should be | 953 # If an environment is passed in, variables in the command should be |
956 # read from it, instead of from ninja's internal variables. | 954 # read from it, instead of from ninja's internal variables. |
957 command = ninja_syntax.escape(command) | 955 command = ninja_syntax.escape(command) |
958 | 956 |
959 command = cd + env + command | 957 command = cd + env + command |
960 # GYP rules/actions express being no-ops by not touching their outputs. | 958 # GYP rules/actions express being no-ops by not touching their outputs. |
961 # Avoid executing downstream dependencies in this case by specifying | 959 # Avoid executing downstream dependencies in this case by specifying |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 | 1250 |
1253 user_config = params.get('generator_flags', {}).get('config', None) | 1251 user_config = params.get('generator_flags', {}).get('config', None) |
1254 if user_config: | 1252 if user_config: |
1255 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1253 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1256 user_config) | 1254 user_config) |
1257 else: | 1255 else: |
1258 config_names = target_dicts[target_list[0]]['configurations'].keys() | 1256 config_names = target_dicts[target_list[0]]['configurations'].keys() |
1259 for config_name in config_names: | 1257 for config_name in config_names: |
1260 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1258 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1261 config_name) | 1259 config_name) |
OLD | NEW |