OLD | NEW |
1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 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 collections | 5 import collections |
6 import copy | 6 import copy |
7 import hashlib | 7 import hashlib |
8 import json | 8 import json |
9 import multiprocessing | 9 import multiprocessing |
10 import os.path | 10 import os.path |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 ld_host = '$ld' | 1726 ld_host = '$ld' |
1727 else: | 1727 else: |
1728 ar = 'ar' | 1728 ar = 'ar' |
1729 cc = 'cc' | 1729 cc = 'cc' |
1730 cxx = 'c++' | 1730 cxx = 'c++' |
1731 ld = '$cc' | 1731 ld = '$cc' |
1732 ldxx = '$cxx' | 1732 ldxx = '$cxx' |
1733 ld_host = '$cc_host' | 1733 ld_host = '$cc_host' |
1734 ldxx_host = '$cxx_host' | 1734 ldxx_host = '$cxx_host' |
1735 | 1735 |
| 1736 ar_host = 'ar' |
1736 cc_host = None | 1737 cc_host = None |
1737 cxx_host = None | 1738 cxx_host = None |
1738 cc_host_global_setting = None | 1739 cc_host_global_setting = None |
1739 cxx_host_global_setting = None | 1740 cxx_host_global_setting = None |
1740 clang_cl = None | 1741 clang_cl = None |
1741 | 1742 |
1742 build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) | 1743 build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) |
1743 make_global_settings = data[build_file].get('make_global_settings', []) | 1744 make_global_settings = data[build_file].get('make_global_settings', []) |
1744 build_to_root = gyp.common.InvertRelativePath(build_dir, | 1745 build_to_root = gyp.common.InvertRelativePath(build_dir, |
1745 options.toplevel_dir) | 1746 options.toplevel_dir) |
1746 wrappers = {} | 1747 wrappers = {} |
1747 for key, value in make_global_settings: | 1748 for key, value in make_global_settings: |
1748 if key == 'AR': | 1749 if key == 'AR': |
1749 ar = os.path.join(build_to_root, value) | 1750 ar = os.path.join(build_to_root, value) |
| 1751 if key == 'AR.host': |
| 1752 ar_host = os.path.join(build_to_root, value) |
1750 if key == 'CC': | 1753 if key == 'CC': |
1751 cc = os.path.join(build_to_root, value) | 1754 cc = os.path.join(build_to_root, value) |
1752 if cc.endswith('clang-cl'): | 1755 if cc.endswith('clang-cl'): |
1753 clang_cl = cc | 1756 clang_cl = cc |
1754 if key == 'CXX': | 1757 if key == 'CXX': |
1755 cxx = os.path.join(build_to_root, value) | 1758 cxx = os.path.join(build_to_root, value) |
1756 if key == 'CC.host': | 1759 if key == 'CC.host': |
1757 cc_host = os.path.join(build_to_root, value) | 1760 cc_host = os.path.join(build_to_root, value) |
1758 cc_host_global_setting = value | 1761 cc_host_global_setting = value |
1759 if key == 'CXX.host': | 1762 if key == 'CXX.host': |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld)) | 1806 master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld)) |
1804 master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx)) | 1807 master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx)) |
1805 master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar)) | 1808 master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar)) |
1806 | 1809 |
1807 if generator_supports_multiple_toolsets: | 1810 if generator_supports_multiple_toolsets: |
1808 if not cc_host: | 1811 if not cc_host: |
1809 cc_host = cc | 1812 cc_host = cc |
1810 if not cxx_host: | 1813 if not cxx_host: |
1811 cxx_host = cxx | 1814 cxx_host = cxx |
1812 | 1815 |
1813 master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], 'ar')) | 1816 master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], ar_host)) |
1814 cc_host = GetEnvironFallback(['CC_host'], cc_host) | 1817 cc_host = GetEnvironFallback(['CC_host'], cc_host) |
1815 cxx_host = GetEnvironFallback(['CXX_host'], cxx_host) | 1818 cxx_host = GetEnvironFallback(['CXX_host'], cxx_host) |
1816 | 1819 |
1817 # The environment variable could be used in 'make_global_settings', like | 1820 # The environment variable could be used in 'make_global_settings', like |
1818 # ['CC.host', '$(CC)'] or ['CXX.host', '$(CXX)'], transform them here. | 1821 # ['CC.host', '$(CC)'] or ['CXX.host', '$(CXX)'], transform them here. |
1819 if '$(CC)' in cc_host and cc_host_global_setting: | 1822 if '$(CC)' in cc_host and cc_host_global_setting: |
1820 cc_host = cc_host_global_setting.replace('$(CC)', cc) | 1823 cc_host = cc_host_global_setting.replace('$(CC)', cc) |
1821 if '$(CXX)' in cxx_host and cxx_host_global_setting: | 1824 if '$(CXX)' in cxx_host and cxx_host_global_setting: |
1822 cxx_host = cxx_host_global_setting.replace('$(CXX)', cxx) | 1825 cxx_host = cxx_host_global_setting.replace('$(CXX)', cxx) |
1823 master_ninja.variable('cc_host', | 1826 master_ninja.variable('cc_host', |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2217 arglists.append( | 2220 arglists.append( |
2218 (target_list, target_dicts, data, params, config_name)) | 2221 (target_list, target_dicts, data, params, config_name)) |
2219 pool.map(CallGenerateOutputForConfig, arglists) | 2222 pool.map(CallGenerateOutputForConfig, arglists) |
2220 except KeyboardInterrupt, e: | 2223 except KeyboardInterrupt, e: |
2221 pool.terminate() | 2224 pool.terminate() |
2222 raise e | 2225 raise e |
2223 else: | 2226 else: |
2224 for config_name in config_names: | 2227 for config_name in config_names: |
2225 GenerateOutputForConfig(target_list, target_dicts, data, params, | 2228 GenerateOutputForConfig(target_list, target_dicts, data, params, |
2226 config_name) | 2229 config_name) |
OLD | NEW |